From 8cf4ec8b97f4a76aa3243e344e64c8a29b8788cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Fri, 19 Jun 2020 11:45:27 +0200 Subject: [PATCH] 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. --- nixos/doc/manual/release-notes/rl-2009.xml | 5 +++++ nixos/modules/system/boot/systemd-unit-options.nix | 1 - nixos/modules/system/boot/systemd.nix | 2 +- 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; PR #63103. + + + config.systemd.services.${name}.path now returns a list of paths instead of a colon-separated string. + + 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 PATH environment variable. Both the bin 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 =