diff --git a/nix-services/default.nix b/nix-services/default.nix index 522ca5f..a6a31df 100644 --- a/nix-services/default.nix +++ b/nix-services/default.nix @@ -23,6 +23,8 @@ let + + @@ -34,6 +36,7 @@ let + # ]; config = (evalModules { diff --git a/nix-services/environment.nix b/nix-services/environment.nix index 489f9a2..d8d5b7f 100644 --- a/nix-services/environment.nix +++ b/nix-services/environment.nix @@ -16,6 +16,7 @@ with pkgs.lib; system.activationScripts.etc = mkOption {}; # Ignore system.build.etc = mkOption {}; # Ignore environment.etc = mkOption {}; # Ignore + environment.sessionVariables = mkOption {}; # Ignore }; diff --git a/nix-services/systemd.nix b/nix-services/systemd.nix index a1e6ab3..ce4e102 100644 --- a/nix-services/systemd.nix +++ b/nix-services/systemd.nix @@ -45,6 +45,10 @@ in { options = [ serviceOptions ]; }; # TODO make more specific + systemd.globalEnvironment = mkOption { + default = {}; + }; + services.dataPrefix = mkOption { default = "/var"; type = types.path; @@ -63,7 +67,7 @@ in { name = name; value = { command = pkgs.writeScript "${name}-run" (configToCommand name cfg); - environment = cfg.environment; + environment = cfg.environment // config.systemd.globalEnvironment; path = cfg.path; stopsignal = if hasAttr "KillSignal" cfg.serviceConfig then substring 3 (stringLength cfg.serviceConfig.KillSignal) cfg.serviceConfig.KillSignal