pluto: add external disk

This commit is contained in:
Nico 2025-05-03 16:16:03 +10:00
parent 551b17baef
commit 754a6b403f
4 changed files with 51 additions and 5 deletions

View file

@ -1,6 +1,12 @@
{ config, lib, pkgs, ... }:
{
imports = [
./disko.nix
./hardware-configuration.nix
./specialisation.nix
];
networking.hostName = "pluto";
hardware.graphics.enable = true;

104
hosts/pluto/disko.nix Normal file
View file

@ -0,0 +1,104 @@
{ ... }:
{
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";
};
};
};
};
};
};
};
};
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" ];
};
};
};
};
};
};
};
};
};
};
}

View file

@ -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 = [ ];