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:
Luflosi 2022-01-25 14:02:58 +01:00
parent ddc93d61c0
commit fd6d59f2ed
No known key found for this signature in database
GPG Key ID: 4E41E29EDCC345D0

View File

@ -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}";
};
};
};