summary refs log tree commit diff
path: root/modules/system/boot/systemd.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-30 17:27:14 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-30 17:27:14 +0100
commit1da362b34b0dbe3245273a56a3152230484089b0 (patch)
tree1b2bd000ec9c056b153ba8a237dc9591f7ccf014 /modules/system/boot/systemd.nix
parente5d4524dda10b50f42c0c3350567170dcd67f3aa (diff)
downloadnixpkgs-1da362b34b0dbe3245273a56a3152230484089b0.tar
nixpkgs-1da362b34b0dbe3245273a56a3152230484089b0.tar.gz
nixpkgs-1da362b34b0dbe3245273a56a3152230484089b0.tar.bz2
nixpkgs-1da362b34b0dbe3245273a56a3152230484089b0.tar.lz
nixpkgs-1da362b34b0dbe3245273a56a3152230484089b0.tar.xz
nixpkgs-1da362b34b0dbe3245273a56a3152230484089b0.tar.zst
nixpkgs-1da362b34b0dbe3245273a56a3152230484089b0.zip
Fix coverage data collection
http://hydra.nixos.org/build/3253046
Diffstat (limited to 'modules/system/boot/systemd.nix')
-rw-r--r--modules/system/boot/systemd.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix
index aa0b679ea2f..2413509790d 100644
--- a/modules/system/boot/systemd.nix
+++ b/modules/system/boot/systemd.nix
@@ -229,7 +229,8 @@ let
 
           [Service]
           Environment=PATH=${def.path}
-          ${concatMapStrings (n: "Environment=${n}=${getAttr n def.environment}\n") (attrNames def.environment)}
+          ${let env = cfg.globalEnvironment // def.environment;
+            in concatMapStrings (n: "Environment=${n}=${getAttr n env}\n") (attrNames env)}
           ${optionalString (!def.restartIfChanged) "X-RestartIfChanged=false"}
 
           ${optionalString (def.preStart != "") ''
@@ -391,6 +392,15 @@ in
       description = "Default unit started when the system boots.";
     };
 
+    boot.systemd.globalEnvironment = mkOption {
+      type = types.attrs;
+      default = {};
+      example = { TZ = "CET"; };
+      description = ''
+        Environment variables passed to <emphasis>all</emphasis> systemd units.
+      '';
+    };
+
     services.journald.console = mkOption {
       default = "";
       type = types.uniq types.string;