diff --git a/deploy b/deploy index d435ec8b1..03a200175 100755 --- a/deploy +++ b/deploy @@ -1,6 +1,6 @@ #! /bin/sh # -# usage: ./deploy CONFIG [[USER@]HOST] +# usage: ./deploy HOST [[USER@]HOST] # set -euf @@ -9,7 +9,7 @@ set -euf user=root host=$1 -config=./$host.nix +config=./modules/$host/default.nix target=${2-$user@$host} verbose deploy "$config" "$target" diff --git a/infest b/infest index cf9468483..140a317b1 100755 --- a/infest +++ b/infest @@ -76,7 +76,7 @@ infest_centos7_64bit() { target="root@$address" ./networking-configuration $cac_servername $hostname \ - > modules/networking-$hostname.nix + > modules/$hostname/networking.nix echo '( set -xeuf diff --git a/cd.nix b/modules/cd/default.nix similarity index 93% rename from cd.nix rename to modules/cd/default.nix index c2a34172c..a4e6bbc7d 100644 --- a/cd.nix +++ b/modules/cd/default.nix @@ -4,13 +4,13 @@ imports = [ - ./modules/sanitize.nix - ./modules/base-cac-CentOS-7-64bit.nix - ./modules/exim-cd.nix - ./modules/ejabberd-cd.nix # XXX echtes modul - ./modules/iptables-cd.nix - ./modules/networking-cd.nix - ./modules/retiolum.nix + ./iptables.nix + ./networking.nix + ../tv/base-cac-CentOS-7-64bit.nix + ../tv/ejabberd.nix # XXX echtes modul + ../tv/exim-smarthost.nix + ../tv/retiolum.nix + ../tv/sanitize.nix ]; # "Developer 2" plan has two vCPUs. @@ -54,7 +54,7 @@ services.retiolum = { enable = true; - hosts = ./hosts; + hosts = /etc/nixos/hosts; privateKeyFile = "/etc/nixos/secrets/cd.retiolum.rsa_key.priv"; connectTo = [ "fastpoke" diff --git a/modules/iptables-cd.nix b/modules/cd/iptables.nix similarity index 100% rename from modules/iptables-cd.nix rename to modules/cd/iptables.nix diff --git a/modules/networking-cd.nix b/modules/cd/networking.nix similarity index 100% rename from modules/networking-cd.nix rename to modules/cd/networking.nix diff --git a/modules/urxvtd.nix b/modules/lass/urxvtd.nix similarity index 96% rename from modules/urxvtd.nix rename to modules/lass/urxvtd.nix index 7eb471ed9..a62e64a98 100644 --- a/modules/urxvtd.nix +++ b/modules/lass/urxvtd.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - inherit (import ../lib { inherit pkgs; }) shell-escape; + inherit (import ../../lib { inherit pkgs; }) shell-escape; inherit (pkgs) writeScript; in diff --git a/mu.nix b/modules/mu/default.nix similarity index 98% rename from mu.nix rename to modules/mu/default.nix index d94594f03..baec9bf8e 100644 --- a/mu.nix +++ b/modules/mu/default.nix @@ -3,7 +3,7 @@ { config, pkgs, ... }: let - lib = import ./lib { inherit pkgs; }; + lib = import ../../lib { inherit pkgs; }; inherit (lib) majmin; in @@ -11,9 +11,9 @@ in { imports = [ - ./modules/sanitize.nix - ./modules/exim.nix - ./modules/retiolum.nix + ../tv/exim-retiolum.nix + ../tv/retiolum.nix + ../tv/sanitize.nix ]; time.timeZone = "Europe/Berlin"; diff --git a/modules/base-cac-CentOS-7-64bit.nix b/modules/tv/base-cac-CentOS-7-64bit.nix similarity index 100% rename from modules/base-cac-CentOS-7-64bit.nix rename to modules/tv/base-cac-CentOS-7-64bit.nix diff --git a/modules/base.nix b/modules/tv/base.nix similarity index 100% rename from modules/base.nix rename to modules/tv/base.nix diff --git a/modules/ejabberd-cd.nix b/modules/tv/ejabberd.nix similarity index 100% rename from modules/ejabberd-cd.nix rename to modules/tv/ejabberd.nix diff --git a/modules/exim.nix b/modules/tv/exim-retiolum.nix similarity index 100% rename from modules/exim.nix rename to modules/tv/exim-retiolum.nix diff --git a/modules/exim-cd.nix b/modules/tv/exim-smarthost.nix similarity index 100% rename from modules/exim-cd.nix rename to modules/tv/exim-smarthost.nix diff --git a/modules/nginx.nix b/modules/tv/nginx.nix similarity index 100% rename from modules/nginx.nix rename to modules/tv/nginx.nix diff --git a/modules/retiolum.nix b/modules/tv/retiolum.nix similarity index 100% rename from modules/retiolum.nix rename to modules/tv/retiolum.nix diff --git a/modules/sanitize.nix b/modules/tv/sanitize.nix similarity index 100% rename from modules/sanitize.nix rename to modules/tv/sanitize.nix diff --git a/modules/synaptics.nix b/modules/tv/synaptics.nix similarity index 100% rename from modules/synaptics.nix rename to modules/tv/synaptics.nix diff --git a/modules/tools.nix b/modules/tv/tools.nix similarity index 97% rename from modules/tools.nix rename to modules/tv/tools.nix index 4be84a6be..cf3fda93a 100644 --- a/modules/tools.nix +++ b/modules/tv/tools.nix @@ -5,7 +5,7 @@ let inherit (lib.strings) concatStringsSep stringAsChars; inherit (lib.attrsets) attrValues mapAttrs; inherit (lib) makeSearchPath; - inherit (import ../lib { inherit pkgs; }) shell-escape; + inherit (import ../../lib { inherit pkgs; }) shell-escape; # TODO make these scripts available in an maintenance shell diff --git a/modules/urxvt-tv.nix b/modules/tv/urxvt.nix similarity index 100% rename from modules/urxvt-tv.nix rename to modules/tv/urxvt.nix diff --git a/modules/users.nix b/modules/tv/users.nix similarity index 97% rename from modules/users.nix rename to modules/tv/users.nix index 79a00e3a1..f42ba33c5 100644 --- a/modules/users.nix +++ b/modules/tv/users.nix @@ -189,7 +189,7 @@ let sudoers = let inherit (builtins) filter hasAttr; - inherit (import ../lib { inherit pkgs; }) concat isSuffixOf removeSuffix setToList; + inherit (import ../../lib { inherit pkgs; }) concat isSuffixOf removeSuffix setToList; hasMaster = { group ? "", ... }: isSuffixOf "-sub" group; diff --git a/modules/xserver.nix b/modules/tv/xserver.nix similarity index 100% rename from modules/xserver.nix rename to modules/tv/xserver.nix diff --git a/wu.nix b/modules/wu/default.nix similarity index 96% rename from wu.nix rename to modules/wu/default.nix index e84e31693..f586552e4 100644 --- a/wu.nix +++ b/modules/wu/default.nix @@ -1,25 +1,25 @@ { config, pkgs, ... }: let - lib = import ./lib { inherit pkgs; }; + lib = import ../../lib { inherit pkgs; }; inherit (lib) majmin; in { imports = [ - ./modules/sanitize.nix - ./modules/base.nix - ./modules/retiolum.nix - ./modules/urxvt-tv.nix - ./modules/iptables.nix - ./modules/users.nix - #./modules/tools.nix - ./modules/hosts.nix - ./modules/xserver.nix - ./modules/synaptics.nix - ./modules/exim.nix - ./modules/nginx.nix + ./hosts.nix + ./iptables.nix + ../tv/base.nix + ../tv/exim-retiolum.nix + ../tv/nginx.nix + ../tv/retiolum.nix + ../tv/sanitize.nix + ../tv/synaptics.nix + #../tv/tools.nix + ../tv/urxvt.nix + ../tv/users.nix + ../tv/xserver.nix ]; services.udev.extraRules = '' diff --git a/modules/hosts.nix b/modules/wu/hosts.nix similarity index 100% rename from modules/hosts.nix rename to modules/wu/hosts.nix diff --git a/modules/iptables.nix b/modules/wu/iptables.nix similarity index 100% rename from modules/iptables.nix rename to modules/wu/iptables.nix