From 01294f3b8c2755b4a7a4a2e3c7791c897d73911f Mon Sep 17 00:00:00 2001 From: lucalise Date: Mon, 22 Dec 2025 14:52:27 -0800 Subject: [PATCH] feat!: prepare homelab --- nix/homelab/flake.nix | 15 ++++++++------- .../kube/configuration.nix} | 14 ++++++++------ .../kube/disk-config.nix} | 6 +----- .../kube/hardware-configuration.nix} | 0 4 files changed, 17 insertions(+), 18 deletions(-) rename nix/homelab/{kube-configuration.nix => nodes/kube/configuration.nix} (75%) rename nix/homelab/{kube-disk-config.nix => nodes/kube/disk-config.nix} (88%) rename nix/homelab/{kube-hardware-configuration.nix => nodes/kube/hardware-configuration.nix} (100%) diff --git a/nix/homelab/flake.nix b/nix/homelab/flake.nix index 445570d..df4fcdc 100644 --- a/nix/homelab/flake.nix +++ b/nix/homelab/flake.nix @@ -2,17 +2,16 @@ description = "Homelab"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11"; disko.url = "github:nix-community/disko"; disko.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = - { - self, + inputs@{ nixpkgs, disko, - }@inputs: + }: let nodes = [ { @@ -31,12 +30,14 @@ meta = { hostname = node.name; }; + inherit inputs; }; modules = [ disko.nixosModules.disko - ./${node.name}-configuration.nix - ./${node.name}-hardware-configuration.nix - ./${node.name}-disk-config.nix + ../modules/keys.nix + ./nodes/${node.name}/configuration.nix + ./nodes/${node.name}/hardware-configuration.nix + ./nodes/${node.name}/disk-config.nix ]; }; }) nodes diff --git a/nix/homelab/kube-configuration.nix b/nix/homelab/nodes/kube/configuration.nix similarity index 75% rename from nix/homelab/kube-configuration.nix rename to nix/homelab/nodes/kube/configuration.nix index ada105c..cd2d451 100644 --- a/nix/homelab/kube-configuration.nix +++ b/nix/homelab/nodes/kube/configuration.nix @@ -10,10 +10,12 @@ imports = [ ]; - boot.loader.grub.enable = true; - boot.loader.grub.efiSupport = true; - boot.loader.grub.efiInstallAsRemovable = true; - boot.loader.grub.device = "/dev/nvme0n1"; + boot.loader.grub = { + enable = true; + efiSupport = true; + efiInstallAsRemovable = true; + device = "/dev/nvme0n1"; + }; networking.hostName = meta.hostname; networking.networkmanager.enable = true; @@ -48,7 +50,7 @@ packages = with pkgs; [ tree ]; - hashedPassword = "$6$BZKOzqbNgj8F2JDm$KVpnMK1inaM0tnHSw6dIlA1oZ7sT/j7RQL4u5wa9RHYeHcqEFILTqi0HGKCYIwhCEWuJIhBv3h.tjSCZ/j6yw/"; + hashedPassword = config.hashedPassword; }; environment.systemPackages = with pkgs; [ @@ -63,6 +65,6 @@ services.openssh.enable = true; - system.stateVersion = "25.05"; + system.stateVersion = "25.11"; } diff --git a/nix/homelab/kube-disk-config.nix b/nix/homelab/nodes/kube/disk-config.nix similarity index 88% rename from nix/homelab/kube-disk-config.nix rename to nix/homelab/nodes/kube/disk-config.nix index 1c60656..703357f 100644 --- a/nix/homelab/kube-disk-config.nix +++ b/nix/homelab/nodes/kube/disk-config.nix @@ -7,13 +7,9 @@ content = { type = "gpt"; partitions = { - boot = { - size = "1M"; - type = "EF02"; - }; ESP = { type = "EF00"; - size = "512M"; + size = "1G"; content = { type = "filesystem"; mountpoint = "/boot"; diff --git a/nix/homelab/kube-hardware-configuration.nix b/nix/homelab/nodes/kube/hardware-configuration.nix similarity index 100% rename from nix/homelab/kube-hardware-configuration.nix rename to nix/homelab/nodes/kube/hardware-configuration.nix