From c2e7208de4e3e7d018560175808f838aa6861b68 Mon Sep 17 00:00:00 2001 From: adikro Date: Mon, 22 Dec 2025 03:44:33 +0100 Subject: disko config for desktop host for future reinstalls --- hosts/desktop/configuration.nix | 4 +- hosts/desktop/disko.nix | 76 ++++++++++++++++++++++++++++++++ hosts/desktop/hardware-configuration.nix | 3 +- 3 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 hosts/desktop/disko.nix (limited to 'hosts/desktop') diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index b74efe5..6f9b000 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -1,8 +1,10 @@ -{ username, ... }: +{ inputs, username, ... }: { system.stateVersion = "25.05"; imports = [ + inputs.disko.nixosModules.disko + ./hardware-configuration.nix ../../sys/default.nix ]; diff --git a/hosts/desktop/disko.nix b/hosts/desktop/disko.nix new file mode 100644 index 0000000..8e93ef7 --- /dev/null +++ b/hosts/desktop/disko.nix @@ -0,0 +1,76 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "2G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "root" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "noatime" "autodefrag" ]; + }; + "llms" = { + mountpoint = "/llms"; + mountOptions = [ "compress=zstd" "noatime" "autodefrag"]; + }; + "vms" = { + mountpoint = "/vms"; + mountOptions = [ "noatime" "autodefrag" ]; + }; + "swap" = { + mountpoint = "/.swapvol"; + swap.swapfile.size = "32G"; + }; + }; + }; + }; + }; + }; + }; + media = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + media = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/media"; + # extraArgs = [ "-f" ]; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix index cb96715..41eb3a1 100644 --- a/hosts/desktop/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -30,7 +30,7 @@ }; fileSystems."/media" = - { device = "/dev/disk/by-uuid/eb13c515-5e4c-4a17-8f2e-1cf5d6e522e4"; + { device = "/dev/disk/by-uuid/c0dc7c4d-1800-4c84-a04c-5ea7f5e86c4b"; fsType = "ext4"; }; @@ -47,4 +47,3 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } - -- cgit v1.3