From 87e06b97a338bbf16fbebe742dbdfdfe103cc9b3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 Jun 2012 14:29:31 +0000 Subject: [PATCH] * Don't include the hostname in option default values. Default values are included in the manual, so this causes a different manual to be built for each machine. * Clean up indentation of cntlm module. svn path=/nixos/trunk/; revision=34387 --- modules/services/networking/avahi-daemon.nix | 4 +- modules/services/networking/cntlm.nix | 40 ++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/modules/services/networking/avahi-daemon.nix b/modules/services/networking/avahi-daemon.nix index 81432d34864b..791109dcda2b 100644 --- a/modules/services/networking/avahi-daemon.nix +++ b/modules/services/networking/avahi-daemon.nix @@ -44,7 +44,7 @@ in }; hostName = mkOption { - default = config.networking.hostName; + type = types.uniq types.string; description = ''Host name advertised on the LAN.''; }; @@ -93,6 +93,8 @@ in config = mkIf cfg.enable { + services.avahi.hostName = mkDefault config.networking.hostName; + users.extraUsers = singleton { name = "avahi"; uid = config.ids.uids.avahi; diff --git a/modules/services/networking/cntlm.nix b/modules/services/networking/cntlm.nix index a79f7c21d7c2..bfe7209b991f 100644 --- a/modules/services/networking/cntlm.nix +++ b/modules/services/networking/cntlm.nix @@ -13,7 +13,7 @@ in options = { - services.cntlm= { + services.cntlm = { enable = mkOption { default = false; @@ -39,9 +39,9 @@ in }; netbios_hostname = mkOption { - default = config.networking.hostName; + type = types.uniq types.string; description = '' - The hostname of your workstation. + The hostname of your machine. ''; }; @@ -73,28 +73,28 @@ in ###### implementation config = mkIf config.services.cntlm.enable { + + services.cntlm.netbios_hostname = mkDefault config.networking.hostName; + users.extraUsers = singleton { - name = "cntlm"; - description = "cntlm system-wide daemon"; - home = "/var/empty"; + name = "cntlm"; + description = "cntlm system-wide daemon"; + home = "/var/empty"; }; - jobs.cntlm = { - description = "cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy."; + jobs.cntlm = + { description = "CNTLM is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy"; + startOn = "started network-interfaces"; - environment = { - }; - preStart = '' ''; + daemonType = "fork"; - daemonType = "fork"; - - exec = - '' - ${pkgs.cntlm}/bin/cntlm -U cntlm \ - -c ${pkgs.writeText "cntlm_config" cfg.extraConfig} - ''; - }; + exec = + '' + ${pkgs.cntlm}/bin/cntlm -U cntlm \ + -c ${pkgs.writeText "cntlm_config" cfg.extraConfig} + ''; + }; services.cntlm.extraConfig = '' @@ -109,5 +109,7 @@ in Listen ${toString port} '') cfg.port} ''; + }; + }