cntlm: refactor to systemd service, fixes #11339

authored by

Markus Wotringer and committed by
Rok Garbas
9a350d5f f399ab50

+16 -18
+16 -18
nixos/modules/services/networking/cntlm.nix
··· 73 ###### implementation 74 75 config = mkIf config.services.cntlm.enable { 76 - 77 services.cntlm.netbios_hostname = mkDefault config.networking.hostName; 78 79 - users.extraUsers = singleton { 80 name = "cntlm"; 81 description = "cntlm system-wide daemon"; 82 home = "/var/empty"; 83 }; 84 85 - jobs.cntlm = 86 - { description = "CNTLM is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy"; 87 - 88 - startOn = "started network-interfaces"; 89 - 90 - daemonType = "fork"; 91 - 92 - exec = 93 - '' 94 - ${pkgs.cntlm}/bin/cntlm -U cntlm \ 95 - -c ${pkgs.writeText "cntlm_config" cfg.extraConfig} 96 - ''; 97 - }; 98 - 99 services.cntlm.extraConfig = 100 '' 101 # Cntlm Authentication Proxy Configuration ··· 108 ${concatMapStrings (port: '' 109 Listen ${toString port} 110 '') cfg.port} 111 - ''; 112 - 113 }; 114 115 }
··· 73 ###### implementation 74 75 config = mkIf config.services.cntlm.enable { 76 + systemd.services.cntlm = { 77 + description = "CNTLM is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy"; 78 + after = [ "network.target" ]; 79 + wantedBy = [ "multi-user.target" ]; 80 + serviceConfig = { 81 + Type = "forking"; 82 + User = "cntlm"; 83 + ExecStart = '' 84 + ${pkgs.cntlm}/bin/cntlm -U cntlm \ 85 + -c ${pkgs.writeText "cntlm_config" cfg.extraConfig} 86 + ''; 87 + }; 88 + }; 89 + 90 services.cntlm.netbios_hostname = mkDefault config.networking.hostName; 91 92 + users.extraUsers.cntlm = { 93 name = "cntlm"; 94 description = "cntlm system-wide daemon"; 95 home = "/var/empty"; 96 }; 97 98 services.cntlm.extraConfig = 99 '' 100 # Cntlm Authentication Proxy Configuration ··· 107 ${concatMapStrings (port: '' 108 Listen ${toString port} 109 '') cfg.port} 110 + ''; 111 }; 112 113 }