This commit is contained in:
Xory 2026-01-03 17:43:42 +02:00
parent 8c9eed18e6
commit b458b67238
83 changed files with 1115 additions and 5026 deletions

View file

@ -0,0 +1,88 @@
{
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 = "crypted";
# Critical for Samsung NVMe longevity/performance
settings.allowDiscards = true;
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
options = {
ashift = "12";
autotrim = "on";
};
rootFsOptions = {
acltype = "posixacl";
xattr = "sa";
dnodesize = "auto";
compression = "zstd";
normalization = "formD";
relatime = "on";
canmount = "off";
"com.sun:auto-snapshot" = "false";
};
datasets = {
# Ephemeral root (rolls back to blank on boot)
"root" = {
type = "zfs_fs";
mountpoint = "/";
options.mountpoint = "legacy";
postCreateHook = "zfs snapshot zroot/root@blank";
};
# Nix store
"nix" = {
type = "zfs_fs";
mountpoint = "/nix";
options.mountpoint = "legacy";
options."com.sun:auto-snapshot" = "false";
};
# Persistent data
"persist" = {
type = "zfs_fs";
mountpoint = "/persist";
options.mountpoint = "legacy";
};
# Home directories
"home" = {
type = "zfs_fs";
mountpoint = "/home";
options.mountpoint = "legacy";
};
};
};
};
};
}

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp42s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}