about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-05-08 19:48:10 -0700
committerFranck Cuny <franck@fcuny.net>2023-05-08 19:48:10 -0700
commit8014e0e763937e8fa09b8f3e1758dcaf253a005e (patch)
treec8af56a0628d54b1ea2b244cc48b43a8e4fa8413
parentprofiles: clean up the imports (diff)
downloadworld-8014e0e763937e8fa09b8f3e1758dcaf253a005e.tar.gz
tahoe: move the initrd code
It's the only host that uses this code.
-rw-r--r--hosts/tahoe/boot.nix18
-rw-r--r--modules/system/boot/default.nix31
-rw-r--r--modules/system/default.nix1
3 files changed, 14 insertions, 36 deletions
diff --git a/hosts/tahoe/boot.nix b/hosts/tahoe/boot.nix
index bb2f53c..bf87ce8 100644
--- a/hosts/tahoe/boot.nix
+++ b/hosts/tahoe/boot.nix
@@ -11,10 +11,20 @@
     initrd = {
       # driver for the NIC, required in order to get an IP address
       kernelModules = [ "r8169" ];
+      network = {
+        enable = true;
+        postCommands = ''
+          echo "cryptsetup-askpass; exit" > /root/.profile
+        '';
+        ssh = {
+          enable = true;
+          port = 2222;
+          hostKeys =
+            [ /etc/ssh/ssh_host_ed25519_key /etc/ssh/ssh_host_rsa_key ];
+          authorizedKeys =
+            config.users.users.fcuny.openssh.authorizedKeys.keys;
+        };
+      };
     };
   };
-
-  my.system.boot = {
-    initrd = { network.enable = true; };
-  };
 }
diff --git a/modules/system/boot/default.nix b/modules/system/boot/default.nix
deleted file mode 100644
index b223336..0000000
--- a/modules/system/boot/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ pkgs, config, lib, ... }:
-let cfg = config.my.system.boot;
-in
-{
-  options.my.system.boot = with lib; {
-    initrd = {
-      network = { enable = mkEnableOption "enable SSH with initrd"; };
-    };
-  };
-
-  config = {
-    boot = {
-      initrd = {
-        network = lib.mkIf cfg.initrd.network.enable {
-          enable = true;
-          postCommands = ''
-            echo "cryptsetup-askpass; exit" > /root/.profile
-          '';
-          ssh = {
-            enable = true;
-            port = 2222;
-            hostKeys =
-              [ /etc/ssh/ssh_host_ed25519_key /etc/ssh/ssh_host_rsa_key ];
-            authorizedKeys =
-              config.users.users.fcuny.openssh.authorizedKeys.keys;
-          };
-        };
-      };
-    };
-  };
-}
diff --git a/modules/system/default.nix b/modules/system/default.nix
index 586cae8..ed3213c 100644
--- a/modules/system/default.nix
+++ b/modules/system/default.nix
@@ -2,7 +2,6 @@
 
 {
   imports = [
-    ./boot
     ./users
   ];
 }