cntlm: refactor to systemd service, fixes #11339
This commit is contained in:
parent
f399ab50d8
commit
9a350d5f1e
|
@ -73,29 +73,28 @@ in
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf config.services.cntlm.enable {
|
config = mkIf config.services.cntlm.enable {
|
||||||
|
systemd.services.cntlm = {
|
||||||
|
description = "CNTLM is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "forking";
|
||||||
|
User = "cntlm";
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.cntlm}/bin/cntlm -U cntlm \
|
||||||
|
-c ${pkgs.writeText "cntlm_config" cfg.extraConfig}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.cntlm.netbios_hostname = mkDefault config.networking.hostName;
|
services.cntlm.netbios_hostname = mkDefault config.networking.hostName;
|
||||||
|
|
||||||
users.extraUsers = singleton {
|
users.extraUsers.cntlm = {
|
||||||
name = "cntlm";
|
name = "cntlm";
|
||||||
description = "cntlm system-wide daemon";
|
description = "cntlm system-wide daemon";
|
||||||
home = "/var/empty";
|
home = "/var/empty";
|
||||||
};
|
};
|
||||||
|
|
||||||
jobs.cntlm =
|
|
||||||
{ description = "CNTLM is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy";
|
|
||||||
|
|
||||||
startOn = "started network-interfaces";
|
|
||||||
|
|
||||||
daemonType = "fork";
|
|
||||||
|
|
||||||
exec =
|
|
||||||
''
|
|
||||||
${pkgs.cntlm}/bin/cntlm -U cntlm \
|
|
||||||
-c ${pkgs.writeText "cntlm_config" cfg.extraConfig}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
services.cntlm.extraConfig =
|
services.cntlm.extraConfig =
|
||||||
''
|
''
|
||||||
# Cntlm Authentication Proxy Configuration
|
# Cntlm Authentication Proxy Configuration
|
||||||
|
@ -108,8 +107,7 @@ in
|
||||||
${concatMapStrings (port: ''
|
${concatMapStrings (port: ''
|
||||||
Listen ${toString port}
|
Listen ${toString port}
|
||||||
'') cfg.port}
|
'') cfg.port}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue