From 6269ee3943984cc8fe909c78ff4b187250884da5 Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 18 Oct 2025 21:28:56 +1100 Subject: [PATCH] nijika: remove disko --- flake.lock | 22 --------- flake.nix | 6 +-- hosts/nijika/configuration.nix | 1 - hosts/nijika/disko.nix | 61 ------------------------- hosts/nijika/hardware-configuration.nix | 41 ++++++++++++++--- 5 files changed, 35 insertions(+), 96 deletions(-) delete mode 100644 hosts/nijika/disko.nix diff --git a/flake.lock b/flake.lock index b29f72b..007a22a 100644 --- a/flake.lock +++ b/flake.lock @@ -15,27 +15,6 @@ "type": "github" } }, - "disko": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746728054, - "narHash": "sha256-eDoSOhxGEm2PykZFa/x9QG5eTH0MJdiJ9aR00VAofXE=", - "owner": "nix-community", - "repo": "disko", - "rev": "ff442f5d1425feb86344c028298548024f21256d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "latest", - "repo": "disko", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -315,7 +294,6 @@ }, "root": { "inputs": { - "disko": "disko", "jovian": "jovian", "lanzaboote": "lanzaboote", "nix-darwin": "nix-darwin", diff --git a/flake.nix b/flake.nix index 808d6a1..c2ac45a 100644 --- a/flake.nix +++ b/flake.nix @@ -8,14 +8,12 @@ lanzaboote.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.url = "github:LnL7/nix-darwin"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; - disko.url = "github:nix-community/disko/latest"; - disko.inputs.nixpkgs.follows = "nixpkgs"; jovian.url = "github:Jovian-Experiments/Jovian-NixOS"; jovian.inputs.nixpkgs.follows = "nixpkgs"; nix-minecraft.url = "github:Infinidoge/nix-minecraft"; }; - outputs = { self, nixpkgs, lanzaboote, nix-darwin, disko, jovian, nix-minecraft, ... }@inputs: { + outputs = { self, nixpkgs, lanzaboote, nix-darwin, jovian, nix-minecraft, ... }@inputs: { nixosConfigurations.nijika = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -58,7 +56,6 @@ lanzaboote.nixosModules.lanzaboote ./hosts/nijika/configuration.nix - disko.nixosModules.disko ]; }; @@ -82,7 +79,6 @@ ./hosts/miki/configuration.nix ./hosts/nixos-common.nix - disko.nixosModules.disko ]; }; diff --git a/hosts/nijika/configuration.nix b/hosts/nijika/configuration.nix index 6ff5009..32ff55b 100644 --- a/hosts/nijika/configuration.nix +++ b/hosts/nijika/configuration.nix @@ -2,7 +2,6 @@ { imports = [ - ./disko.nix ./hardware-configuration.nix ]; diff --git a/hosts/nijika/disko.nix b/hosts/nijika/disko.nix deleted file mode 100644 index 5d73a54..0000000 --- a/hosts/nijika/disko.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ ... }: - -{ - disko.devices = { - disk = { - main = { - type = "disk"; - device = "/dev/nvme0n1"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "root"; - passwordFile = "/tmp/secret.key"; - settings = { - allowDiscards = true; - }; -# additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/root" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/home" = { - mountpoint = "/home"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/swap" = { - mountpoint = "/.swapvol"; - swap.swapfile.size = "1G"; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/hosts/nijika/hardware-configuration.nix b/hosts/nijika/hardware-configuration.nix index 77a2497..427e9df 100644 --- a/hosts/nijika/hardware-configuration.nix +++ b/hosts/nijika/hardware-configuration.nix @@ -8,17 +8,44 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "uas" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + fileSystems."/" = + { device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/4a0361b6-b3b4-48dd-a089-babdfa072fc2"; + + fileSystems."/nix" = + { device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; + + fileSystems."/.swapvol" = + { device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=swap" ]; + }; + + fileSystems."/home" = + { device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1653-F2C8"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;