fixup! nixos/redlib: use upstream systemd service file
This commit is contained in:
parent
743d0ff90b
commit
4a0893c186
@ -93,17 +93,26 @@ in
|
|||||||
systemd.services.redlib = {
|
systemd.services.redlib = {
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
environment = mapAttrs (_: v: if isBool v then boolToString' v else toString v) cfg.settings;
|
environment = mapAttrs (_: v: if isBool v then boolToString' v else toString v) cfg.settings;
|
||||||
serviceConfig = {
|
serviceConfig =
|
||||||
ExecStart = [
|
{
|
||||||
""
|
ExecStart = [
|
||||||
"${lib.getExe cfg.package} ${args}"
|
""
|
||||||
];
|
"${lib.getExe cfg.package} ${args}"
|
||||||
AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
];
|
||||||
CapabilityBoundingSet = if (cfg.port < 1024) then [ "CAP_NET_BIND_SERVICE" ] else [ "" ];
|
}
|
||||||
# A private user cannot have process capabilities on the host's user
|
// (
|
||||||
# namespace and thus CAP_NET_BIND_SERVICE has no effect.
|
if (cfg.port < 1024) then
|
||||||
PrivateUsers = (cfg.port >= 1024);
|
{
|
||||||
};
|
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
|
||||||
|
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# A private user cannot have process capabilities on the host's user
|
||||||
|
# namespace and thus CAP_NET_BIND_SERVICE has no effect.
|
||||||
|
PrivateUsers = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall = mkIf cfg.openFirewall {
|
networking.firewall = mkIf cfg.openFirewall {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user