mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-20 03:43:45 +00:00
nixos/i2pd: get rid of unnecessary shell script
I think calling i2pd directly in `ExecStart` is much nicer than having an extra shell script for no reason. It's also easier to see what's going on when looking at the generated systemd unit file.
This commit is contained in:
parent
ddc93d61c0
commit
fd6d59f2ed
@ -222,14 +222,12 @@ let
|
||||
in concatStringsSep "\n" inTunOpts))];
|
||||
in pkgs.writeText "i2pd-tunnels.conf" opts;
|
||||
|
||||
i2pdSh = pkgs.writeScriptBin "i2pd" ''
|
||||
#!/bin/sh
|
||||
exec ${cfg.package}/bin/i2pd \
|
||||
${if cfg.address == null then "" else "--host="+cfg.address} \
|
||||
--service \
|
||||
--conf=${i2pdConf} \
|
||||
--tunconf=${tunnelConf}
|
||||
'';
|
||||
i2pdFlags = concatStringsSep " " (
|
||||
optional (cfg.address != null) ("--host=" + cfg.address) ++ [
|
||||
"--service"
|
||||
("--conf=" + i2pdConf)
|
||||
("--tunconf=" + tunnelConf)
|
||||
]);
|
||||
|
||||
in
|
||||
|
||||
@ -686,7 +684,7 @@ in
|
||||
User = "i2pd";
|
||||
WorkingDirectory = homeDir;
|
||||
Restart = "on-abort";
|
||||
ExecStart = "${i2pdSh}/bin/i2pd";
|
||||
ExecStart = "${cfg.package}/bin/i2pd ${i2pdFlags}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user