diff options
author | Robert Helgesson <robert@rycee.net> | 2017-10-20 14:02:05 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2017-10-20 19:04:33 +0200 |
commit | 30b9d7f00ee5fb3a443682f0db3a17e12ab8ee59 (patch) | |
tree | 72a3342a3e0ee4f63347edec7b8280589afb6a60 /modules/systemd.nix | |
parent | b9f49cee45c1fce22244ab5ff7819f07d785dac3 (diff) |
Use only tools from Nixpkgs in activation script
Note, we still pull in the user's `PATH` in case the user has defined
their own activation blocks that depend on additional tools.
Eventually this will be deprecated and removed.
See #99.
Diffstat (limited to 'modules/systemd.nix')
-rw-r--r-- | modules/systemd.nix | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/systemd.nix b/modules/systemd.nix index d77c0076ad9..066304773f8 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -49,6 +49,17 @@ in options = { systemd.user = { + systemctlPath = mkOption { + default = "${pkgs.systemd}/bin/systemctl"; + defaultText = "\${pkgs.systemd}/bin/systemctl"; + type = types.str; + description = '' + Absolute path to the <command>systemctl</command> tool. This + option may need to be set if running Home Manager on a + non-NixOS distribution. + ''; + }; + services = mkOption { default = {}; type = types.attrs; @@ -157,7 +168,7 @@ in local -a toRestart=( ) for f in ''${maybeRestart[@]} ; do - if systemctl --quiet --user is-active "$f" \ + if ${cfg.systemctlPath} --quiet --user is-active "$f" \ && ! cmp --quiet \ "$oldUserServicePath/$f" \ "$newUserServicePath/$f" ; then @@ -187,7 +198,7 @@ in fi } - $DRY_RUN_CMD systemctl --user daemon-reload + $DRY_RUN_CMD ${cfg.systemctlPath} --user daemon-reload systemdPostReload ''; }) |