summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2020-06-19 11:45:27 +0200
committerJanne Heß <janne@hess.ooo>2020-09-03 20:27:55 +0200
commit8cf4ec8b97f4a76aa3243e344e64c8a29b8788cc (patch)
treea1fef2200975d9a42a7b5ff6ddea46b2c07f235a
parent94c2122d38aefec7aaf707757970e7a5a471b907 (diff)
nixos/systemd: Don't use apply for $PATH
When not using apply, other modules can use $PATH as a list instead of getting a colon-separated list to each /bin directory.
-rw-r--r--nixos/doc/manual/release-notes/rl-2009.xml5
-rw-r--r--nixos/modules/system/boot/systemd-unit-options.nix1
-rw-r--r--nixos/modules/system/boot/systemd.nix2
3 files changed, 6 insertions, 2 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml
index c936ae946adb..0a76bffd5c98 100644
--- a/nixos/doc/manual/release-notes/rl-2009.xml
+++ b/nixos/doc/manual/release-notes/rl-2009.xml
@@ -777,6 +777,11 @@ CREATE ROLE postgres LOGIN SUPERUSER;
<link xlink:href="https://github.com/NixOS/nixpkgs/pull/63103">PR #63103</link>.
</para>
</listitem>
+ <listitem>
+ <para>
+ <literal>config.systemd.services.${name}.path</literal> now returns a list of paths instead of a colon-separated string.
+ </para>
+ </listitem>
</itemizedlist>
</section>
diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix
index ac6fed440a26..5addc6f9ca44 100644
--- a/nixos/modules/system/boot/systemd-unit-options.nix
+++ b/nixos/modules/system/boot/systemd-unit-options.nix
@@ -234,7 +234,6 @@ in rec {
path = mkOption {
default = [];
type = with types; listOf (oneOf [ package str ]);
- apply = ps: "${makeBinPath ps}:${makeSearchPathOutput "bin" "sbin" ps}";
description = ''
Packages added to the service's <envar>PATH</envar>
environment variable. Both the <filename>bin</filename>
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index f6c23c9b900e..74d6957678f5 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -257,7 +257,7 @@ let
pkgs.gnused
systemd
];
- environment.PATH = config.path;
+ environment.PATH = "${makeBinPath config.path}:${makeSearchPathOutput "bin" "sbin" config.path}";
}
(mkIf (config.preStart != "")
{ serviceConfig.ExecStartPre =