]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Move rest of the modules outside of nixops
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 22 May 2019 18:55:28 +0000 (20:55 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 22 May 2019 18:55:28 +0000 (20:55 +0200)
24 files changed:
modules/private/buildbot/common/build_helpers.py [moved from nixops/modules/buildbot/common/build_helpers.py with 100% similarity]
modules/private/buildbot/common/master.cfg [moved from nixops/modules/buildbot/common/master.cfg with 100% similarity]
modules/private/buildbot/default.nix [moved from nixops/modules/buildbot/default.nix with 98% similarity]
modules/private/buildbot/projects/caldance/__init__.py [moved from nixops/modules/buildbot/projects/caldance/__init__.py with 100% similarity]
modules/private/buildbot/projects/cryptoportfolio/__init__.py [moved from nixops/modules/buildbot/projects/cryptoportfolio/__init__.py with 100% similarity]
modules/private/buildbot/projects/test/__init__.py [moved from nixops/modules/buildbot/projects/test/__init__.py with 100% similarity]
modules/private/certificates.nix [moved from nixops/modules/certificates.nix with 100% similarity]
modules/private/default.nix
modules/private/dns.nix [moved from nixops/modules/dns.nix with 100% similarity]
modules/private/ftp.nix [moved from nixops/modules/ftp.nix with 100% similarity]
modules/private/gitolite/default.nix [moved from nixops/modules/gitolite/default.nix with 96% similarity]
modules/private/gitolite/gitolite_ldap_groups.sh [moved from nixops/modules/gitolite/gitolite_ldap_groups.sh with 100% similarity]
modules/private/mail.nix [moved from nixops/modules/mail.nix with 100% similarity]
modules/private/mpd.nix [moved from nixops/modules/mpd.nix with 100% similarity]
modules/private/pub/default.nix [moved from nixops/modules/pub/default.nix with 93% similarity]
modules/private/pub/restrict [moved from nixops/modules/pub/restrict with 100% similarity]
modules/private/pub/tmux.restrict.conf [moved from nixops/modules/pub/tmux.restrict.conf with 100% similarity]
modules/private/ssh/default.nix [moved from nixops/modules/ssh/default.nix with 100% similarity]
modules/private/ssh/ldap_authorized_keys.sh [moved from nixops/modules/ssh/ldap_authorized_keys.sh with 100% similarity]
modules/private/system.nix [new file with mode: 0644]
modules/private/tasks/default.nix [moved from nixops/modules/task/default.nix with 99% similarity]
modules/private/tasks/www/index.php [moved from nixops/modules/task/www/index.php with 100% similarity]
modules/private/websites/tools/git/default.nix
nixops/eldiron.nix

similarity index 98%
rename from nixops/modules/buildbot/default.nix
rename to modules/private/buildbot/default.nix
index 60279b7b88f87673904d32a52d8fc7db45b250e7..fa6a6f20f3c4a17d3c6c2cc2bb59a4e2149c6fde 100644 (file)
@@ -14,7 +14,7 @@ let
 in
 {
   options = {
-    services.buildbot.enable = lib.mkOption {
+    myServices.buildbot.enable = lib.mkOption {
       type = lib.types.bool;
       default = false;
       description = ''
@@ -23,7 +23,7 @@ in
     };
   };
 
-  config = lib.mkIf config.services.buildbot.enable {
+  config = lib.mkIf config.myServices.buildbot.enable {
     ids.uids.buildbot = myconfig.env.buildbot.user.uid;
     ids.gids.buildbot = myconfig.env.buildbot.user.gid;
 
index 242eeb917033fe02a92f6a0776d12deaa8cace98..894efb761ca75bda24063975b603cb63d8487e58 100644 (file)
@@ -47,7 +47,19 @@ set = {
   peertubeTool = ./websites/tools/peertube;
   toolsTool = ./websites/tools/tools;
 
+  buildbot = ./buildbot;
+  certificates = ./certificates.nix;
+  gitolite = ./gitolite;
   irc = ./irc.nix;
+  pub = ./pub;
+  tasks = ./tasks;
+  dns = ./dns.nix;
+  ftp = ./ftp.nix;
+  mail = ./mail.nix;
+  mpd = ./mpd.nix;
+  ssh = ./ssh;
+
+  system = ./system.nix;
 };
 in
 builtins.listToAttrs (map (attr: { name = "priv${attr}"; value = set.${attr}; }) (builtins.attrNames set))
similarity index 96%
rename from nixops/modules/gitolite/default.nix
rename to modules/private/gitolite/default.nix
index f085b559f1d4c3dcb503a3ffe08d9dfbaf42f82c..b9914a16916f42df398d671a8c513cb9360871bb 100644 (file)
@@ -1,8 +1,8 @@
 { lib, pkgs, config, myconfig, ... }:
 let
-    cfg = config.services.myGitolite;
+    cfg = config.myServices.gitolite;
 in {
-  options.services.myGitolite = {
+  options.myServices.gitolite = {
     enable = lib.mkEnableOption "my gitolite service";
     gitoliteDir = lib.mkOption {
       type = lib.types.string;
similarity index 93%
rename from nixops/modules/pub/default.nix
rename to modules/private/pub/default.nix
index cdc68db2f8b6156e7b1448ed95b1d00eeeb45174..c31c8eb0e40e8367838e270b1d6848562820c6c8 100644 (file)
@@ -1,7 +1,7 @@
 { lib, pkgs, config, myconfig,  ... }:
 {
   options = {
-    services.pub.enable = lib.mkOption {
+    myServices.pub.enable = lib.mkOption {
       type = lib.types.bool;
       default = false;
       description = ''
@@ -10,7 +10,7 @@
     };
   };
 
-  config = lib.mkIf config.services.pub.enable {
+  config = lib.mkIf config.myServices.pub.enable {
     users.users.pub = let
       restrict = pkgs.runCommand "restrict" { 
         file = ./restrict;
diff --git a/modules/private/system.nix b/modules/private/system.nix
new file mode 100644 (file)
index 0000000..fba504e
--- /dev/null
@@ -0,0 +1,30 @@
+{ pkgs, privateFiles, ... }:
+{
+  config = {
+    nixpkgs.overlays = builtins.attrValues (import ../../overlays);
+    _module.args = {
+      pkgsNext = import <nixpkgsNext> {};
+      pkgsPrevious = import <nixpkgsPrevious> {};
+      myconfig = {
+        inherit privateFiles;
+        env = import "${privateFiles}/environment.nix";
+      };
+    };
+
+    services.journald.extraConfig = ''
+      MaxLevelStore="warning"
+      MaxRetentionSec="1year"
+      '';
+
+    users.users.root.packages = [
+      pkgs.telnet
+      pkgs.htop
+      pkgs.iftop
+    ];
+
+    environment.systemPackages = [
+      pkgs.vim
+    ];
+
+  };
+}
similarity index 99%
rename from nixops/modules/task/default.nix
rename to modules/private/tasks/default.nix
index 9aeaa3f72de809d6cf28555eea1b0e82d051eeac..30f49ee933e11b6f49e458c87f69a5d5d53c135c 100644 (file)
@@ -1,6 +1,6 @@
 { lib, pkgs, config, myconfig,  ... }:
 let
-  cfg = config.services.myTasks;
+  cfg = config.myServices.tasks;
   server_vardir = config.services.taskserver.dataDir;
   fqdn = "task.immae.eu";
   user = config.services.taskserver.user;
@@ -81,7 +81,7 @@ let
       echo "Please login" > $out/index.html
       '';
 in {
-  options.services.myTasks = {
+  options.myServices.tasks = {
     enable = lib.mkEnableOption "my tasks service";
   };
 
index 3e8b605774167b82b842e95eb72b786377d052a7..75d024020b527c76c6c3ca3dc0179c775d8bd34a 100644 (file)
@@ -4,7 +4,9 @@ let
       inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
       env = myconfig.env.tools.mantisbt;
     };
-    gitweb = pkgs.callPackage ./gitweb.nix { gitoliteDir = config.services.myGitolite.gitoliteDir; };
+    gitweb = pkgs.callPackage ./gitweb.nix {
+      gitoliteDir = config.myServices.gitolite.gitoliteDir;
+    };
 
     cfg = config.myServices.websites.tools.git;
 in {
index 69231d1336278e19bc620325e894e99babdde36e..51af1f626622c55f0d9ab62bac7537bb144c0360 100644 (file)
@@ -7,17 +7,8 @@
 
   eldiron = { config, pkgs, myconfig, ... }:
   {
-    nixpkgs.overlays = builtins.attrValues (import ../overlays);
-    _module.args = {
-      pkgsNext = import <nixpkgsNext> {};
-      pkgsPrevious = import <nixpkgsPrevious> {};
-      myconfig = {
-        inherit privateFiles;
-        env = import "${privateFiles}/environment.nix";
-      };
-    };
-
     boot.kernelPackages = pkgs.linuxPackages_latest;
+    _module.args.privateFiles = privateFiles;
 
     networking = {
       firewall.enable = true;
         myconfig.env.servers.eldiron.ips);
     };
 
-    imports = [
-      ./modules/ssh
-      ./modules/certificates.nix
-      ./modules/gitolite
-      ./modules/mpd.nix
-      ./modules/mail.nix
-      ./modules/ftp.nix
-      ./modules/pub
-      ./modules/task
-      ./modules/buildbot
-      ./modules/dns.nix
-    ] ++ (builtins.attrValues (import ../modules));
+    imports = builtins.attrValues (import ../modules);
+
+    myServices.buildbot.enable = true;
     myServices.databases.enable = true;
+    myServices.gitolite.enable = true;
     myServices.irc.enable = true;
-    services.myGitolite.enable = true;
+    myServices.pub.enable = true;
+    myServices.tasks.enable = true;
     services.pure-ftpd.enable = true;
-    services.pub.enable = true;
-    services.myTasks.enable = true;
-    services.buildbot.enable = true;
-
-    services.journald.extraConfig = ''
-      MaxLevelStore="warning"
-      MaxRetentionSec="1year"
-      '';
 
     deployment = {
       targetEnv = "hetzner";
       };
     };
 
-    users.users.root.packages = [
-      pkgs.telnet
-      pkgs.htop
-      pkgs.iftop
-    ];
-
-    environment.systemPackages = [
-      pkgs.vim
-    ];
-
     services.cron = {
       enable = true;
       systemCronJobs = [