From 754a6b403f8af037b9a71240392b971e1763cdea Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 3 May 2025 16:16:03 +1000 Subject: [PATCH] pluto: add external disk --- flake.nix | 5 +-- hosts/pluto/{conf.nix => configuration.nix} | 6 +++ hosts/{disko-desktop.nix => pluto/disko.nix} | 43 ++++++++++++++++++++ hosts/pluto/hardware-configuration.nix | 2 +- 4 files changed, 51 insertions(+), 5 deletions(-) rename hosts/pluto/{conf.nix => configuration.nix} (70%) rename hosts/{disko-desktop.nix => pluto/disko.nix} (54%) diff --git a/flake.nix b/flake.nix index 237cf09..224ad4c 100644 --- a/flake.nix +++ b/flake.nix @@ -41,11 +41,8 @@ ./modules/hardware/secureboot.nix lanzaboote.nixosModules.lanzaboote - ./hosts/disko-desktop.nix + ./hosts/pluto/configuration.nix disko.nixosModules.disko - ./hosts/pluto/conf.nix - ./hosts/pluto/specialisation.nix - ./hosts/pluto/hardware-configuration.nix ]; }; diff --git a/hosts/pluto/conf.nix b/hosts/pluto/configuration.nix similarity index 70% rename from hosts/pluto/conf.nix rename to hosts/pluto/configuration.nix index f581ba8..6f099b9 100644 --- a/hosts/pluto/conf.nix +++ b/hosts/pluto/configuration.nix @@ -1,6 +1,12 @@ { config, lib, pkgs, ... }: { + imports = [ + ./disko.nix + ./hardware-configuration.nix + ./specialisation.nix + ]; + networking.hostName = "pluto"; hardware.graphics.enable = true; diff --git a/hosts/disko-desktop.nix b/hosts/pluto/disko.nix similarity index 54% rename from hosts/disko-desktop.nix rename to hosts/pluto/disko.nix index 5d73a54..39011a3 100644 --- a/hosts/disko-desktop.nix +++ b/hosts/pluto/disko.nix @@ -56,6 +56,49 @@ }; }; }; + media = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + luks = { + size = "100%"; + content = { + type = "luks"; + name = "media"; + settings = { + allowDiscards = true; + fallbackToPassword = false; + keyFile = "/sysroot/var/lib/disk-media.key"; + }; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/media/shows" = { + mountpoint = "/media/shows"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/media/movies" = { + mountpoint = "/media/movies"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/media/music" = { + mountpoint = "/media/music"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/media/books" = { + mountpoint = "/media/books"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + }; + }; + }; + }; + }; + }; + }; }; }; } diff --git a/hosts/pluto/hardware-configuration.nix b/hosts/pluto/hardware-configuration.nix index 861da36..77a2497 100644 --- a/hosts/pluto/hardware-configuration.nix +++ b/hosts/pluto/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "uas" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ];