From db72f30b56e88f3e1764ca8f8242eb6a4e17285a Mon Sep 17 00:00:00 2001 From: ahtlon Date: Fri, 16 Oct 2026 20:47:58 +0200 Subject: [PATCH 1/2] [initssh] set static ip --- machines/albert/configuration.nix | 1 + machines/bakunin/configuration.nix | 3 +++ machines/fanny/configuration.nix | 1 + machines/modules/malobeo/initssh.nix | 6 +++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/machines/albert/configuration.nix b/machines/albert/configuration.nix index 0fef614..a790ed8 100644 --- a/machines/albert/configuration.nix +++ b/machines/albert/configuration.nix @@ -72,6 +72,7 @@ in enable = true; authorizedKeys = sshKeys.admins; ethernetDrivers = ["e1000e"]; + ip = hosts.malobeo.hosts.albert.network.address; }; services.malobeo.vpn = { diff --git a/machines/bakunin/configuration.nix b/machines/bakunin/configuration.nix index 392cca6..2a3ee8b 100644 --- a/machines/bakunin/configuration.nix +++ b/machines/bakunin/configuration.nix @@ -2,6 +2,8 @@ let sshKeys = import ../ssh_keys.nix; + hosts = import ../hosts.nix {}; + in { imports = @@ -35,6 +37,7 @@ in enable = true; authorizedKeys = sshKeys.admins; ethernetDrivers = ["r8169"]; + ip = hosts.malobeo.hosts.bakunin.network.address; }; malobeo.users.malobeo = true; diff --git a/machines/fanny/configuration.nix b/machines/fanny/configuration.nix index c97f244..822f1fe 100644 --- a/machines/fanny/configuration.nix +++ b/machines/fanny/configuration.nix @@ -90,6 +90,7 @@ in authorizedKeys = sshKeys.admins; ethernetDrivers = ["r8169"]; zfsExtraPools = [ "storage" ]; + ip = hosts.malobeo.hosts.fanny.network.address; }; boot.initrd = { diff --git a/machines/modules/malobeo/initssh.nix b/machines/modules/malobeo/initssh.nix index 9f8ed40..29ac5b6 100644 --- a/machines/modules/malobeo/initssh.nix +++ b/machines/modules/malobeo/initssh.nix @@ -27,6 +27,10 @@ in default = [ ]; description = "Name or GUID of extra ZFS pools that you wish to import during boot."; }; + ip = lib.mkOption { + type = lib.types.str; + description = "The requested static ip for the machine"; + }; }; config = lib.mkIf (cfg.enable && config.malobeo.disks.encryption) { @@ -73,7 +77,7 @@ in "/etc/ssh/initrd" = "/etc/ssh/initrd"; }; }; - kernelParams = [ "ip=::::${hostName}-initrd::dhcp" ]; + kernelParams = [ "ip=${cfg.ip}::::${hostName}::" ]; }; }; } -- 2.54.0 From 51960e200e80a66103bbb0c0f4e05cc6f34439f7 Mon Sep 17 00:00:00 2001 From: ahtlon Date: Fri, 16 Oct 2026 20:50:32 +0200 Subject: [PATCH 2/2] [initssh] document new option --- doc/src/module/initssh.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/src/module/initssh.md b/doc/src/module/initssh.md index d87fbe0..0edffb9 100644 --- a/doc/src/module/initssh.md +++ b/doc/src/module/initssh.md @@ -26,4 +26,14 @@ Run ` lspci -k | grep -iA4 ethernet ` ` [ ] ` *Example:* -`[ "r8169" ]` \ No newline at end of file +`[ "r8169" ]` + +## cfg.ip + +I hate DHCP! Set static ip or ip = hosts.malobeo.hosts.${hostname}.network.address; + +*Default:* +`Null` - Will error when not set + +*Example:* +`hosts.malobeo.hosts.fanny.network.address;` \ No newline at end of file -- 2.54.0