1 {pkgs, config, lib, ...}:
6 cfg = config.services.hologram-agent;
8 cfgFile = pkgs.writeText "hologram-agent.json" (builtins.toJSON {
9 host = cfg.dialAddress;
13 services.hologram-agent = {
17 description = "Whether to enable the Hologram agent for AWS instance credentials";
20 dialAddress = mkOption {
22 default = "localhost:3100";
23 description = "Hologram server and port.";
29 description = "Port for metadata service to listen on.";
35 config = mkIf cfg.enable {
36 boot.kernelModules = [ "dummy" ];
38 networking.interfaces.dummy0.ipv4.addresses = [
39 { address = "169.254.169.254"; prefixLength = 32; }
42 systemd.services.hologram-agent = {
43 description = "Provide EC2 instance credentials to machines outside of EC2";
44 after = [ "network.target" ];
45 wantedBy = [ "multi-user.target" ];
46 requires = [ "network-link-dummy0.service" "network-addresses-dummy0.service" ];
48 /run/current-system/sw/bin/rm -fv /run/hologram.sock
51 ExecStart = "${pkgs.hologram}/bin/hologram-agent -debug -conf ${cfgFile} -port ${cfg.httpPort}";
57 meta.maintainers = [ ];