In my NixOS configuration.nix, I created the following service :
systemd.user.services.xcape-daemon = {
description = "Xcape Daemon";
after=[ "graphical.target" ];
serviceConfig = {
Type = "forking";
ExecStart = ''${pkgs.xcape} -e "Hyper-L=Tab;Hyper_R=less"'';
# ExecStop = "pkill xcape"; #pkill not found in path
Restart = "on-failure";
};
wantedBy = [ "default.target" ];
};
systemd.user.services.xcape-daemon.enable = true;
However, I get the following error when checking the status of the service:
Executable "xcape" not found in path "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
Problem is that this is not my actual $PATH.
My $PATH is : /home/user/bin /run/wrappers/bin /home/user/.nix-profile/bin /etc/profiles/per-user/user/bin /nix/var/nix/profiles/default/bin /run/current-system/sw/bin