Add Detritus

This commit is contained in:
Bun 2025-05-13 04:12:46 +00:00
parent 822fa6eae2
commit ca2d6e4091
14 changed files with 211 additions and 14 deletions

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [
"amdgpu.cik_support=1"
"radeon.cik_support=0"
];
loader.grub.enable = true;
plymouth.enable = true;
};
}

View file

@ -0,0 +1,18 @@
{ ... }:
{
imports = [
./boot
./disko
./filesystems
./hardware
./user
../../modules/system
];
networking.hostName = "detritus";
system = {
desktop.enable = true;
stateVersion = "24.11";
};
}

View file

@ -0,0 +1,106 @@
{ config, disko, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [
"compress=zstd"
"noexec"
"ssd"
];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"ssd"
];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/persist/.snapshots" = { };
"/persist/home" = { };
"/persist/home/.snapshots" = { };
};
};
};
swap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -0,0 +1,33 @@
{ config, ... }:
{
fileSystems = {
# Network mounts
"/home/${config.sysusers.main}/Network/Midas" = {
device = "sv.nixfox.ca:/storage";
fsType = "nfs4";
options = [
"noauto"
"soft"
"x-systemd.automount"
];
};
"/home/${config.sysusers.main}/Network/Kitty" = {
device = "sv.nixfox.ca:/storage/bun";
fsType = "nfs4";
options = [
"noauto"
"soft"
"x-systemd.automount"
];
};
"/home/${config.sysusers.main}/Network/Prophet" = {
device = "mx.nixfox.ca:/storage";
fsType = "nfs4";
options = [
"noauto"
"soft"
"x-systemd.automount"
];
};
};
}

View file

@ -0,0 +1,21 @@
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [
"ahci"
"ehci_pci"
"firewire_ohci"
"sd_mod"
"xhci_pci"
];
kernelModules = [ "dm-snapshot" ];
};
kernelModules = [ "kvm-intel" ];
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,7 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}".home = {
guifull.enable = true;
stateVersion = lib.mkForce config.system.stateVersion;
};
}