mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
Merge pull request #317035 from ck3d/fix-node-red-path
nixos/node-red: fix passthru of PATH
This commit is contained in:
commit
b98e90213d
@ -5,15 +5,6 @@ with lib;
|
||||
let
|
||||
cfg = config.services.node-red;
|
||||
defaultUser = "node-red";
|
||||
finalPackage = if cfg.withNpmAndGcc then node-red_withNpmAndGcc else cfg.package;
|
||||
node-red_withNpmAndGcc = pkgs.runCommand "node-red" {
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
}
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${pkgs.nodePackages.node-red}/bin/node-red $out/bin/node-red \
|
||||
--set PATH '${lib.makeBinPath [ pkgs.nodePackages.npm pkgs.gcc ]}:$PATH' \
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.services.node-red = {
|
||||
@ -127,11 +118,12 @@ in
|
||||
environment = {
|
||||
HOME = cfg.userDir;
|
||||
};
|
||||
path = lib.optionals cfg.withNpmAndGcc [ pkgs.nodePackages.npm pkgs.gcc ];
|
||||
serviceConfig = mkMerge [
|
||||
{
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
ExecStart = "${finalPackage}/bin/node-red ${pkgs.lib.optionalString cfg.safe "--safe"} --settings ${cfg.configFile} --port ${toString cfg.port} --userDir ${cfg.userDir} ${concatStringsSep " " (mapAttrsToList (name: value: "-D ${name}=${value}") cfg.define)}";
|
||||
ExecStart = "${cfg.package}/bin/node-red ${pkgs.lib.optionalString cfg.safe "--safe"} --settings ${cfg.configFile} --port ${toString cfg.port} --userDir ${cfg.userDir} ${concatStringsSep " " (mapAttrsToList (name: value: "-D ${name}=${value}") cfg.define)}";
|
||||
PrivateTmp = true;
|
||||
Restart = "always";
|
||||
WorkingDirectory = cfg.userDir;
|
||||
|
Loading…
Reference in New Issue
Block a user