diff options
author | Markus Wotringer <markus@wotringer.de> | 2015-11-29 01:30:42 +0100 |
---|---|---|
committer | Rok Garbas <rok@garbas.si> | 2015-12-07 15:40:43 +0100 |
commit | 9a350d5f1e1b3f983ef5adf420d56d08983be9ed (patch) | |
tree | 6b3ad6a10a0bf9a69c3d03bf286748fcef7c8552 /nixos/modules/services/networking/cntlm.nix | |
parent | f399ab50d87dcbb52018f3ecb7377ebdb22f9aa1 (diff) |
cntlm: refactor to systemd service, fixes #11339
Diffstat (limited to 'nixos/modules/services/networking/cntlm.nix')
-rw-r--r-- | nixos/modules/services/networking/cntlm.nix | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/nixos/modules/services/networking/cntlm.nix b/nixos/modules/services/networking/cntlm.nix index a50aa4d0636b..76c0fd7d0ea3 100644 --- a/nixos/modules/services/networking/cntlm.nix +++ b/nixos/modules/services/networking/cntlm.nix @@ -73,29 +73,28 @@ in ###### implementation 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; - users.extraUsers = singleton { + users.extraUsers.cntlm = { name = "cntlm"; description = "cntlm system-wide daemon"; 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 = '' # Cntlm Authentication Proxy Configuration @@ -108,8 +107,7 @@ in ${concatMapStrings (port: '' Listen ${toString port} '') cfg.port} - ''; - + ''; }; } |