diff options
author | William A. Kennington III <william@wkennington.com> | 2015-07-08 14:11:16 -0700 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2015-07-08 14:11:16 -0700 |
commit | 7cda24c01e67f50f790212311a240e56a957dc19 (patch) | |
tree | b136b30124d78b0eb41a3b59ab6814c761391ed3 /nixos/modules | |
parent | 81396388e59b83f1a663cf4789c08f8574d66171 (diff) | |
parent | df038c93cc823fef9ceb547e3d635317bdd7d39e (diff) | |
download | nixlib-7cda24c01e67f50f790212311a240e56a957dc19.tar nixlib-7cda24c01e67f50f790212311a240e56a957dc19.tar.gz nixlib-7cda24c01e67f50f790212311a240e56a957dc19.tar.bz2 nixlib-7cda24c01e67f50f790212311a240e56a957dc19.tar.lz nixlib-7cda24c01e67f50f790212311a240e56a957dc19.tar.xz nixlib-7cda24c01e67f50f790212311a240e56a957dc19.tar.zst nixlib-7cda24c01e67f50f790212311a240e56a957dc19.zip |
Merge branch 'master.upstream' into staging.upstream
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 2 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/cluster/kubernetes.nix | 15 | ||||
-rw-r--r-- | nixos/modules/services/misc/nix-daemon.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/misc/sundtek.nix | 33 | ||||
-rw-r--r-- | nixos/modules/services/networking/bitlbee.nix | 32 | ||||
-rw-r--r-- | nixos/modules/services/networking/zerotierone.nix | 32 | ||||
-rw-r--r-- | nixos/modules/services/web-servers/apache-httpd/default.nix | 3 | ||||
-rw-r--r-- | nixos/modules/system/boot/loader/grub/install-grub.pl | 2 |
9 files changed, 111 insertions, 12 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index a929e1eb8262..b768be6a3e01 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -354,7 +354,7 @@ EOF if ($status != 0 || join("", @msg) =~ /ERROR:/) { die "Failed to retrieve subvolume info for $mountPoint\n"; } - my @ids = join("", @id_info) =~ m/Object ID:[ \t\n]*([^ \t\n]*)/; + my @ids = join("", @id_info) =~ m/Subvolume ID:[ \t\n]*([^ \t\n]*)/; if ($#ids > 0) { die "Btrfs subvol name for $mountPoint listed multiple times in mount\n" } elsif ($#ids == 0) { diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d580e269df96..f74b16f678fd 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -219,6 +219,7 @@ ./services/misc/rogue.nix ./services/misc/siproxd.nix ./services/misc/subsonic.nix + ./services/misc/sundtek.nix ./services/misc/svnserve.nix ./services/misc/synergy.nix ./services/misc/uhub.nix @@ -346,6 +347,7 @@ ./services/networking/wicd.nix ./services/networking/wpa_supplicant.nix ./services/networking/xinetd.nix + ./services/networking/zerotierone.nix ./services/networking/znc.nix ./services/printing/cupsd.nix ./services/scheduling/atd.nix diff --git a/nixos/modules/services/cluster/kubernetes.nix b/nixos/modules/services/cluster/kubernetes.nix index 86b8817c28c6..d00c1aaa1055 100644 --- a/nixos/modules/services/cluster/kubernetes.nix +++ b/nixos/modules/services/cluster/kubernetes.nix @@ -224,7 +224,7 @@ in { machines = mkOption { description = "Kubernetes controller list of machines to schedule to schedule onto"; - default = [config.networking.hostName]; + default = []; type = types.listOf types.str; }; @@ -242,6 +242,12 @@ in { type = types.bool; }; + registerNode = mkOption { + description = "Whether to auto register kubelet with API server."; + default = true; + type = types.bool; + }; + address = mkOption { description = "Kubernetes kubelet info server listening address."; default = "0.0.0.0"; @@ -274,7 +280,7 @@ in { cadvisorPort = mkOption { description = "Kubernetes kubelet local cadvisor port."; - default = config.services.cadvisor.port; + default = 4194; type = types.int; }; @@ -324,7 +330,7 @@ in { }; kube2sky = { - enable = mkEnableOption "kube2sky dns service"; + enable = mkEnableOption "Whether to enable kube2sky dns service."; domain = mkOption { description = "Kuberntes kube2sky domain under which all DNS names will be hosted."; @@ -445,6 +451,7 @@ in { export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PATH" exec ${cfg.package}/bin/kubelet \ --api-servers=${concatMapStringsSep "," (f: "http://${f}") cfg.kubelet.apiServers} \ + --register-node=${if cfg.kubelet.registerNode then "true" else "false"} \ --address=${cfg.kubelet.address} \ --port=${toString cfg.kubelet.port} \ --hostname-override=${cfg.kubelet.hostname} \ @@ -511,8 +518,6 @@ in { (mkIf (any (el: el == "node") cfg.roles) { virtualisation.docker.enable = mkDefault true; - services.cadvisor.enable = mkDefault true; - services.cadvisor.port = mkDefault 4194; services.kubernetes.kubelet.enable = mkDefault true; services.kubernetes.proxy.enable = mkDefault true; }) diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index b79a69e2ba8f..b5a8a7df9fca 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -143,7 +143,7 @@ in default = 0; description = '' Nix daemon process priority. This priority propagates to build processes. - 0 is the default Unix process priority, 20 is the lowest. + 0 is the default Unix process priority, 19 is the lowest. ''; }; diff --git a/nixos/modules/services/misc/sundtek.nix b/nixos/modules/services/misc/sundtek.nix new file mode 100644 index 000000000000..8438ef79904f --- /dev/null +++ b/nixos/modules/services/misc/sundtek.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.sundtek; + +in +{ + options.services.sundtek = { + enable = mkEnableOption "Sundtek driver"; + }; + + config = mkIf cfg.enable { + + environment.systemPackages = [ pkgs.sundtek ]; + + systemd.services.sundtek = { + description = "Sundtek driver"; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "oneshot"; + ExecStart = '' + ${pkgs.sundtek}/bin/mediasrv -d -v -p ${pkgs.sundtek}/bin ;\ + ${pkgs.sundtek}/bin/mediaclient --start=5 --wait-for-devices + ''; + ExecStop = "${pkgs.sundtek}/bin/mediaclient --shutdown"; + RemainAfterExit = true; + }; + }; + }; +} diff --git a/nixos/modules/services/networking/bitlbee.nix b/nixos/modules/services/networking/bitlbee.nix index 7276603da16f..1ffd57e0621d 100644 --- a/nixos/modules/services/networking/bitlbee.nix +++ b/nixos/modules/services/networking/bitlbee.nix @@ -17,10 +17,12 @@ let [settings] RunMode = Daemon User = bitlbee - ConfigDir = /var/lib/bitlbee + ConfigDir = ${cfg.configDir} DaemonInterface = ${cfg.interface} DaemonPort = ${toString cfg.portNumber} AuthMode = ${cfg.authMode} + ${lib.optionalStringv (cfg.hostName != "") "HostName = ${cfg.hostName}"} + ${lib.optionalString (cfg.protocols != "") "Protocols = ${cfg.protocols}"} ${cfg.extraSettings} [defaults] @@ -73,6 +75,34 @@ in ''; }; + hostName = mkOption { + default = ""; + type = types.str; + description = '' + Normally, BitlBee gets a hostname using getsockname(). If you have a nicer + alias for your BitlBee daemon, you can set it here and BitlBee will identify + itself with that name instead. + ''; + }; + + configDir = mkOption { + default = "/var/lib/bitlbee"; + type = types.path; + description = '' + Specify an alternative directory to store all the per-user configuration + files. + ''; + }; + + protocols = mkOption { + default = ""; + type = types.str; + description = '' + This option allows to remove the support of protocol, even if compiled + in. If nothing is given, there are no restrictions. + ''; + }; + extraSettings = mkOption { default = ""; description = '' diff --git a/nixos/modules/services/networking/zerotierone.nix b/nixos/modules/services/networking/zerotierone.nix new file mode 100644 index 000000000000..886ea18d9809 --- /dev/null +++ b/nixos/modules/services/networking/zerotierone.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.zerotierone; +in +{ + options.services.zerotierone.enable = mkEnableOption "ZeroTierOne"; + + config = mkIf cfg.enable { + systemd.services.zerotierone = { + description = "ZeroTierOne"; + path = [ pkgs.zerotierone ]; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + preStart = + '' + mkdir -p /var/lib/zerotier-one + chmod 700 /var/lib/zerotier-one + chown -R root:root /var/lib/zerotier-one + ''; + serviceConfig = { + Type = "forking"; + User = "root"; + PIDFile = "/var/lib/zerotier-one/zerotier-one.pid"; + ExecStart = "${pkgs.zerotierone}/bin/zerotier-one -d"; + }; + }; + environment.systemPackages = [ pkgs.zerotierone ]; + }; +} diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 2885fd396525..7350a6a68c70 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -187,9 +187,6 @@ let <IfModule mod_mime_magic.c> MIMEMagicFile ${httpd}/conf/magic </IfModule> - - AddEncoding x-compress Z - AddEncoding x-gzip gz tgz ''; diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index c4b1abc8cb03..34bff727b73a 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -186,7 +186,7 @@ sub GrubFs { if ($status != 0) { die "Failed to retrieve subvolume info for @{[$fs->mount]}\n"; } - my @ids = join("", @id_info) =~ m/Object ID:[ \t\n]*([^ \t\n]*)/; + my @ids = join("", @id_info) =~ m/Subvolume ID:[ \t\n]*([^ \t\n]*)/; if ($#ids > 0) { die "Btrfs subvol name for @{[$fs->device]} listed multiple times in mount\n" } elsif ($#ids == 0) { |