From c49fe8e2d9efae004080af0043596e3c4063ed4f Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 2 Oct 2026 17:04:26 +0200 Subject: [PATCH] Kardorf: remove disko config to reuse running ssd --- hosts/kardorf/default.nix | 4 -- hosts/kardorf/disko.nix | 73 ------------------------ hosts/kardorf/hardware-configuration.nix | 51 +++++++++++++---- 3 files changed, 39 insertions(+), 89 deletions(-) delete mode 100644 hosts/kardorf/disko.nix diff --git a/hosts/kardorf/default.nix b/hosts/kardorf/default.nix index 25ca51e..eb7bf97 100644 --- a/hosts/kardorf/default.nix +++ b/hosts/kardorf/default.nix @@ -1,13 +1,9 @@ { pwd, pkgs, - inputs, ... }: { imports = [ - inputs.disko.nixosModules.disko - - ./disko.nix ./hardware-configuration.nix "${pwd}/features-nixos/global" diff --git a/hosts/kardorf/disko.nix b/hosts/kardorf/disko.nix deleted file mode 100644 index a574ffa..0000000 --- a/hosts/kardorf/disko.nix +++ /dev/null @@ -1,73 +0,0 @@ -# https://github.com/nix-community/disko/blob/master/example/btrfs-subvolumes.nix -{ - disko.devices = { - disk = { - main = { - type = "disk"; - device = "/dev/sda"; - content = { - type = "gpt"; - partitions = { - ESP = { - priority = 1; - name = "ESP"; - start = "1M"; - end = "128M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = ["umask=0077"]; - }; - }; - root = { - size = "100%"; - content = { - type = "btrfs"; - extraArgs = ["-f"]; # Override existing partition - # Subvolumes must set a mountpoint in order to be mounted, - # unless their parent is mounted - subvolumes = { - "/rootfs" = { - mountpoint = "/"; - }; - "/home" = { - mountOptions = ["compress=zstd"]; - mountpoint = "/home"; - }; - "/nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; - }; - # Subvolume for the swapfile - "/swap" = { - mountpoint = "/.swapvol"; - swap = { - swapfile.size = "20M"; - swapfile2.size = "20M"; - swapfile2.path = "rel-path"; - }; - }; - }; - - mountpoint = "/partition-root"; - swap = { - swapfile = { - size = "20M"; - }; - swapfile1 = { - size = "20M"; - }; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/hosts/kardorf/hardware-configuration.nix b/hosts/kardorf/hardware-configuration.nix index d961c6c..d755e12 100644 --- a/hosts/kardorf/hardware-configuration.nix +++ b/hosts/kardorf/hardware-configuration.nix @@ -3,22 +3,49 @@ lib, modulesPath, ... -}: - -{ +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "usbhid" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; + fsType = "btrfs"; + options = ["subvol=root"]; + }; + + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; + fsType = "btrfs"; + options = ["subvol=nix"]; + }; + + fileSystems."/swap" = { + device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; + fsType = "btrfs"; + options = ["subvol=swap"]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; + fsType = "btrfs"; + options = ["subvol=home"]; + }; + + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/7D48-A59C"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; + + swapDevices = []; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;