1
0
Fork 0

Initial testing with Disko

This commit is contained in:
Aires 2024-05-27 15:38:09 -04:00
parent 77cc01fdd7
commit 89a319302e
2 changed files with 77 additions and 1 deletions

View file

@ -39,7 +39,11 @@
flake = false;
};
# TODO: Add Disko - https://github.com/nix-community/disko
# Disk management via Disko - https://github.com/nix-community/disko
disko = {
url = "github:nix-community/disko/v1.6.1";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@ -52,6 +56,7 @@
nixos-hardware,
lix-module,
nix-secrets,
disko,
...
}:
let
@ -76,6 +81,7 @@
lanzaboote.nixosModules.lanzaboote
nix-flatpak.nixosModules.nix-flatpak
home-manager.nixosModules.home-manager
disko.nixosModules.disko
{
home-manager = {
/*

View file

@ -81,6 +81,7 @@
};
};
# TODO: Disable once DIsko is up and running
swapDevices = [ { device = "/dev/disk/by-uuid/8c2519d9-3e47-4aa1-908d-98b1aa8b909d"; } ];
networking = {
@ -100,4 +101,73 @@
# NOTE: Use a default kernel to skip full kernel rebuilds
# boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
# Disk management
disko.enableConfig = false; # Disable while testing
disko.devices = {
disk = {
nvme0n1 = {
type = "disk";
device = "/dev/disk/by-id/nvme-MZ9L4256HCJQ-00BMV-SAMSUNG_S69VNE0X195093";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
label = "boot";
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luks = {
size = "100%";
label = "nixos";
content = {
type = "luks";
name = "cryptroot";
settings = {
allowDiscards = true;
crypttabExtraOpts = ["tpm2-device=auto"];
};
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
# Subvolume name is different from mountpoint
"/root" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/";
};
"/home" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/home";
};
"/nix" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/nix";
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "8G";
};
"/log" = {
mountpoint = "/var/log";
mountOptions = ["compress=zstd" "noatime"];
};
};
};
};
};
};
};
};
};
};
}