hosts/hazel: init

This commit is contained in:
LavaDesu 2025-04-05 13:05:59 +11:00
parent 3502a31065
commit 4d751d72b3
Signed by: cilly
GPG key ID: 6500251E087653C9
8 changed files with 121 additions and 8 deletions

22
hosts/hazel/default.nix Normal file
View file

@ -0,0 +1,22 @@
{ modules, ... }: {
networking.hostName = "hazel";
system.stateVersion = "24.11";
time.timeZone = "Australia/Melbourne";
imports = with modules.system; [
home-manager
base
kernel
nix-stable
packages
security
./filesystem.nix
./kernel.nix
./networking.nix
./packages.nix
../../users/hana
];
}

View file

@ -0,0 +1,53 @@
{ ... }:
let
mkLabelMount = label: type: options: {
device = "/dev/disk/by-label/${label}";
fsType = type;
options = options;
};
mkBtrfsMount = name: ext: subvol: atime: mkLabelMount name "btrfs"
[
"autodefrag"
"compress=zstd:4"
"compress-force=zstd:4"
"defaults"
"nossd"
"space_cache=v2"
"subvol=${subvol}"
(if atime then "relatime" else "noatime")
] ++ ext;
mkHazelMount = mkBtrfsMount "HAZEL" [ "noauto" ];
in
{
boot.supportedFilesystems = [ "btrfs" ];
fileSystems = {
"/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "mode=755" ];
};
"/boot" = mkLabelMount "ROOT" "vfat" [];
"/flower" = mkHazelMount "/current/flower" true;
"/persist" = mkHazelMount "/current/persist" true;
"/var" = mkHazelMount "/current/var" true;
"/nix" = mkHazelMount "/current/nix" false;
"/mnt" = mkHazelMount "/" true;
};
services.snapper.cleanupInterval = "1h";
services.snapper.configs.flower = {
FSTYPE = "btrfs";
SUBVOLUME = "/mnt/current/flower";
TIMELINE_CLEANUP = true;
TIMELINE_CREATE = true;
TIMELINE_MIN_AGE = "1800";
TIMELINE_LIMIT_HOURLY = "5";
TIMELINE_LIMIT_DAILY = "7";
TIMELINE_LIMIT_WEEKLY = "0";
TIMELINE_LIMIT_MONTHLY = "0";
TIMELINE_LIMIT_YEARLY = "0";
};
}

View file

10
hosts/hazel/kernel.nix Normal file
View file

@ -0,0 +1,10 @@
{ ... }: {
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ "kvm-amd" ];
};
}

View file

@ -0,0 +1,5 @@
{ config, ... }: {
networking = {
useDHCP = true;
};
}