Merge branch 'dev/server'

This commit is contained in:
LavaDesu 2025-05-19 19:45:44 +10:00
commit 5ea27ceb6b
Signed by: cilly
GPG key ID: 6500251E087653C9
22 changed files with 207 additions and 100 deletions

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

@ -0,0 +1,35 @@
{ modules, pkgs, ... }: {
networking.hostName = "hazel";
system.stateVersion = "24.11";
time.timeZone = "Australia/Melbourne";
imports = with modules.system; with modules.services; [
home-manager-stable
base
kernel
nginx
nix-stable
packages
security
./filesystem.nix
./kernel.nix
./networking.nix
../../users/hana
];
me.environment = "headless";
services.nextcloud = {
enable = true;
package = pkgs.nextcloud31;
hostName = "cloud.lava.moe";
database.createLocally = true;
config = {
dbtype = "pgsql";
adminpassFile = "/persist/nextcloud-admin-pass";
};
};
}

View file

@ -0,0 +1,53 @@
{ ... }:
let
mkLabelMount = label: type: options: {
device = "/dev/disk/by-label/${label}";
fsType = type;
options = [ "defaults" ] ++ 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" [];
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;
};
}