[Nix-dev] Add /var/setuid-wrappers to $PATH for systemd service

Bjørn Forsman bjorn.forsman at gmail.com
Mon Sep 15 19:44:11 CEST 2014


Hi all,

How does one put /var/setuid-wrappers first in $PATH for a systemd service?

The option systemd.services.<name>.path adds /bin and /sbin to the
given paths, so it cannot be used.

Another possibility could be using
systemd.services.<name>.environment.PATH. But I failed to make it
work:

  1. systemd.services.jenkins.environment.PATH = "/var/setuid-wrappers";
  2. systemd.services.jenkins.environment = pkgs.lib.mkForce { PATH =
"/var/setuid-wrappers"; };

1) is completely ignored (nixos module wins over configuration.nix)
and 2) sort-of works...but now I have to rebuild the full PATH
manually (not a good idea!)

What I really want is for the value from configuration.nix to be
merged (preferrably in front) of the value(s) from nixos modules.

Any suggestions?

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list