hosts/hazel: init
This commit is contained in:
parent
3502a31065
commit
4d751d72b3
8 changed files with 121 additions and 8 deletions
22
hosts/hazel/default.nix
Normal file
22
hosts/hazel/default.nix
Normal 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
|
||||
];
|
||||
}
|
||||
53
hosts/hazel/filesystem.nix
Normal file
53
hosts/hazel/filesystem.nix
Normal 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";
|
||||
};
|
||||
}
|
||||
0
hosts/hazel/fs-decrypt.nix
Normal file
0
hosts/hazel/fs-decrypt.nix
Normal file
10
hosts/hazel/kernel.nix
Normal file
10
hosts/hazel/kernel.nix
Normal 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" ];
|
||||
};
|
||||
}
|
||||
5
hosts/hazel/networking.nix
Normal file
5
hosts/hazel/networking.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, ... }: {
|
||||
networking = {
|
||||
useDHCP = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue