diff options
author | Fernando J Pando <fernando.pando@stelligent.com> | 2017-02-01 11:26:55 -0500 |
---|---|---|
committer | Fernando J Pando <fernando.pando@stelligent.com> | 2017-02-02 11:31:42 -0500 |
commit | 1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b (patch) | |
tree | f494799b9d3545060ddf3ca833a351621d040a60 /nixos | |
parent | dbd4a35060b242839ba4d41e9bb743365faef8ce (diff) | |
download | nixlib-1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b.tar nixlib-1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b.tar.gz nixlib-1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b.tar.bz2 nixlib-1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b.tar.lz nixlib-1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b.tar.xz nixlib-1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b.tar.zst nixlib-1d85e0bbab6a9f1b5a0d0a66c0ed927f6198f63b.zip |
hologram: 8d86e3f -> d20d1c3
- Updates dependencies - Adds configuration module - Tested on Nixos Unstable
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 3 | ||||
-rw-r--r-- | nixos/modules/services/security/hologram-agent.nix | 57 | ||||
-rw-r--r-- | nixos/modules/services/security/hologram-server.nix (renamed from nixos/modules/services/security/hologram.nix) | 0 |
3 files changed, 59 insertions, 1 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 23acc11db238..fed75053e567 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -498,7 +498,8 @@ ./services/security/frandom.nix ./services/security/haka.nix ./services/security/haveged.nix - ./services/security/hologram.nix + ./services/security/hologram-server.nix + ./services/security/hologram-agent.nix ./services/security/munge.nix ./services/security/oauth2_proxy.nix ./services/security/physlock.nix diff --git a/nixos/modules/services/security/hologram-agent.nix b/nixos/modules/services/security/hologram-agent.nix new file mode 100644 index 000000000000..49b5c935267b --- /dev/null +++ b/nixos/modules/services/security/hologram-agent.nix @@ -0,0 +1,57 @@ +{pkgs, config, lib, ...}: + +with lib; + +let + cfg = config.services.hologram-agent; + + cfgFile = pkgs.writeText "hologram-agent.json" (builtins.toJSON { + host = cfg.dialAddress; + }); +in { + options = { + services.hologram-agent = { + enable = mkOption { + type = types.bool; + default = false; + description = "Whether to enable the Hologram agent for AWS instance credentials"; + }; + + dialAddress = mkOption { + type = types.str; + default = "localhost:3100"; + description = "Hologram server and port."; + }; + + httpPort = mkOption { + type = types.str; + default = "80"; + description = "Port for metadata service to listen on."; + }; + + }; + }; + + config = mkIf cfg.enable { + networking.interfaces.dummy0 = { + ipAddress = "169.254.169.254"; + prefixLength = 32; + }; + + systemd.services.hologram-agent = { + description = "Provide EC2 instance credentials to machines outside of EC2"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + requires = [ "network-link-dummy0.service" "network-addresses-dummy0.service" ]; + preStart = '' + /run/current-system/sw/bin/rm -fv /var/run/hologram.sock + ''; + serviceConfig = { + ExecStart = "${pkgs.hologram.bin}/bin/hologram-agent -debug -conf ${cfgFile} -port ${cfg.httpPort}"; + }; + }; + + }; + + meta.maintainers = with lib.maintainers; [ nand0p ]; +} diff --git a/nixos/modules/services/security/hologram.nix b/nixos/modules/services/security/hologram-server.nix index e267fed27955..e267fed27955 100644 --- a/nixos/modules/services/security/hologram.nix +++ b/nixos/modules/services/security/hologram-server.nix |