diff --git a/modules/systemd.nix b/modules/systemd.nix index 66fffadf7..dea6517e4 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -14,6 +14,7 @@ let || cfg.sessionVariables != {}; toSystemdIni = generators.toINI { + listsAsDuplicateKeys = true; mkKeyValue = key: value: let value' = diff --git a/tests/modules/systemd/services-expected.conf b/tests/modules/systemd/services-expected.conf deleted file mode 100644 index 34b9618d6..000000000 --- a/tests/modules/systemd/services-expected.conf +++ /dev/null @@ -1,5 +0,0 @@ -[Service] -ExecStart=/some/exec/start/command --with-arguments "%i" - -[Unit] -Description=A basic test service diff --git a/tests/modules/systemd/services.nix b/tests/modules/systemd/services.nix index ea9b2b4fb..4f73c5568 100644 --- a/tests/modules/systemd/services.nix +++ b/tests/modules/systemd/services.nix @@ -10,6 +10,7 @@ with lib; }; Service = { + Environment = [ "VAR1=1" "VAR2=2" ]; ExecStart = ''/some/exec/start/command --with-arguments "%i"''; }; }; @@ -17,7 +18,16 @@ with lib; nmt.script = '' serviceFile=home-files/.config/systemd/user/test-service@.service assertFileExists $serviceFile - assertFileContent $serviceFile ${./services-expected.conf} + assertFileContent $serviceFile \ + ${builtins.toFile "services-expected.conf" '' + [Service] + Environment=VAR1=1 + Environment=VAR2=2 + ExecStart=/some/exec/start/command --with-arguments "%i" + + [Unit] + Description=A basic test service + ''} ''; }; }