From 649942096f105ff0ca40e15259485b1c2a002c79 Mon Sep 17 00:00:00 2001 From: DerGrumpf Date: Tue, 30 Jun 2026 00:00:47 +0200 Subject: [PATCH] Added disko setup for desktop --- hosts/cyper-desktop/configuration.nix | 6 +- hosts/cyper-desktop/disko.nix | 68 +++++++++++++++++++ .../cyper-desktop/hardware-configuration.nix | 19 +++--- 3 files changed, 80 insertions(+), 13 deletions(-) create mode 100644 hosts/cyper-desktop/disko.nix diff --git a/hosts/cyper-desktop/configuration.nix b/hosts/cyper-desktop/configuration.nix index 47cd87a..45ed9e5 100644 --- a/hosts/cyper-desktop/configuration.nix +++ b/hosts/cyper-desktop/configuration.nix @@ -1,6 +1,8 @@ -{ ... }: { - imports = [ ./hardware-configuration.nix ]; + imports = [ + ./disko.nix + ./hardware-configuration.nix + ]; networking = { useNetworkd = true; diff --git a/hosts/cyper-desktop/disko.nix b/hosts/cyper-desktop/disko.nix new file mode 100644 index 0000000..adec451 --- /dev/null +++ b/hosts/cyper-desktop/disko.nix @@ -0,0 +1,68 @@ +{ + disko.devices.disk.main = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "fmask=0022" + "dmask=0022" + ]; + extraArgs = [ + "-n" + "NIXBOOT" + ]; + }; + }; + + swap = { + size = "4G"; + content = { + type = "swap"; + extraArgs = [ + "-L" + "NIXSWAP" + ]; + }; + }; + + nix = { + size = "110G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/nix"; + mountOptions = [ "defaults" ]; + extraArgs = [ + "-L" + "NIXSTORE" + ]; + }; + }; + + persist = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/persist"; + extraArgs = [ + "-L" + "NIXPERSIST" + ]; + }; + }; + + }; + }; + }; +} diff --git a/hosts/cyper-desktop/hardware-configuration.nix b/hosts/cyper-desktop/hardware-configuration.nix index 441a83b..c08c371 100644 --- a/hosts/cyper-desktop/hardware-configuration.nix +++ b/hosts/cyper-desktop/hardware-configuration.nix @@ -45,19 +45,18 @@ fileSystems = { "/" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "ext4"; - }; - - "/boot" = { - device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; + device = "none"; + fsType = "tmpfs"; options = [ - "fmask=0022" - "dmask=0022" + "defaults" + "size=4G" + "mode=755" ]; }; + "/nix".neededForBoot = true; + "/persist".neededForBoot = true; + "/storage" = { device = "/dev/disk/by-label/STORAGE"; fsType = "ext4"; @@ -97,8 +96,6 @@ "d /shares/storage-backup 0775 ${primaryUser} users -" ]; - swapDevices = [ ]; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware = {