diff --git a/GUIDELINES.md b/GUIDELINES.md index f4330fd..8f143fc 100644 --- a/GUIDELINES.md +++ b/GUIDELINES.md @@ -33,11 +33,17 @@ skyg os switch / test / build skyg remote switch / test / build / boot / install skyg hm switch / build nix build -nix flake check docker/podman build nixos-anywhere ``` +The only exception is lightweight operations like + +``` +nh os switch --dry +nix flake check +``` + **Why:** - These commands take 20–40+ minutes @@ -82,6 +88,29 @@ breaks the composition model. You must **live and die by these rules** and hold yourself accountable to them. These are not suggestions — they are non-negotiable. +### ❌ NEVER edit files inside `hosts/*/hardware-configuration/` + +These are generated by `nixos-generate-config` and split into `boot.nix` / `file-system.nix`. +They reflect physical hardware — edits will be overwritten and can render a system unbootable. +The `# Clanker ! Do not modify this file!` header is not a suggestion. + +### ❌ NEVER add top-level config to a host's `default.nix` that belongs in a sub-file + +Every host folder follows a standard layout. Put config in the file that matches its scope: + +| Config type | File | +| --------------------- | ------------------------- | +| Hardware / firmware | `hardware.nix` | +| Systemd / boot loader | `systemd.nix` | +| Packages | `packages.nix` | +| Networking / firewall | `networking.nix` | +| Services (few) | `services.nix` | +| Services (many) | `services/.nix` | +| Home-manager | `home/default.nix` | +| Generated hardware | `hardware-configuration/` | + +Don't dump unrelated options into `default.nix` — split them into the right file. + ### KEEP EVERYTHING CONCISE, shorter concise comments are preferable, less jargon and more common words. --- @@ -129,6 +158,30 @@ myOptions.desktop.enable = true; All modules follow `lib.mkIf cfg.enable { ... }`. Always gate config behind an `enable` option. Default should be `false` unless the feature is universally required. +### Host File Structure + +Each host is a folder under `hosts//`. The folder must contain at minimum +a `default.nix`. Split larger hosts into focused files: + +``` +hosts// +├── default.nix # skyg options, top-level settings, display manager +├── hardware.nix # Host-specific hardware (fwupd, kernel params, firmware) +├── systemd.nix # Boot loader, systemd targets/services, tmp, swap +├── packages.nix # environment.systemPackages (extract when > ~10 packages) +├── services.nix # Flat service configs (when < ~3 services) +├── services/ +│ ├── default.nix # imports all service files +│ ├── .nix # One file per service (when > ~3 services) +├── networking.nix # Firewall, Tailscale, NFS mounts, hosts +├── home/ +│ └── default.nix # home-manager users. block +└── hardware-configuration/ # Generated — DO NOT TOUCH + ├── default.nix + ├── boot.nix + └── file-system.nix +``` + ### Host Files vs Shared Modules - **Host-specific** (one machine only): goes in `hosts/.nix` diff --git a/flake.nix b/flake.nix index c134000..4b09fb0 100644 --- a/flake.nix +++ b/flake.nix @@ -265,16 +265,14 @@ hostName = "fwbook"; systemStateVersion = "23.11"; configuration = [ - ./hosts/fwbook.nix - ./hosts/fwbook.hardware-configuration.nix + ./hosts/fwbook nixos-hardware.nixosModules.framework-13-7040-amd ]; }; hl-fws1 = lib.makeNixOs { hostName = "hl-fws1"; configuration = [ - ./hosts/hl-fws1.nix - ./hosts/hl-fws1.hardware-configuration.nix + ./hosts/hl-fws1 ./hosts/hl-fws1.disko.nix nixos-hardware.nixosModules.framework-11th-gen-intel disko.nixosModules.disko @@ -284,8 +282,7 @@ hostName = "hl-fwdesk"; systemStateVersion = "25.05"; configuration = [ - ./hosts/hl-fwdesk.nix - ./hosts/hl-fwdesk.hardware-configuration.nix + ./hosts/hl-fwdesk nixos-hardware.nixosModules.framework-desktop-amd-ai-max-300-series hermenix.nixosModules.default ]; @@ -293,66 +290,58 @@ hl-bigbox1 = lib.makeNixOs { hostName = "hl-bigbox1"; configuration = [ - ./hosts/hl-bigbox1.nix - ./hosts/hl-bigbox1.hardware-configuration.nix + ./hosts/hl-bigbox1 ]; }; hl-bigbox2 = lib.makeNixOs { hostName = "hl-bigbox2"; systemStateVersion = "25.05"; configuration = [ - ./hosts/hl-bigbox2.nix - ./hosts/hl-bigbox2.hardware-configuration.nix + ./hosts/hl-bigbox2 ]; }; hl-minipc1 = lib.makeNixOs { hostName = "hl-minipc1"; configuration = [ - ./hosts/hl-minipc1.nix - ./hosts/hl-minipc1.hardware-configuration.nix + ./hosts/hl-minipc1 ]; }; hl-minipc2 = lib.makeNixOs { hostName = "hl-minipc2"; configuration = [ - ./hosts/hl-minipc2.nix - ./hosts/hl-minipc2.hardware-configuration.nix + ./hosts/hl-minipc2 ]; }; hl-minipc3 = lib.makeNixOs { hostName = "hl-minipc3"; configuration = [ - ./hosts/hl-minipc3.nix - ./hosts/hl-minipc3.hardware-configuration.nix + ./hosts/hl-minipc3 ]; }; hl-pi1 = lib.makeSdImage { system = "aarch64-linux"; hostName = "hl-pi1"; configuration = [ - ./hosts/hl-pi1.nix - ./hosts/hl-pi1.hardware-configuration.nix + ./hosts/hl-pi1 ]; }; hl-pi2 = lib.makeSdImage { system = "aarch64-linux"; hostName = "hl-pi2"; configuration = [ - ./hosts/hl-pi2.nix - ./hosts/hl-pi2.hardware-configuration.nix + ./hosts/hl-pi2 ]; }; hl-terra1 = lib.makeNixOs { hostName = "hl-terra1"; configuration = [ - ./hosts/hl-terra1.nix - ./hosts/hl-terra1.hardware-configuration.nix + ./hosts/hl-terra1 ]; }; iso = lib.makeIso { hostName = "skygnix"; configuration = [ - ./hosts/iso.nix + ./hosts/iso ]; }; }; diff --git a/hosts/ABOUTME.md b/hosts/ABOUTME.md index 1688862..a39366e 100644 --- a/hosts/ABOUTME.md +++ b/hosts/ABOUTME.md @@ -1,41 +1,55 @@ # hosts/ -One NixOS configuration file per managed machine, plus hardware configs and host-specific scripts. +One folder per managed machine, plus hardware configs and host-specific scripts. ## Structure ``` hosts/ -├── .nix # Host configuration (packages, services, options) -├── .hardware-configuration.nix # Generated by nixos-generate-config — DO NOT EDIT -├── .disko.nix # Optional: declarative disk layout for `skyg remote install` (nixos-anywhere). -│ # Only present for hosts installed/reinstalled this way (currently: hl-fws1) +├── / # Per-host folder (default.nix is the entry point) +│ ├── default.nix # Main config: skyg options, top-level settings +│ ├── packages.nix # environment.systemPackages (large hosts only) +│ ├── services.nix # Service configs (tailscale, ollama, steam, …) +│ ├── hardware.nix # Kernel params, GPU tuning, boot (large hosts only) +│ ├── networking.nix # Firewall, NFS mounts, DNS (large hosts only) +│ ├── containers.nix # Container service groups (hl-minipc1, hl-minipc2) +│ └── ... # Additional host-specific sub-files as needed +├── .hardware-configuration.nix # Generated — DO NOT EDIT +├── .disko.nix # Declarative disk layout (hl-fws1 only) └── scripts/ ├── fwbook/ # fwbook-specific shell scripts │ ├── functions.sh # ZSH functions sourced at shell startup - │ └── functions.nu # NuShell helpers (k8s namespace/secret listing, secret decoding) + │ └── functions.nu # NuShell helpers ├── fw1/ - │ └── gs.sh # gamescope/Steam launch wrapper (VRR, HDR, mangoapp overlay) + │ └── gs.sh # gamescope/Steam launch wrapper └── hl-minipc1/ - └── buzz-manage.sh # Buzz stack management CLI (wired as `buzz-manage`) + └── buzz-manage.sh # Buzz stack management CLI ``` ## Managed Hosts -| File | Host | Role | -| ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `fwbook.nix` | fwbook | Framework 13 AMD — personal laptop / daily driver | -| `hl-fwdesk.nix` | hl-fwdesk | Framework Desktop AI Max 300 — AI workstation | -| `hl-fws1.nix` | hl-fws1 | Framework 11th Intel — K3s server node | -| `hl-bigbox1.nix` | hl-bigbox1 | AI/compute server (NVIDIA + AMD) | -| `hl-bigbox2.nix` | hl-bigbox2 | NFS storage server | -| `hl-minipc1.nix` | hl-minipc1 | Core infra: Gitea, nix-serve, registry, Buzz (docker, `buzz-manage` CLI) | -| `hl-minipc2.nix` | hl-minipc2 | Container/media server | -| `hl-minipc3.nix` | hl-minipc3 | K3s worker node | -| `hl-pi1.nix` | hl-pi1 | Raspberry Pi CM4 (aarch64) — headless server, SSH only. Also buildable as a bootable SD image via the `hl-pi1-sd-image` nixosConfiguration (`skyg build-pi-sd-image`) | -| `hl-pi2.nix` | hl-pi2 | Raspberry Pi 4 (aarch64) — headless server, SSH only. Also buildable as a bootable SD image via the `hl-pi2-sd-image` nixosConfiguration | -| `hl-terra1.nix` | hl-terra1 | NFS storage + Jellyfin backup | -| `iso.nix` | iso | Bootable NixOS installer image | +| Folder | Host | Role | +| ------------- | ---------- | ------------------------------------------------------------------------ | +| `fwbook/` | fwbook | Framework 13 AMD — personal laptop / daily driver | +| `hl-fwdesk/` | hl-fwdesk | Framework Desktop AI Max 300 — AI workstation | +| `hl-fws1/` | hl-fws1 | Framework 11th Intel — K3s server node | +| `hl-bigbox1/` | hl-bigbox1 | AI/compute server (NVIDIA + AMD) | +| `hl-bigbox2/` | hl-bigbox2 | NFS storage server | +| `hl-minipc1/` | hl-minipc1 | Core infra: Gitea, nix-serve, registry, Buzz (docker, `buzz-manage` CLI) | +| `hl-minipc2/` | hl-minipc2 | Container/media server | +| `hl-minipc3/` | hl-minipc3 | K3s worker node | +| `hl-pi1/` | hl-pi1 | Raspberry Pi CM4 (aarch64) — headless server, SSH only | +| `hl-pi2/` | hl-pi2 | Raspberry Pi 4 (aarch64) — headless server, SSH only | +| `hl-terra1/` | hl-terra1 | NFS storage + Jellyfin backup | +| `iso/` | iso | Bootable NixOS installer image | + +## Rules + +- **Do not add `imports = [...]`** to host files — module composition happens in `flake.nix` via `modules/main.nix` +- **Do not edit `*.hardware-configuration.nix`** — these are generated and will be overwritten +- Hosts with a `.disko.nix` own their `fileSystems` via disko; if a generated `hardware-configuration.nix` still contains its own `fileSystems` stanzas for the same host, that's a conflict the machine's owner needs to resolve by hand (regenerating or trimming it) — not something to script around +- Host-specific packages and one-off settings belong here; anything reused across hosts belongs in `modules/` +- See `docs/hosts/README.md` for full per-host service/port/package reference ## Rules diff --git a/hosts/fwbook.nix b/hosts/fwbook.nix deleted file mode 100644 index 832576a..0000000 --- a/hosts/fwbook.nix +++ /dev/null @@ -1,357 +0,0 @@ -{ pkgs -, config -, lib -, user -, unstablePkgs -, ... -}: -let - zshFWBook = builtins.filterSource (p: t: true) ./scripts/fwbook; - zshFunctions = zshFWBook + "/functions.sh"; - openPorts = [ - 8000 - 8001 - ]; - -in -{ - # Skyg - skyg = { - user.enable = true; - server.admin.enable = true; - core.qemu.enable = true; - nixos = { - common.hardware = { - pipewire.enable = true; - laptop-power-mgr = { - enable = true; - enableTempMonitor = true; - }; - amdgpu.enable = true; - }; - desktop = { - enable = true; - crypto.enable = true; - printers.enable = true; - fixes = { - airpod-bluetooth.enabled = true; - }; - tiler = { - enable = true; - apps = { - control.enable = true; - gnome.enable = true; - media.enable = true; - }; - hyprland = { - enable = true; - tools.enable = true; - }; - noctalia = { - enable = true; - configLink.enable = true; - }; - quickshell.enable = true; - niri = { - enable = true; - configLink.enable = true; - touchscreen-gestures = { - enable = true; - touchOutput = "eDP-1"; - }; - }; - }; - }; - }; - networkDrives = { - enable = false; - options = [ - "x-systemd.automount" - "noauto" - ]; - }; - }; - # Genera settings - nix.settings.cores = 4; - nix.settings.max-jobs = 10; - virtualisation.waydroid.enable = true; - hardware.enableRedistributableFirmware = true; - # QEMU emulation for building aarch64 (e.g. hl-pi1) locally instead of on-device - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - # Tailscale - services.tailscale.enable = true; - services.tailscale.extraDaemonFlags = [ "--statedir=/var/lib/tailscale" ]; - # Desktop Env - DankGreeter - programs.dms-greeter = { - enable = true; - compositor.name = "niri"; - configHome = "/home/${user.name}"; - }; - # home manager - only configure if skyg.user.enable is true - home-manager.users.${user.name} = lib.mkIf config.skyg.user.enable { - # Add Functions - programs.zsh.initContent = '' - source ${zshFunctions} - ''; - services.blueman-applet.enable = true; - }; - # Firmware updater - hardware.framework.enableKmod = true; - services.fprintd.enable = true; - # Touchscreen - services.libinput = { - enable = true; - }; - # Graphics - hardware.graphics = { - enable = true; - }; - # Yubikey - services.yubikey-agent.enable = true; - # Bluetooth - skyg.nixos.common.hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; - # Packages - environment.systemPackages = - let - gdk = pkgs.google-cloud-sdk.withExtraComponents ( - with pkgs.google-cloud-sdk.components; - [ - gke-gcloud-auth-plugin - kubectl - ] - ); - in - (with pkgs; [ - # Improvement of Life - grim - slurp - wl-clipboard - tesseract - imagemagick - zbar - curl - translate-shell - wl-screenrec - ffmpeg - gifski - libusb1 - lshw - jq - parted - gparted-full - f3 - nixd - kdePackages.qtdeclarative - piper-tts - ffmpeg - oreo-cursors-plus - - # Work - postgresql - google-cloud-sdk - awscli - openfortivpn - openfortivpn-webview - openfortivpn-webview-qt - nodejs - - # Emulation - wineWow64Packages.stable - winetricks - wineWow64Packages.waylandFull - - # Video recording & editing - obs-studio - davinci-resolve - grim - slurp - wl-clipboard - tesseract - imagemagick - zbar - curl - translate-shell - wl-screenrec - ffmpeg - gifski - jq - - # Photo/video Editing - krita - gimp-with-plugins - shotcut - simple-scan # scanning photos - - # socials - zoom-us - betterdiscordctl - discord - signal-desktop - - # Languages - python313 - python314 - uv - cargo - rustc - go - pipx - rust-analyzer - - # Development - vscode - unstablePkgs.zed-editor-fhs - devenv - just - rpi-imager - rpiboot - code-cursor-fhs - nix-prefetch - orca-slicer - devcontainer - gpu-screen-recorder - flox_dev - - # Run macos apps - darling-dmg - - # password - bitwarden-cli - - # documents - onlyoffice-desktopeditors - - # Work - gh - gdk - unstablePkgs.slack - - # IPhone Tethering - libimobiledevice - ifuse - - # Iphone Management - idevicerestore # optional, to mount using 'ifuse' - - # coding agents - unstablePkgs.grok-build - unstablePkgs.pi-coding-agent - unstablePkgs.goose-cli - unstablePkgs.claude-agent-acp - unstablePkgs.claude-code - buzz-desktop - bubblewrap - herdr - superset-desktop - - # My apps - skygqts - hermenix - ]); - - # General hardware stuff - systemd.services.systemd-udev-settle.enable = false; - services.usbmuxd.enable = true; - # Tether — iPhone ↔ Linux Wayland bridge - programs.tether = { - enable = true; - wifi = { - enable = true; - openFirewall = true; - }; - bluetooth = { - enable = true; - adapters = [ "hci0" ]; - }; - }; - services.flatpak.enable = true; - services.flatpak.packages = [ - "io.github.kolunmi.Bazaar" - "com.spotify.Client" - "org.pipewire.Helvum" - "com.cassidyjames.butler" - "io.dbeaver.DBeaverCommunity" - "com.google.Chrome" - "dev.deedles.Trayscale" - ]; - # Phone - programs.kdeconnect.enable = true; - # Gaming - programs.steam = { - enable = true; - extest.enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = true; - }; - programs.gamescope = { - enable = true; - capSysNice = true; - }; - # Ollama - services.ollama = { - enable = true; - host = "0.0.0.0"; - port = 11434; - package = unstablePkgs.ollama-rocm; - environmentVariables = { - HSA_OVERRIDE_GFX_VERSION = "11.0.2"; - }; - }; - # # Display Managers - services.xserver.videoDrivers = [ - "modesetting" - "fbdev" - ]; - # Family Storage - fileSystems."/mnt/EightTerra/FamilyStorage" = { - device = "tnas1.lab.internal:/mnt/EightTerra/FamilyStorage"; - fsType = "nfs"; - options = [ - "x-systemd.automount" - "noauto" - ]; - }; - fileSystems."/mnt/EightTerra/k3s-cluster" = { - device = "tnas1.lab.internal:/mnt/EightTerra/k3s-cluster"; - fsType = "nfs"; - options = [ - "x-systemd.automount" - "noauto" - ]; - }; - fileSystems."/mnt/EightTerra/DownloadedTorrents" = { - device = "tnas1.lab.internal:/mnt/EightTerra/DownloadedTorrents"; - fsType = "nfs"; - options = [ - "x-systemd.automount" - "noauto" - ]; - }; - skyg.nixos.common.nh.flake = "/home/ari/nixos-setup"; - # Firewall - networking.firewall.allowedUDPPorts = openPorts; - networking.firewall.allowedTCPPorts = openPorts; - networking.firewall.extraCommands = '' - iptables -I INPUT 1 -s 172.16.0.0/12 -p tcp -d 172.17.0.1 -j ACCEPT - iptables -I INPUT 2 -s 172.16.0.0/12 -p udp -d 172.17.0.1 -j ACCEPT - ''; - # random dev work - networking.hosts = { - "0.0.0.0" = [ - "auth.me.internal" - "me.internal" - "me.local" - "api.me.internal" - ]; - "127.0.0.1" = [ - "fwbook" - "auth.me.internal" - "me.internal" - "me.local" - "api.me.internal" - ]; - }; -} diff --git a/hosts/fwbook/default.nix b/hosts/fwbook/default.nix new file mode 100644 index 0000000..df856ab --- /dev/null +++ b/hosts/fwbook/default.nix @@ -0,0 +1,82 @@ +{ config, lib, user, ... }: +{ + imports = [ + ./hardware-configuration + ./packages.nix + ./services.nix + ./networking.nix + ./hardware.nix + ./systemd.nix + ]; + + skyg = { + user.enable = true; + server.admin.enable = true; + core.qemu.enable = true; + nixos = { + common.hardware = { + pipewire.enable = true; + laptop-power-mgr = { + enable = true; + enableTempMonitor = true; + }; + amdgpu.enable = true; + }; + desktop = { + enable = true; + crypto.enable = true; + printers.enable = true; + fixes = { + airpod-bluetooth.enabled = true; + }; + tiler = { + enable = true; + apps = { + control.enable = true; + gnome.enable = true; + media.enable = true; + }; + hyprland = { + enable = true; + tools.enable = true; + }; + noctalia = { + enable = true; + configLink.enable = true; + }; + quickshell.enable = true; + niri = { + enable = true; + configLink.enable = false; + touchscreen-gestures = { + enable = true; + touchOutput = "eDP-1"; + }; + }; + }; + }; + }; + networkDrives = { + enable = false; + options = [ + "x-systemd.automount" + "noauto" + ]; + }; + }; + + nix.settings.cores = 4; + nix.settings.max-jobs = 10; + skyg.nixos.common.nh.flake = "/home/ari/nixos-setup"; + virtualisation.waydroid.enable = true; + + programs.dms-greeter = { + enable = true; + compositor.name = "niri"; + configHome = "/home/${user.name}"; + }; + + services.usbmuxd.enable = true; + + home-manager.users.${user.name} = lib.mkIf config.skyg.user.enable (import ./home); +} diff --git a/hosts/fwbook/hardware-configuration/boot.nix b/hosts/fwbook/hardware-configuration/boot.nix new file mode 100644 index 0000000..ed08c54 --- /dev/null +++ b/hosts/fwbook/hardware-configuration/boot.nix @@ -0,0 +1,47 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = + [ "nvme" "xhci_pci" "thunderbolt" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "udev.log_priority=3" + "rd.systemd.show_status=auto" + # Improve s2idle sleep behavior on AMD + "rtc_cmos.use_acpi_alarm=1" + "acpi.prefer_microsoft_dsm_guid=1" + "amd_pstate=active" + # Disable the old and new display power-saving features (PSR and Panel Replay). + "amdgpu.dcdebugmask=0x410" + ]; + boot.extraModulePackages = [ ]; + boot.plymouth = { + enable = true; + }; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.tmp.useTmpfs = true; + boot.consoleLogLevel = 3; + boot.initrd.verbose = false; + boot.extraModprobeConfig = '' + options snd_hda_intel power_save=0 + ''; + + boot.kernel.sysctl = { + "vm.swappiness" = 150; + "vm.page-cluster" = 0; + }; + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/fwbook/hardware-configuration/default.nix b/hosts/fwbook/hardware-configuration/default.nix new file mode 100644 index 0000000..0f2a3e0 --- /dev/null +++ b/hosts/fwbook/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, user, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/fwbook.hardware-configuration.nix b/hosts/fwbook/hardware-configuration/file-system.nix similarity index 61% rename from hosts/fwbook.hardware-configuration.nix rename to hosts/fwbook/hardware-configuration/file-system.nix index be67274..8a687b8 100644 --- a/hosts/fwbook.hardware-configuration.nix +++ b/hosts/fwbook/hardware-configuration/file-system.nix @@ -1,40 +1,8 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +# +# Clanker ! Do not modify this file! +# +{ pkgs, ... }: { - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = - [ "nvme" "xhci_pci" "thunderbolt" "uas" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "udev.log_priority=3" - "rd.systemd.show_status=auto" - # Improve s2idle sleep behavior on AMD - "rtc_cmos.use_acpi_alarm=1" - "acpi.prefer_microsoft_dsm_guid=1" - "amd_pstate=active" - # Disable the old and new display power-saving features (PSR and Panel Replay). - "amdgpu.dcdebugmask=0x410" - ]; - boot.extraModulePackages = [ ]; - boot.plymouth = { - enable = true; - }; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.tmp.useTmpfs = true; - boot.consoleLogLevel = 3; - boot.initrd.verbose = false; - boot.extraModprobeConfig = '' - options snd_hda_intel power_save=0 - ''; fileSystems."/" = { device = "/dev/disk/by-uuid/adaad601-f79c-4342-ba3a-9eab53ec4cd1"; @@ -88,15 +56,6 @@ algorithm = "zstd"; memoryPercent = 50; }; - boot.kernel.sysctl = { - "vm.swappiness" = 150; - "vm.page-cluster" = 0; - }; - networking.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; - # BTRFS Stuff services.btrfs.autoScrub.enable = true; services.snapper = { diff --git a/hosts/fwbook/hardware.nix b/hosts/fwbook/hardware.nix new file mode 100644 index 0000000..358aa7a --- /dev/null +++ b/hosts/fwbook/hardware.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + hardware.enableRedistributableFirmware = true; + hardware.framework.enableKmod = true; + hardware.graphics.enable = true; + hardware.bluetooth.powerOnBoot = true; + + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + + services.fprintd.enable = true; + services.libinput.enable = true; + services.yubikey-agent.enable = true; + + skyg.nixos.common.hardware.bluetooth.enable = true; +} diff --git a/hosts/fwbook/home/default.nix b/hosts/fwbook/home/default.nix new file mode 100644 index 0000000..8aef738 --- /dev/null +++ b/hosts/fwbook/home/default.nix @@ -0,0 +1,98 @@ +{ ... }: +let + zshFWBook = builtins.filterSource (p: t: true) ../../scripts/fwbook; + zshFunctions = zshFWBook + "/functions.sh"; +in +{ + programs.zsh.initContent = '' + source ${zshFunctions} + ''; + services.blueman-applet.enable = true; + xdg.mimeApps.enable = true; + xdg.mimeApps.defaultApplications = { + "x-scheme-handler/about" = "chromium-browser.desktop"; + "x-scheme-handler/chrome" = "chromium-browser.desktop"; + "x-scheme-handler/http" = "chromium-browser.desktop"; + "x-scheme-handler/https" = "chromium-browser.desktop"; + "x-scheme-handler/unknown" = "chromium-browser.desktop"; + "x-scheme-handler/geo" = "google-maps-geo-handler.desktop"; + "x-scheme-handler/mailto" = "chromium-browser.desktop"; + "x-scheme-handler/sgnl" = "signal.desktop"; + "x-scheme-handler/signalcaptcha" = "signal.desktop"; + "x-scheme-handler/slack" = "slack.desktop"; + "x-scheme-handler/terminal" = "com.mitchellh.ghostty.desktop"; + "application/pdf" = "chromium-browser.desktop"; + "application/xhtml+xml" = "chromium-browser.desktop"; + "text/html" = "chromium-browser.desktop"; + "application/x-terminal-emulator" = "com.mitchellh.ghostty.desktop"; + "inode/directory" = "org.gnome.Nautilus.desktop"; + "image/avif" = "org.gnome.eog.desktop"; + "image/bmp" = "org.gnome.eog.desktop"; + "image/gif" = "org.gnome.eog.desktop"; + "image/heif" = "org.gnome.eog.desktop"; + "image/jpeg" = "org.gnome.eog.desktop"; + "image/png" = "org.gnome.eog.desktop"; + "image/svg+xml" = "org.gnome.eog.desktop"; + "image/tiff" = "org.gnome.eog.desktop"; + "image/webp" = "org.gnome.eog.desktop"; + "application/x-matroska" = "vlc.desktop"; + "audio/aac" = "vlc.desktop"; + "audio/flac" = "vlc.desktop"; + "audio/m4a" = "vlc.desktop"; + "audio/mpeg" = "vlc.desktop"; + "audio/ogg" = "vlc.desktop"; + "audio/wav" = "vlc.desktop"; + "audio/x-flac" = "vlc.desktop"; + "video/avi" = "vlc.desktop"; + "video/mp4" = "vlc.desktop"; + "video/mpeg" = "vlc.desktop"; + "video/ogg" = "vlc.desktop"; + "video/quicktime" = "vlc.desktop"; + "video/webm" = "vlc.desktop"; + "video/x-matroska" = "vlc.desktop"; + "application/javascript" = "code.desktop"; + "application/json" = "nvim.desktop"; + "application/x-docbook+xml" = "nvim.desktop"; + "application/x-httpd-php3" = "dev.zed.Zed.desktop"; + "application/x-httpd-php4" = "dev.zed.Zed.desktop"; + "application/x-httpd-php5" = "dev.zed.Zed.desktop"; + "application/x-m4" = "dev.zed.Zed.desktop"; + "application/x-php" = "dev.zed.Zed.desktop"; + "application/x-ruby" = "dev.zed.Zed.desktop"; + "application/x-shellscript" = "nvim.desktop"; + "application/x-yaml" = "nvim.desktop"; + "application/xml" = "nvim.desktop"; + "text/css" = "dev.zed.Zed.desktop"; + "text/markdown" = "nvim.desktop"; + "text/plain" = "nvim.desktop"; + "text/turtle" = "dev.zed.Zed.desktop"; + "text/x-c++hdr" = "dev.zed.Zed.desktop"; + "text/x-c++src" = "dev.zed.Zed.desktop"; + "text/x-chdr" = "dev.zed.Zed.desktop"; + "text/x-cmake" = "dev.zed.Zed.desktop"; + "text/x-csharp" = "dev.zed.Zed.desktop"; + "text/x-csrc" = "dev.zed.Zed.desktop"; + "text/x-diff" = "dev.zed.Zed.desktop"; + "text/x-dsrc" = "dev.zed.Zed.desktop"; + "text/x-fortran" = "dev.zed.Zed.desktop"; + "text/x-java" = "dev.zed.Zed.desktop"; + "text/x-makefile" = "dev.zed.Zed.desktop"; + "text/x-pascal" = "dev.zed.Zed.desktop"; + "text/x-perl" = "dev.zed.Zed.desktop"; + "text/x-python" = "dev.zed.Zed.desktop"; + "text/x-sql" = "dev.zed.Zed.desktop"; + "text/x-vb" = "dev.zed.Zed.desktop"; + "application/vnd.openxmlformats-officedocument.presentationml.presentation" = "onlyoffice-desktopeditors.desktop"; + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = "onlyoffice-desktopeditors.desktop"; + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "onlyoffice-desktopeditors.desktop"; + "text/csv" = "onlyoffice-desktopeditors.desktop"; + }; + xdg.mimeApps.associations.added = { + "application/json" = "nvim.desktop;dev.zed.Zed.desktop;"; + "application/pdf" = "chromium-browser.desktop;onlyoffice-desktopeditors.desktop;"; + "audio/mpeg" = "vlc.desktop;mpv.desktop;"; + "image/png" = "org.gnome.eog.desktop;gimp.desktop;"; + "text/plain" = "dev.zed.Zed.desktop;nvim.desktop;code.desktop;"; + "video/mp4" = "vlc.desktop;mpv.desktop;"; + }; +} diff --git a/hosts/fwbook/networking.nix b/hosts/fwbook/networking.nix new file mode 100644 index 0000000..3d81265 --- /dev/null +++ b/hosts/fwbook/networking.nix @@ -0,0 +1,31 @@ +{ ... }: +let + openPorts = [ + 8000 + 8001 + ]; +in +{ + fileSystems."/mnt/EightTerra/FamilyStorage" = { + device = "tnas1.lab.internal:/mnt/EightTerra/FamilyStorage"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; + networking.firewall.allowedUDPPorts = openPorts; + networking.firewall.allowedTCPPorts = openPorts; + networking.hosts = { + "0.0.0.0" = [ + "auth.me.internal" + "me.internal" + "me.local" + "api.me.internal" + ]; + "127.0.0.1" = [ + "fwbook" + "auth.me.internal" + "me.internal" + "me.local" + "api.me.internal" + ]; + }; +} diff --git a/hosts/fwbook/packages.nix b/hosts/fwbook/packages.nix new file mode 100644 index 0000000..52c450c --- /dev/null +++ b/hosts/fwbook/packages.nix @@ -0,0 +1,124 @@ +{ pkgs, unstablePkgs, ... }: +{ + environment.systemPackages = + let + gdk = pkgs.google-cloud-sdk.withExtraComponents ( + with pkgs.google-cloud-sdk.components; + [ + gke-gcloud-auth-plugin + kubectl + ] + ); + in + (with pkgs; [ + grim + slurp + wl-clipboard + tesseract + imagemagick + zbar + curl + translate-shell + wl-screenrec + ffmpeg + gifski + libusb1 + lshw + jq + parted + gparted-full + f3 + nixd + kdePackages.qtdeclarative + piper-tts + ffmpeg + oreo-cursors-plus + + postgresql + google-cloud-sdk + awscli + openfortivpn + openfortivpn-webview + openfortivpn-webview-qt + nodejs + + wineWow64Packages.stable + winetricks + wineWow64Packages.waylandFull + + obs-studio + davinci-resolve + grim + slurp + wl-clipboard + tesseract + imagemagick + zbar + curl + translate-shell + wl-screenrec + ffmpeg + gifski + jq + + krita + gimp-with-plugins + shotcut + simple-scan + + zoom-us + betterdiscordctl + discord + signal-desktop + + python313 + python314 + uv + cargo + rustc + go + pipx + rust-analyzer + + vscode + unstablePkgs.zed-editor-fhs + devenv + just + rpi-imager + rpiboot + code-cursor-fhs + nix-prefetch + orca-slicer + devcontainer + gpu-screen-recorder + flox_dev + + darling-dmg + + bitwarden-cli + + onlyoffice-desktopeditors + + gh + gdk + unstablePkgs.slack + + libimobiledevice + ifuse + + idevicerestore + + unstablePkgs.grok-build + unstablePkgs.pi-coding-agent + unstablePkgs.goose-cli + unstablePkgs.claude-agent-acp + unstablePkgs.claude-code + buzz-desktop + bubblewrap + herdr + superset-desktop + + skygqts + hermenix + ]); +} diff --git a/hosts/fwbook/services.nix b/hosts/fwbook/services.nix new file mode 100644 index 0000000..06b9148 --- /dev/null +++ b/hosts/fwbook/services.nix @@ -0,0 +1,56 @@ +{ pkgs, unstablePkgs, config, ... }: +{ + services.tailscale.enable = true; + services.tailscale.extraDaemonFlags = [ "--statedir=/var/lib/tailscale" ]; + + programs.tether = { + enable = true; + wifi = { + enable = true; + openFirewall = true; + }; + bluetooth = { + enable = true; + adapters = [ "hci0" ]; + }; + }; + + services.flatpak.enable = true; + services.flatpak.packages = [ + "io.github.kolunmi.Bazaar" + "com.spotify.Client" + "org.pipewire.Helvum" + "com.cassidyjames.butler" + "io.dbeaver.DBeaverCommunity" + "com.google.Chrome" + "dev.deedles.Trayscale" + ]; + + programs.kdeconnect.enable = true; + + programs.steam = { + enable = true; + extest.enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; + }; + programs.gamescope = { + enable = true; + capSysNice = true; + }; + services.ollama = { + enable = true; + host = "0.0.0.0"; + port = 11434; + package = unstablePkgs.ollama-rocm; + environmentVariables = { + HSA_OVERRIDE_GFX_VERSION = "11.0.2"; + }; + }; + services.xserver.videoDrivers = [ + "modesetting" + "fbdev" + ]; +} diff --git a/hosts/fwbook/systemd.nix b/hosts/fwbook/systemd.nix new file mode 100644 index 0000000..7a4de09 --- /dev/null +++ b/hosts/fwbook/systemd.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + systemd.services.systemd-udev-settle.enable = false; +} diff --git a/hosts/hl-bigbox1.nix b/hosts/hl-bigbox1.nix deleted file mode 100644 index 0b421e6..0000000 --- a/hosts/hl-bigbox1.nix +++ /dev/null @@ -1,150 +0,0 @@ -{ pkgs, config, ... }: -{ - skyg = { - user.enable = true; - server.admin.enable = true; - server.exporters.enable = true; - server.timers = { - jellyfin-backups = { - OnCalendar = "daily"; - wantedBy = [ - "homelab-terra1-Data-apps.mount" - ]; - script = '' - set -eu - ${pkgs.rsync}/bin/rsync -avpzP --delete /opt/jellyfin /homelab/terra1/Data/apps/ - ''; - }; - }; - nixos = { - desktop = { - enable = false; - gnome.enable = false; - }; - common.ssh-server.enable = true; - common.containers.openMetricsPort = true; - common.hardware = { - nvidia.enable = true; - amdgpu.enable = true; - udevrules.coraltpu.enable = true; - }; - server.services = { - ai.enable = true; - }; - }; - networkDrives.enable = true; - }; - - # Portainer Edge Agent - age.secrets.portainer-agent-bigbox1.file = ../secrets/portainer-agent-bigbox1.age; - skyg.nixos.server.portainer = { - enable = true; - mode = "agent"; - agent.edgeKeySecretName = "portainer-agent-bigbox1"; - }; - - # Jellyfin container service group - skyg.nixos.common.container-services.jellyfin = { - enable = true; - autoUpdate.enable = true; - services = { - jellyfin = { - image = "jellyfin/jellyfin"; - deploy = { - resources = { - reservations = { - devices = [ - { - driver = "cdi"; - device_ids = [ "nvidia.com/gpu=all" ]; - capabilities = [ "gpu" ]; - } - ]; - }; - }; - }; - volumes = [ - "/opt/jellyfin:/mnt/apps/jellyfin" - "torrents:/torrents" - "family-videos:/family-videos" - ]; - devices = [ "/dev/dri:/dev/dri" ]; - restart = "always"; - healthcheck = { - test = "curl --fail http://0.0.0.0:8096 || exit 1"; - interval = "60s"; - timeout = "20s"; - start_period = "30s"; - }; - environment = { - JELLYFIN_DATA_DIR = "/mnt/apps/jellyfin/data"; - JELLYFIN_CACHE_DIR = "/mnt/apps/jellyfin/cache"; - JELLYFIN_CONFIG_DIR = "/mnt/apps/jellyfin/config"; - NVIDIA_VISIBLE_DEVICES = "all"; - }; - ports = [ "8096:8096" ]; - }; - }; - volumes = { - torrents = { - driver_opts = { - "type" = "nfs"; - "o" = "addr=tnas1.lab.internal,nfsvers=4"; - "device" = ":/mnt/EightTerra/DownloadedTorrents"; - }; - }; - family-videos = { - driver_opts = { - "type" = "nfs"; - "o" = "addr=tnas1.lab.internal,nfsvers=4"; - "device" = ":/mnt/EightTerra/FamilyStorage/Video"; - }; - }; - jellyfin = { - driver_opts = { - "type" = "nfs"; - "o" = "addr=tnas1.lab.internal,nfsvers=4"; - "device" = ":/mnt/Data/apps/jellyfin"; - }; - }; - }; - }; - - services.displayManager.defaultSession = "gnome"; - services.displayManager.autoLogin = { - enable = true; - user = config.skyg.user.name; - }; - systemd.services."getty@tty1".enable = false; - systemd.services."autovt@tty1".enable = false; - # Disable auto-suspend - systemd.targets.sleep.enable = false; - systemd.targets.suspend.enable = false; - systemd.targets.hibernate.enable = false; - systemd.targets.hybrid-sleep.enable = false; - services.displayManager.gdm.autoSuspend = false; - services.displayManager.gdm.autoLogin.delay = 0; - # Firewall & permissions - networking.firewall.enable = false; - users.users.ari.extraGroups = [ "input" ]; - # firmware updater - services.fwupd.enable = true; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.tmp.useTmpfs = true; - # QEMU emulation for building aarch64 (e.g. hl-pi1) as a remote build machine - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - # linuxPackages_hardened was removed in 26.05; _latest is 7.2 and NVIDIA 595 cannot build against it - boot.kernelPackages = pkgs.linuxPackages; - # Wake on Lan - networking.interfaces.enp4s0.wakeOnLan.enable = true; - networking.interfaces.lo.wakeOnLan.enable = true; - # Extra Packages - environment.systemPackages = with pkgs; [ - nvidia-container-toolkit - libnvidia-container - docker - runc - ]; -} diff --git a/hosts/hl-bigbox1/default.nix b/hosts/hl-bigbox1/default.nix new file mode 100644 index 0000000..6b656db --- /dev/null +++ b/hosts/hl-bigbox1/default.nix @@ -0,0 +1,48 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./services + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ]; + + skyg = { + user.enable = true; + server.admin.enable = true; + server.exporters.enable = true; + nixos = { + desktop = { + enable = false; + gnome.enable = false; + }; + common.ssh-server.enable = true; + common.containers.openMetricsPort = true; + common.hardware = { + nvidia.enable = true; + amdgpu.enable = true; + udevrules.coraltpu.enable = true; + }; + server.services.ai.enable = true; + }; + networkDrives.enable = true; + }; + + services.displayManager.defaultSession = "gnome"; + services.displayManager.autoLogin = { + enable = true; + user = config.skyg.user.name; + }; + services.displayManager.gdm.autoSuspend = false; + services.displayManager.gdm.autoLogin.delay = 0; + + networking.firewall.enable = false; + users.users.ari.extraGroups = [ "input" ]; + + environment.systemPackages = with pkgs; [ + nvidia-container-toolkit + libnvidia-container + docker + runc + ]; +} diff --git a/hosts/hl-bigbox1/hardware-configuration/boot.nix b/hosts/hl-bigbox1/hardware-configuration/boot.nix new file mode 100644 index 0000000..c43431e --- /dev/null +++ b/hosts/hl-bigbox1/hardware-configuration/boot.nix @@ -0,0 +1,18 @@ +# +# Clanker ! Do not modify this file! +# +{ 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 = [ ]; + + boot.kernel.sysctl."kernel.unprivileged_userns_clone" = 1; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-bigbox1/hardware-configuration/default.nix b/hosts/hl-bigbox1/hardware-configuration/default.nix new file mode 100644 index 0000000..cda6436 --- /dev/null +++ b/hosts/hl-bigbox1/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-bigbox1/hardware-configuration/file-system.nix b/hosts/hl-bigbox1/hardware-configuration/file-system.nix new file mode 100644 index 0000000..20802f6 --- /dev/null +++ b/hosts/hl-bigbox1/hardware-configuration/file-system.nix @@ -0,0 +1,24 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/6302dadf-57b7-4213-a7a5-2ba97f941e49"; + fsType = "ext4"; + }; + fileSystems."/mnt/Data" = { + device = "/dev/disk/by-uuid/b1c83d70-4d81-4d0f-a61a-38a78b943bd8"; + fsType = "ext4"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/BBF9-1744"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + swapDevices = [{ + device = "/var/lib/swapfile"; + size = 32 * 1024; + }]; + zramSwap.enable = true; +} diff --git a/hosts/hl-bigbox1/hardware.nix b/hosts/hl-bigbox1/hardware.nix new file mode 100644 index 0000000..6d9cf8d --- /dev/null +++ b/hosts/hl-bigbox1/hardware.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + services.fwupd.enable = true; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + boot.kernelPackages = pkgs.linuxPackages; + networking.interfaces.enp4s0.wakeOnLan.enable = true; + networking.interfaces.lo.wakeOnLan.enable = true; +} diff --git a/hosts/hl-bigbox1/services/default.nix b/hosts/hl-bigbox1/services/default.nix new file mode 100644 index 0000000..e91fdd6 --- /dev/null +++ b/hosts/hl-bigbox1/services/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./jellyfin.nix + ./portainer.nix + ./timers.nix + ]; +} diff --git a/hosts/hl-bigbox1/services/jellyfin.nix b/hosts/hl-bigbox1/services/jellyfin.nix new file mode 100644 index 0000000..fca1126 --- /dev/null +++ b/hosts/hl-bigbox1/services/jellyfin.nix @@ -0,0 +1,60 @@ +{ config, ... }: +{ + skyg.nixos.common.container-services.jellyfin = { + enable = true; + autoUpdate.enable = true; + services.jellyfin = { + image = "jellyfin/jellyfin"; + deploy.resources.reservations.devices = [ + { + driver = "cdi"; + device_ids = [ "nvidia.com/gpu=all" ]; + capabilities = [ "gpu" ]; + } + ]; + volumes = [ + "/opt/jellyfin:/mnt/apps/jellyfin" + "torrents:/torrents" + "family-videos:/family-videos" + ]; + devices = [ "/dev/dri:/dev/dri" ]; + restart = "always"; + healthcheck = { + test = "curl --fail http://0.0.0.0:8096 || exit 1"; + interval = "60s"; + timeout = "20s"; + start_period = "30s"; + }; + environment = { + JELLYFIN_DATA_DIR = "/mnt/apps/jellyfin/data"; + JELLYFIN_CACHE_DIR = "/mnt/apps/jellyfin/cache"; + JELLYFIN_CONFIG_DIR = "/mnt/apps/jellyfin/config"; + NVIDIA_VISIBLE_DEVICES = "all"; + }; + ports = [ "8096:8096" ]; + }; + volumes = { + torrents = { + driver_opts = { + type = "nfs"; + o = "addr=tnas1.lab.internal,nfsvers=4"; + device = ":/mnt/EightTerra/DownloadedTorrents"; + }; + }; + family-videos = { + driver_opts = { + type = "nfs"; + o = "addr=tnas1.lab.internal,nfsvers=4"; + device = ":/mnt/EightTerra/FamilyStorage/Video"; + }; + }; + jellyfin = { + driver_opts = { + type = "nfs"; + o = "addr=tnas1.lab.internal,nfsvers=4"; + device = ":/mnt/Data/apps/jellyfin"; + }; + }; + }; + }; +} diff --git a/hosts/hl-bigbox1/services/portainer.nix b/hosts/hl-bigbox1/services/portainer.nix new file mode 100644 index 0000000..afb79fa --- /dev/null +++ b/hosts/hl-bigbox1/services/portainer.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + age.secrets.portainer-agent-bigbox1.file = ../secrets/portainer-agent-bigbox1.age; + + skyg.nixos.server.portainer = { + enable = true; + mode = "agent"; + agent.edgeKeySecretName = "portainer-agent-bigbox1"; + }; +} diff --git a/hosts/hl-bigbox1/services/timers.nix b/hosts/hl-bigbox1/services/timers.nix new file mode 100644 index 0000000..8921c86 --- /dev/null +++ b/hosts/hl-bigbox1/services/timers.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + skyg.server.timers.jellyfin-backups = { + OnCalendar = "daily"; + wantedBy = [ "homelab-terra1-Data-apps.mount" ]; + script = '' + set -eu + ${pkgs.rsync}/bin/rsync -avpzP --delete /opt/jellyfin /homelab/terra1/Data/apps/ + ''; + }; +} diff --git a/hosts/hl-bigbox1/systemd.nix b/hosts/hl-bigbox1/systemd.nix new file mode 100644 index 0000000..c31dbe6 --- /dev/null +++ b/hosts/hl-bigbox1/systemd.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.tmp.useTmpfs = true; + + systemd.services."getty@tty1".enable = false; + systemd.services."autovt@tty1".enable = false; + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; +} diff --git a/hosts/hl-bigbox2.nix b/hosts/hl-bigbox2.nix deleted file mode 100644 index a71dbc1..0000000 --- a/hosts/hl-bigbox2.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ config, lib, pkgs, ... }: -let - ports = { - nixServe = 5000; - lockdPort = 4001; - mountdPort = 4002; - statdPort = 4000; - }; - openPorts = builtins.attrValues ports; -in -{ - # BIOS GRUB must land on the MBR Kingston disk that holds /boot. - # hardware-config still says /dev/sda (GPT home disk) which cannot embed GRUB. - boot.loader.grub.device = lib.mkForce "/dev/disk/by-id/ata-KINGSTON_SA400S37240G_50026B7785904215"; - # Longer retention than the fleet default: bigbox2 is the shared cache store. - programs.nh.clean.extraArgs = "--keep-since 30d --keep 5"; - skyg = { - user.enable = true; - nixos.common = { - ssh-server.enable = true; - containers.openMetricsPort = true; - }; - server.exporters.enable = true; - networkDrives = { - enable = true; - bigBox2.enable = false; - }; - }; - # Nix binary cache server (bigbox2 is the cache store for all builds) - services.nix-serve = { - enable = true; - secretKeyFile = "/home/ari/cache-keys/cache-priv-key.pem"; - port = ports.nixServe; - }; - # bigbox2 is the cache itself — don't push builds back to itself. - skyg.nixos.common.cachePush.enable = false; - # firmware updater - services.fwupd.enable = true; - skyg.nixos.common.networking.nfsServer.enable = true; - services.nfs.server = { - lockdPort = ports.lockdPort; - mountdPort = ports.mountdPort; - statdPort = ports.statdPort; - extraNfsdConfig = ''''; - exports = '' - /data/fourTerra 10.0.0.0/16(rw,wdelay,insecure,no_root_squash,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash) - ''; - }; - networking.firewall.allowedUDPPorts = openPorts; - networking.firewall.allowedTCPPorts = openPorts; -} diff --git a/hosts/hl-bigbox2/default.nix b/hosts/hl-bigbox2/default.nix new file mode 100644 index 0000000..a120950 --- /dev/null +++ b/hosts/hl-bigbox2/default.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: +let + ports = { + nixServe = 5000; + lockdPort = 4001; + mountdPort = 4002; + statdPort = 4000; + }; + openPorts = builtins.attrValues ports; +in +{ + imports = [ + ./services.nix + ./hardware-configuration + ./hardware.nix + ]; + + boot.loader.grub.device = lib.mkForce "/dev/disk/by-id/ata-KINGSTON_SA400S37240G_50026B7785904215"; + programs.nh.clean.extraArgs = "--keep-since 30d --keep 5"; + + skyg = { + user.enable = true; + nixos.common = { + ssh-server.enable = true; + containers.openMetricsPort = true; + }; + server.exporters.enable = true; + networkDrives = { + enable = true; + bigBox2.enable = false; + }; + }; + + skyg.nixos.common.cachePush.enable = false; +} diff --git a/hosts/hl-bigbox2/hardware-configuration/boot.nix b/hosts/hl-bigbox2/hardware-configuration/boot.nix new file mode 100644 index 0000000..6840869 --- /dev/null +++ b/hosts/hl-bigbox2/hardware-configuration/boot.nix @@ -0,0 +1,20 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "xhci_pci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + boot.loader.grub = { + enable = true; + device = "/dev/sda"; + efiSupport = false; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-bigbox2/hardware-configuration/default.nix b/hosts/hl-bigbox2/hardware-configuration/default.nix new file mode 100644 index 0000000..cda6436 --- /dev/null +++ b/hosts/hl-bigbox2/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-bigbox2/hardware-configuration/file-system.nix b/hosts/hl-bigbox2/hardware-configuration/file-system.nix new file mode 100644 index 0000000..4b3884d --- /dev/null +++ b/hosts/hl-bigbox2/hardware-configuration/file-system.nix @@ -0,0 +1,36 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/5bf4a352-412f-47e1-9455-68f3aa629722"; + fsType = "btrfs"; + options = [ "subvol=@root" "compress=zstd" "noatime" ]; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/ccc80fd2-b38b-412b-9988-12a3194a5b57"; + fsType = "ext4"; + }; + fileSystems."/var" = { + device = "/dev/disk/by-uuid/5bf4a352-412f-47e1-9455-68f3aa629722"; + fsType = "btrfs"; + options = [ "compress=zstd" "subvol=@var" "noatime" ]; + }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/8cd6e560-4db9-4cf1-8048-27a7c6308965"; + fsType = "btrfs"; + options = [ "compress=zstd" "subvol=@nix" "noatime" ]; + }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/6f4b2adc-5818-41ea-a4ba-720fb96b8f98"; + fsType = "btrfs"; + options = [ "compress=zstd" "subvol=@home" "noatime" ]; + }; + fileSystems."/data/fourTerra" = { + device = "/dev/sde1"; + fsType = "btrfs"; + options = [ "compress=zstd" "subvol=@data" "noatime" ]; + }; + swapDevices = [ ]; +} diff --git a/hosts/hl-bigbox2/hardware.nix b/hosts/hl-bigbox2/hardware.nix new file mode 100644 index 0000000..209318a --- /dev/null +++ b/hosts/hl-bigbox2/hardware.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.fwupd.enable = true; +} diff --git a/hosts/hl-bigbox2/services.nix b/hosts/hl-bigbox2/services.nix new file mode 100644 index 0000000..2a22629 --- /dev/null +++ b/hosts/hl-bigbox2/services.nix @@ -0,0 +1,31 @@ +{ ... }: +let + ports = { + nixServe = 5000; + lockdPort = 4001; + mountdPort = 4002; + statdPort = 4000; + }; + openPorts = builtins.attrValues ports; +in +{ + services.nix-serve = { + enable = true; + secretKeyFile = "/home/ari/cache-keys/cache-priv-key.pem"; + port = ports.nixServe; + }; + + skyg.nixos.common.networking.nfsServer.enable = true; + services.nfs.server = { + lockdPort = ports.lockdPort; + mountdPort = ports.mountdPort; + statdPort = ports.statdPort; + extraNfsdConfig = ''''; + exports = '' + /data/fourTerra 10.0.0.0/16(rw,wdelay,insecure,no_root_squash,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash) + ''; + }; + + networking.firewall.allowedUDPPorts = openPorts; + networking.firewall.allowedTCPPorts = openPorts; +} diff --git a/hosts/hl-fwdesk.nix b/hosts/hl-fwdesk.nix deleted file mode 100644 index d9a9373..0000000 --- a/hosts/hl-fwdesk.nix +++ /dev/null @@ -1,312 +0,0 @@ -{ pkgs -, unstablePkgs -, myPkgs -, my-nixpkgs -, ... -}: -let - ports = { - tabby = 11029; - ollama = 11434; - piper = 10200; - fastWhisper = 10300; - wyoming = 10400; - comfyui = 8188; - libretranslate = 5000; - ds4 = 8000; - colibri = 8001; - hermes = 8642; - hermesDashboard = 9119; - hermesCache = 5001; - vnc = 5930; - }; - openPorts = [ - ports.ollama - ports.tabby - ports.fastWhisper - ports.piper - ports.wyoming - ports.comfyui - ports.libretranslate - ports.ds4 - ports.vnc - ]; -in -{ - imports = [ - ./hl-fwdesk.hardware-configuration.nix - "${my-nixpkgs}/nixos/modules/services/misc/ds4.nix" - ]; - # Skyg - environment.sessionVariables.ELECTRON_OZONE_PLATFORM_HINT = "wayland"; - skyg = { - user.enable = true; - core.qemu.enable = true; - nixos = { - common.ssh-server.enable = true; - common.cachePush.enable = true; - common.hardware = { - pipewire.enable = true; - amdgpu.enable = true; - }; - desktop = { - enable = true; - tiler = { - enable = true; - noctalia = { - enable = true; - }; - hyprland = { - enable = true; - tools.enable = true; - configLink = { - enable = true; - mountAsSource = true; - }; - }; - }; - }; - server.services.comfyui = { - enable = true; - mode = "rocm"; - port = ports.comfyui; - rocm = { - dataDir = "/data/comfyui"; - }; - }; - server.services.colibri = { - enable = false; - package = pkgs.colibri-rocm; - model = "/var/lib/colibri/glm52_i4"; - host = "0.0.0.0"; - port = ports.colibri; - autoStart = false; - openFirewall = true; - }; - }; - networkDrives = { - enable = true; - }; - }; - # DwarfStar (antirez/ds4) inference server — services.ds4 module from - # asosnovsky/nixpkgs (ds4-init fork branch); package is the fork's ROCm - # build for Strix Halo (gfx1151), see flake.nix: - services.ds4 = { - enable = true; - # Strix Halo == gfx1151. Pin explicitly: the fork package's auto-detected - package = (myPkgs.ds4-rocm.override { rocmArch = "gfx1151"; }); - - user = "ari"; - group = "users"; - model = "/var/lib/ds4/ds4flash.gguf"; - host = "0.0.0.0"; - port = ports.ds4; - ctx = 100000; - kvDiskDir = "/var/lib/ds4/kv"; - kvDiskSpaceMb = 8192; - cors = true; - environment = { - HSA_ENABLE_SDMA = "0"; - }; - openFirewall = true; - autoStart = false; - # Not a services.ds4 option in the fork module yet; pass the flag through. - extraArgs = [ "--kv-cache-reject-different-quant" ]; - extraServiceConfig = { - TimeoutStopSec = "300"; - }; - }; - users.users.ari.extraGroups = [ - "input" - "wheel" - "tty" - "dialout" - "uucp" - "render" - "video" - "docker" - ]; - # Boot - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - # QEMU emulation for building aarch64 (e.g. hl-pi1) as a remote build machine - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - # Tailscale - services.tailscale.enable = true; - # Desktop Env - DankGreeter - programs.dms-greeter = { - enable = true; - compositor.name = "hyprland"; - configHome = "/home/ari"; - }; - # Boot straight into the Hyprland desktop as ari, no password (Steam Big Picture auto-starts) - services.displayManager.defaultSession = "hyprland"; - services.displayManager.autoLogin = { - enable = true; - user = "ari"; - }; - # Firmware updater - services.fwupd.enable = true; - # Bluetooth - skyg.nixos.common.hardware.bluetooth.enable = true; - # Bootloader. - environment.systemPackages = - (with pkgs; [ - # languages - # cargo - rustc - go - pipx - uv - - # development - zed-editor-fhs - nix-prefetch - herdr - - # Steam - mangohud - - # LLM Stuff - unstablePkgs.ollama-rocm - unstablePkgs.grok-build - unstablePkgs.goose-cli - # stable-diffusion-cpp-rocm - lmstudio - # Hermes gateway - Signal bridge (used to link the device + run the daemon) - signal-cli - - # bluetooth - blueman - - ]) - ++ [ myPkgs.ds4-rocm ]; - services.usbmuxd.enable = true; - # Steam - programs.steam = { - enable = true; - extest.enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = true; - }; - boot.kernelPackages = pkgs.linuxPackages; # (this is the default) some amdgpu issues on 6.10 - # Strix Halo GTT memory tuning so the full 128 GB unified memory is GPU-visible - # (required by ds4-rocm / large models per upstream STRIXHALO.md). - boot.kernelParams = [ - "amd_iommu=off" - "amdgpu.gttsize=126976" - "ttm.pages_limit=32505856" - "ttm.page_pool_size=32505856" - ]; - programs = { - gamescope = { - enable = true; - capSysNice = true; - }; - }; - hardware.xone.enable = true; # support for the xbox controller USB dongle - # Ollama - services.open-webui.enable = true; - users.users.ollama = { - enable = true; - home = "/var/lib/ollama"; - extraGroups = [ - "render" - "video" - ]; - }; - services.ollama = { - enable = true; - host = "0.0.0.0"; - port = ports.ollama; - package = unstablePkgs.ollama-rocm; - user = "ollama"; - home = "/var/lib/ollama"; - environmentVariables = { - HSA_ENABLE_SDMA = "0"; - OLLAMA_FLASH_ATTENTION = "1"; - OLLAMA_KV_CACHE_TYPE = "q8_0"; - OLLAMA_KEEP_ALIVE = "24h"; - }; - }; - # Libretranslate - services.libretranslate = { - enable = true; - host = "0.0.0.0"; - port = ports.libretranslate; - threads = 10; - }; - systemd.services.libretranslate.environment.ARGOS_DEVICE_TYPE = "cpu"; - - # Hermes Agent — hardened, self-managing NixOS VM - services.hermenix = { - enable = true; - disk.baseDir = "/var/lib/hermes-vm"; - disk.stateSize = "60G"; - network = { - bridged = false; - externalInterface = "enp191s0"; - lanAddress = "10.0.101.101"; # the guest's fixed LAN IP - hostLanAddress = "10.0.10.11"; # this host's current LAN IP (pick up the router reservation) - lanGateway = "10.0.0.1"; - }; - vcpu = 3; - mem = 5000; - hermesHome = "/var/lib/hermes/.hermes"; - hostCache.port = ports.hermesCache; - hostAccess = [ - { port = ports.ollama; } - { port = ports.ds4; } - ]; - lanAccess = [ - { address = "10.0.12.1"; port = 80; } # Home Assistant - # *.app.internal apps on the macvlan lab subnet (drawdb, audiobooks, ...) - { address = "10.0.101.0/24"; port = 80; } - { address = "10.0.101.0/24"; port = 443; } - # Buzz relay — its own IP, not the whole subnet - { address = "10.0.101.3"; port = 3000; } # relay - { address = "10.0.101.3"; port = 8080; } # health - { address = "10.0.101.3"; port = 9102; } # metrics - # Gitea - { address = "10.0.10.6"; port = 3000; } - ]; - publish = [ - { hostPort = ports.hermes; guestPort = 8642; } - { hostPort = ports.hermesDashboard; guestPort = 9119; } - ]; - }; - hardware.enableAllFirmware = true; - hardware.amdgpu = { - opencl.enable = true; - }; - skyg.nixos.common.nh.flake = "/home/ari/nixos-setup"; - networking.firewall.allowedUDPPorts = openPorts; - networking.firewall.allowedTCPPorts = openPorts; - services.wyoming = { - openwakeword = { - enable = true; - uri = "tcp://0.0.0.0:${toString ports.wyoming}"; - }; - piper.servers.peta = { - enable = true; - uri = "tcp://0.0.0.0:${toString ports.piper}"; - voice = "en_US-danny-low"; - }; - faster-whisper.servers.todd = { - enable = true; - uri = "tcp://0.0.0.0:${toString ports.fastWhisper}"; - model = "tiny.en"; - language = "en"; - device = "auto"; - }; - }; - virtualisation.docker = { - enable = true; - daemon.settings = { - "default-runtime" = "runc"; - }; - }; - services.flatpak.enable = true; -} diff --git a/hosts/hl-fwdesk/default.nix b/hosts/hl-fwdesk/default.nix new file mode 100644 index 0000000..e437f87 --- /dev/null +++ b/hosts/hl-fwdesk/default.nix @@ -0,0 +1,123 @@ +{ pkgs, unstablePkgs, myPkgs, my-nixpkgs, ... }: +let + ports = { + tabby = 11029; + ollama = 11434; + piper = 10200; + fastWhisper = 10300; + wyoming = 10400; + comfyui = 8188; + libretranslate = 5000; + ds4 = 8000; + colibri = 8001; + hermes = 8642; + hermesDashboard = 9119; + hermesCache = 5001; + vnc = 5930; + }; + openPorts = [ + ports.ollama + ports.tabby + ports.fastWhisper + ports.piper + ports.wyoming + ports.comfyui + ports.libretranslate + ports.ds4 + ports.vnc + ]; +in +{ + imports = [ + ./packages.nix + ./services + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ./networking.nix + "${my-nixpkgs}/nixos/modules/services/misc/ds4.nix" + ]; + + environment.sessionVariables.ELECTRON_OZONE_PLATFORM_HINT = "wayland"; + + skyg = { + user.enable = true; + core.qemu.enable = true; + nixos = { + common.ssh-server.enable = true; + common.cachePush.enable = true; + common.hardware = { + pipewire.enable = true; + amdgpu.enable = true; + }; + desktop = { + enable = true; + tiler = { + enable = true; + noctalia.enable = true; + hyprland = { + enable = true; + tools.enable = true; + configLink = { + enable = true; + mountAsSource = true; + }; + }; + }; + }; + server.services.comfyui = { + enable = true; + mode = "rocm"; + port = ports.comfyui; + rocm.dataDir = "/data/comfyui"; + }; + server.services.colibri = { + enable = false; + package = pkgs.colibri-rocm; + model = "/var/lib/colibri/glm52_i4"; + host = "0.0.0.0"; + port = ports.colibri; + autoStart = false; + openFirewall = true; + }; + }; + networkDrives.enable = true; + }; + + users.users.ari.extraGroups = [ + "input" + "wheel" + "tty" + "dialout" + "uucp" + "render" + "video" + "docker" + ]; + + programs.dms-greeter = { + enable = true; + compositor.name = "hyprland"; + configHome = "/home/ari"; + }; + services.displayManager.defaultSession = "hyprland"; + services.displayManager.autoLogin = { + enable = true; + user = "ari"; + }; + + services.fwupd.enable = true; + skyg.nixos.common.hardware.bluetooth.enable = true; + + services.usbmuxd.enable = true; + + virtualisation.docker = { + enable = true; + daemon.settings."default-runtime" = "runc"; + }; + services.flatpak.enable = true; + + skyg.nixos.common.nh.flake = "/home/ari/nixos-setup"; + networking.firewall.allowedUDPPorts = openPorts; + networking.firewall.allowedTCPPorts = openPorts; +} diff --git a/hosts/hl-fwdesk/hardware-configuration/boot.nix b/hosts/hl-fwdesk/hardware-configuration/boot.nix new file mode 100644 index 0000000..dc2b5dc --- /dev/null +++ b/hosts/hl-fwdesk/hardware-configuration/boot.nix @@ -0,0 +1,16 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-fwdesk/hardware-configuration/default.nix b/hosts/hl-fwdesk/hardware-configuration/default.nix new file mode 100644 index 0000000..cda6436 --- /dev/null +++ b/hosts/hl-fwdesk/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-fwdesk/hardware-configuration/file-system.nix b/hosts/hl-fwdesk/hardware-configuration/file-system.nix new file mode 100644 index 0000000..d01caab --- /dev/null +++ b/hosts/hl-fwdesk/hardware-configuration/file-system.nix @@ -0,0 +1,32 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/e903eb56-160d-4b77-ba66-ef54a18207f2"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/e903eb56-160d-4b77-ba66-ef54a18207f2"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/e903eb56-160d-4b77-ba66-ef54a18207f2"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1D9A-20EC"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + fileSystems."/data" = { + device = "/dev/disk/by-uuid/f241ec6e-939c-4f10-bc72-3094b99de4eb"; + fsType = "btrfs"; + options = [ "subvol=data" ]; + }; + swapDevices = [ ]; +} diff --git a/hosts/hl-fwdesk/hardware.nix b/hosts/hl-fwdesk/hardware.nix new file mode 100644 index 0000000..b73c5c1 --- /dev/null +++ b/hosts/hl-fwdesk/hardware.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + boot.kernelPackages = pkgs.linuxPackages; + boot.kernelParams = [ + "amd_iommu=off" + "amdgpu.gttsize=126976" + "ttm.pages_limit=32505856" + "ttm.page_pool_size=32505856" + ]; + hardware.enableAllFirmware = true; + hardware.amdgpu.opencl.enable = true; + + services.fwupd.enable = true; + skyg.nixos.common.hardware.bluetooth.enable = true; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; +} diff --git a/hosts/hl-fwdesk/networking.nix b/hosts/hl-fwdesk/networking.nix new file mode 100644 index 0000000..2cd96b3 --- /dev/null +++ b/hosts/hl-fwdesk/networking.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.tailscale.enable = true; +} diff --git a/hosts/hl-fwdesk/packages.nix b/hosts/hl-fwdesk/packages.nix new file mode 100644 index 0000000..81b50fa --- /dev/null +++ b/hosts/hl-fwdesk/packages.nix @@ -0,0 +1,21 @@ +{ pkgs, unstablePkgs, myPkgs, ... }: +{ + environment.systemPackages = + (with pkgs; [ + rustc + go + pipx + uv + zed-editor-fhs + nix-prefetch + herdr + mangohud + unstablePkgs.ollama-rocm + unstablePkgs.grok-build + unstablePkgs.goose-cli + lmstudio + signal-cli + blueman + ]) + ++ [ myPkgs.ds4-rocm ]; +} diff --git a/hosts/hl-fwdesk/services/default.nix b/hosts/hl-fwdesk/services/default.nix new file mode 100644 index 0000000..1f44b4b --- /dev/null +++ b/hosts/hl-fwdesk/services/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./ds4.nix + ./ollama.nix + ./libretranslate.nix + ./hermenix.nix + ./wyoming.nix + ./steam.nix + ]; +} diff --git a/hosts/hl-fwdesk/services/ds4.nix b/hosts/hl-fwdesk/services/ds4.nix new file mode 100644 index 0000000..5bc5d9a --- /dev/null +++ b/hosts/hl-fwdesk/services/ds4.nix @@ -0,0 +1,24 @@ +{ myPkgs, ... }: +let + ports = { ds4 = 8000; }; +in +{ + services.ds4 = { + enable = true; + package = (myPkgs.ds4-rocm.override { rocmArch = "gfx1151"; }); + user = "ari"; + group = "users"; + model = "/var/lib/ds4/ds4flash.gguf"; + host = "0.0.0.0"; + port = ports.ds4; + ctx = 100000; + kvDiskDir = "/var/lib/ds4/kv"; + kvDiskSpaceMb = 8192; + cors = true; + environment.HSA_ENABLE_SDMA = "0"; + openFirewall = true; + autoStart = false; + extraArgs = [ "--kv-cache-reject-different-quant" ]; + extraServiceConfig.TimeoutStopSec = "300"; + }; +} diff --git a/hosts/hl-fwdesk/services/hermenix.nix b/hosts/hl-fwdesk/services/hermenix.nix new file mode 100644 index 0000000..6af9e9a --- /dev/null +++ b/hosts/hl-fwdesk/services/hermenix.nix @@ -0,0 +1,45 @@ +{ ... }: +let + ports = { + hermes = 8642; + hermesDashboard = 9119; + hermesCache = 5001; + ollama = 11434; + ds4 = 8000; + }; +in +{ + services.hermenix = { + enable = true; + disk.baseDir = "/var/lib/hermes-vm"; + disk.stateSize = "60G"; + network = { + bridged = false; + externalInterface = "enp191s0"; + lanAddress = "10.0.101.101"; + hostLanAddress = "10.0.10.11"; + lanGateway = "10.0.0.1"; + }; + vcpu = 3; + mem = 5000; + hermesHome = "/var/lib/hermes/.hermes"; + hostCache.port = ports.hermesCache; + hostAccess = [ + { port = ports.ollama; } + { port = ports.ds4; } + ]; + lanAccess = [ + { address = "10.0.12.1"; port = 80; } + { address = "10.0.101.0/24"; port = 80; } + { address = "10.0.101.0/24"; port = 443; } + { address = "10.0.101.3"; port = 3000; } + { address = "10.0.101.3"; port = 8080; } + { address = "10.0.101.3"; port = 9102; } + { address = "10.0.10.6"; port = 3000; } + ]; + publish = [ + { hostPort = ports.hermes; guestPort = 8642; } + { hostPort = ports.hermesDashboard; guestPort = 9119; } + ]; + }; +} diff --git a/hosts/hl-fwdesk/services/libretranslate.nix b/hosts/hl-fwdesk/services/libretranslate.nix new file mode 100644 index 0000000..c0d103b --- /dev/null +++ b/hosts/hl-fwdesk/services/libretranslate.nix @@ -0,0 +1,13 @@ +{ ... }: +let + ports = { libretranslate = 5000; }; +in +{ + services.libretranslate = { + enable = true; + host = "0.0.0.0"; + port = ports.libretranslate; + threads = 10; + }; + systemd.services.libretranslate.environment.ARGOS_DEVICE_TYPE = "cpu"; +} diff --git a/hosts/hl-fwdesk/services/ollama.nix b/hosts/hl-fwdesk/services/ollama.nix new file mode 100644 index 0000000..f92b0f5 --- /dev/null +++ b/hosts/hl-fwdesk/services/ollama.nix @@ -0,0 +1,27 @@ +{ unstablePkgs, ... }: +let + ports = { ollama = 11434; }; +in +{ + services.open-webui.enable = true; + + users.users.ollama = { + enable = true; + home = "/var/lib/ollama"; + extraGroups = [ "render" "video" ]; + }; + services.ollama = { + enable = true; + host = "0.0.0.0"; + port = ports.ollama; + package = unstablePkgs.ollama-rocm; + user = "ollama"; + home = "/var/lib/ollama"; + environmentVariables = { + HSA_ENABLE_SDMA = "0"; + OLLAMA_FLASH_ATTENTION = "1"; + OLLAMA_KV_CACHE_TYPE = "q8_0"; + OLLAMA_KEEP_ALIVE = "24h"; + }; + }; +} diff --git a/hosts/hl-fwdesk/services/steam.nix b/hosts/hl-fwdesk/services/steam.nix new file mode 100644 index 0000000..111e11d --- /dev/null +++ b/hosts/hl-fwdesk/services/steam.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + programs.steam = { + enable = true; + extest.enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; + }; + programs.gamescope = { + enable = true; + capSysNice = true; + }; + hardware.xone.enable = true; +} diff --git a/hosts/hl-fwdesk/services/wyoming.nix b/hosts/hl-fwdesk/services/wyoming.nix new file mode 100644 index 0000000..077851d --- /dev/null +++ b/hosts/hl-fwdesk/services/wyoming.nix @@ -0,0 +1,28 @@ +{ ... }: +let + ports = { + wyoming = 10400; + piper = 10200; + fastWhisper = 10300; + }; +in +{ + services.wyoming = { + openwakeword = { + enable = true; + uri = "tcp://0.0.0.0:${toString ports.wyoming}"; + }; + piper.servers.peta = { + enable = true; + uri = "tcp://0.0.0.0:${toString ports.piper}"; + voice = "en_US-danny-low"; + }; + faster-whisper.servers.todd = { + enable = true; + uri = "tcp://0.0.0.0:${toString ports.fastWhisper}"; + model = "tiny.en"; + language = "en"; + device = "auto"; + }; + }; +} diff --git a/hosts/hl-fwdesk/systemd.nix b/hosts/hl-fwdesk/systemd.nix new file mode 100644 index 0000000..0057ccf --- /dev/null +++ b/hosts/hl-fwdesk/systemd.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/hl-fws1.nix b/hosts/hl-fws1.nix deleted file mode 100644 index 2c42aad..0000000 --- a/hosts/hl-fws1.nix +++ /dev/null @@ -1,127 +0,0 @@ -{ pkgs, config, ... }: -{ - skyg = { - user.enable = true; - nixos = { - common.ssh-server.enable = true; - common.hardware = { - pipewire.enable = true; - }; - desktop = { - enable = true; - tiler = { - enable = true; - hyprland.enable = true; - hyprland.configLink = { - enable = true; - mountAsSource = true; - }; - quickshell = { - enable = true; - }; - }; - }; - }; - }; - - # dms - programs.dank-material-shell = { - enable = true; - systemd = { - enable = true; - restartIfChanged = true; - }; - }; - # firmware updater - services.fwupd.enable = true; - hardware.framework.enableKmod = true; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.tmp.useTmpfs = true; - - # Greeter - programs.dms-greeter = { - enable = true; - compositor.name = "hyprland"; - configHome = "/home/${config.skyg.user.name}"; - }; - services.displayManager.autoLogin = { - enable = true; - user = config.skyg.user.name; - }; - services.displayManager.defaultSession = "hyprland"; - - # environment - environment.systemPackages = with pkgs; [ - # my goodies - skygqts - # hdmi cec - v4l-utils - libcec - # sound control - playerctl - ]; - - # Flatpaks - services.flatpak.enable = true; - services.flatpak.packages = [ - "com.spotify.Client" - ]; - - # Chromium Configuration - programs.chromium.enable = true; - programs.chromium.extraOpts = { - "DeveloperToolsAvailability" = 2; - }; - - services.pipewire = { - extraConfig.pipewire-pulse."10-raop-discover" = { - context.modules = [ - { name = "libpipewire-module-raop-discover"; } - ]; - }; - wireplumber.extraConfig."51-hdmi-tv" = { - # Stop remembering the analog profile between boots — always prefer HDMI. - "wireplumber.settings" = { - "device.restore-profile" = false; - "device.restore-routes" = false; - }; - # ACP ranks analog-stereo (6565) above hdmi-stereo (5900) by default; - # override that so the LG TV (hdmi-output-0, confirmed via ELD) wins. - "device.profile.priority.rules" = [ - { - matches = [{ "device.name" = "alsa_card.pci-0000_00_1f.3"; }]; - actions.update-props.priorities = [ "output:hdmi-stereo" ]; - } - ]; - # Make the resulting HDMI sink win the default-sink vote too. - "monitor.alsa.rules" = [ - { - matches = [{ "node.name" = "~alsa_output.*hdmi.*"; }]; - actions.update-props."priority.session" = 2000; - } - ]; - }; - }; - security.rtkit.enable = true; - - # Let the logged-in session (not just root) open the CEC device, so - # Hyprland can drive the TV without sudo. - services.udev.extraRules = '' - SUBSYSTEM=="cec", MODE="0664", TAG+="uaccess" - ''; - - # Disable auto-suspend/hibernate — always-on TV box - systemd.targets.sleep.enable = false; - systemd.targets.suspend.enable = false; - systemd.targets.hibernate.enable = false; - systemd.targets.hybrid-sleep.enable = false; - - # AirPlay receiver - services.shairport-sync = { - enable = true; - arguments = "-o pipewire"; - }; -} diff --git a/hosts/hl-fws1/default.nix b/hosts/hl-fws1/default.nix new file mode 100644 index 0000000..ad824fe --- /dev/null +++ b/hosts/hl-fws1/default.nix @@ -0,0 +1,65 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./services.nix + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ]; + + skyg = { + user.enable = true; + nixos = { + common.ssh-server.enable = true; + common.hardware.pipewire.enable = true; + desktop = { + enable = true; + tiler = { + enable = true; + hyprland.enable = true; + hyprland.configLink = { + enable = true; + mountAsSource = true; + }; + quickshell.enable = true; + }; + }; + }; + }; + + programs.dank-material-shell = { + enable = true; + systemd = { + enable = true; + restartIfChanged = true; + }; + }; + + programs.dms-greeter = { + enable = true; + compositor.name = "hyprland"; + configHome = "/home/${config.skyg.user.name}"; + }; + services.displayManager.autoLogin = { + enable = true; + user = config.skyg.user.name; + }; + services.displayManager.defaultSession = "hyprland"; + + environment.systemPackages = with pkgs; [ + skygqts + v4l-utils + libcec + playerctl + ]; + + services.flatpak.enable = true; + services.flatpak.packages = [ "com.spotify.Client" ]; + + programs.chromium.enable = true; + programs.chromium.extraOpts.DeveloperToolsAvailability = 2; + + services.udev.extraRules = '' + SUBSYSTEM=="cec", MODE="0664", TAG+="uaccess" + ''; +} diff --git a/hosts/hl-fws1/hardware-configuration/boot.nix b/hosts/hl-fws1/hardware-configuration/boot.nix new file mode 100644 index 0000000..8beafc9 --- /dev/null +++ b/hosts/hl-fws1/hardware-configuration/boot.nix @@ -0,0 +1,14 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-fws1/hardware-configuration/default.nix b/hosts/hl-fws1/hardware-configuration/default.nix new file mode 100644 index 0000000..83de979 --- /dev/null +++ b/hosts/hl-fws1/hardware-configuration/default.nix @@ -0,0 +1,9 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ]; +} diff --git a/hosts/hl-fws1/hardware.nix b/hosts/hl-fws1/hardware.nix new file mode 100644 index 0000000..c8537a9 --- /dev/null +++ b/hosts/hl-fws1/hardware.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + services.fwupd.enable = true; + hardware.framework.enableKmod = true; +} diff --git a/hosts/hl-fws1/services.nix b/hosts/hl-fws1/services.nix new file mode 100644 index 0000000..f37b701 --- /dev/null +++ b/hosts/hl-fws1/services.nix @@ -0,0 +1,34 @@ +{ ... }: +{ + services.pipewire = { + extraConfig.pipewire-pulse."10-raop-discover" = { + context.modules = [ + { name = "libpipewire-module-raop-discover"; } + ]; + }; + wireplumber.extraConfig."51-hdmi-tv" = { + "wireplumber.settings" = { + "device.restore-profile" = false; + "device.restore-routes" = false; + }; + "device.profile.priority.rules" = [ + { + matches = [{ "device.name" = "alsa_card.pci-0000_00_1f.3"; }]; + actions.update-props.priorities = [ "output:hdmi-stereo" ]; + } + ]; + "monitor.alsa.rules" = [ + { + matches = [{ "node.name" = "~alsa_output.*hdmi.*"; }]; + actions.update-props."priority.session" = 2000; + } + ]; + }; + }; + security.rtkit.enable = true; + + services.shairport-sync = { + enable = true; + arguments = "-o pipewire"; + }; +} diff --git a/hosts/hl-fws1/systemd.nix b/hosts/hl-fws1/systemd.nix new file mode 100644 index 0000000..36fd966 --- /dev/null +++ b/hosts/hl-fws1/systemd.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.tmp.useTmpfs = true; + + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; +} diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1/containers.nix similarity index 51% rename from hosts/hl-minipc1.nix rename to hosts/hl-minipc1/containers.nix index 15646a2..5f9ba3d 100644 --- a/hosts/hl-minipc1.nix +++ b/hosts/hl-minipc1/containers.nix @@ -1,29 +1,12 @@ { config, pkgs, ... }: let - ports = { - nixServe = 5000; - dockerRegistry = 5001; - postgresIU = 7491; - ssh = 22; - iu = 1947; + nfsVolume = exportPath: { + driver_opts = { + type = "nfs"; + o = "addr=tnas1.lab.internal,rw,nfsvers=4.0,nolock,hard,noatime"; + device = ":${exportPath}"; + }; }; - gitea = { - user = "gitea"; - group = "gitea"; - stateDir = "/var/lib/sosnovsky/gitea"; - sshPort = 2222; - httpPort = 3000; - }; - openPorts = [ - ports.nixServe - ports.dockerRegistry - gitea.sshPort - gitea.httpPort - ports.postgresIU - ports.ssh - ports.iu - ]; - # Audiobookshelf stack audiobookshelf = { domain = "audiobooks.app.internal"; ip = "10.0.101.4"; @@ -31,13 +14,10 @@ let image = "ghcr.io/advplyr/audiobookshelf:latest"; dataDir = "/mnt/Data/audiobookshelf"; }; - # Buzz stack buzz = { domain = "buzz.app.internal"; - # Public name with a Let's Encrypt cert (skyg.server.acme) — what clients use. publicDomain = "buzz.home.sosnovsky.ca"; port = 3000; - # Caddy's macvlan IP — buzz.app.internal resolves here; the relay is internal-only. ip = "10.0.101.3"; bucket = "buzz-media"; images = { @@ -49,81 +29,22 @@ let mc = "quay.io/minio/mc:RELEASE.2025-08-13T08-35-41Z@sha256:a7fe349ef4bd8521fb8497f55c6042871b2ae640607cf99d9bede5e9bdf11727"; }; }; - # NFS-backed volume on tnas1 (compose volume with nfs driver_opts). - # Docker's `local` driver calls mount(2) itself, so it cannot resolve a - # `host:/path` device: the server belongs in `o = addr=...` (the daemon - # resolves that name) and `device` must be the bare `:/export/path`. - nfsVolume = exportPath: { - driver_opts = { - type = "nfs"; - o = "addr=tnas1.lab.internal,rw,nfsvers=4.0,nolock,hard,noatime"; - device = ":${exportPath}"; - }; + ports = { + postgresIU = 7491; + iu = 1947; }; - # Buzz management CLI — upstream deploy/compose/run.sh ported to this - # deployment; the logic lives in scripts/hl-minipc1/buzz-manage.sh. - buzz-manage = pkgs.writeShellScriptBin "buzz-manage" '' - export BUZZ_ENV_FILE="${config.age.secrets.buzz-env.path}" - export BUZZ_COMPOSE_BIN="${pkgs.docker-compose}/bin/docker-compose" - ${builtins.readFile ./scripts/hl-minipc1/buzz-manage.sh} - ''; in { - skyg.user.enable = true; - skyg.nixos.common.ssh-server.enable = true; - skyg.server.dns.routing = { - enable = false; - openFirewall = true; - addressesSecretName = "dns-addresses.conf"; - }; - skyg.nixos.common.containers.runtime = "docker"; - skyg.nixos.common.containers.openMetricsPort = true; - - # One shared ipvlan network, created once at boot. - skyg.nixos.common.containers.networks.ipvlanLab = { - enable = true; - parent = "eno1"; - ipRange = "10.0.101.16/28"; - }; - skyg.server.admin.enable = true; - skyg.server.exporters.enable = true; - skyg.nixos.server.k3s.enable = false; - skyg.networkDrives = { - enable = true; - }; - services.tailscale.enable = false; - services.tailscale.disableTaildrop = true; - services.tailscale.useRoutingFeatures = "both"; - services.tailscale.openFirewall = true; - - # # Nix Stores - services.nix-serve = { - enable = true; - secretKeyFile = "/home/ari/cache-keys/minipc1.lab.internal.private"; - port = ports.nixServe; - }; - # firmware updater - services.fwupd.enable = true; - # # Services - # Audiobookshelf — containerised, own macvlan IP, reachable as - # http://audiobooks.app.internal skyg.nixos.common.container-services.audiobookshelf = { enable = true; autoUpdate.enable = true; - networks.lan = config.skyg.nixos.common.containers.networks.ipvlanLab.compose; - - volumes = { - books = nfsVolume "/mnt/EightTerra/DownloadedTorrents/books"; - }; - + volumes.books = nfsVolume "/mnt/EightTerra/DownloadedTorrents/books"; services.audiobookshelf = { image = audiobookshelf.image; networks.lan.ipv4_address = audiobookshelf.ip; dns.names = [ audiobookshelf.domain ]; - environment = { - PORT = toString audiobookshelf.port; - }; + environment.PORT = toString audiobookshelf.port; volumes = [ "${audiobookshelf.dataDir}/config:/config" "${audiobookshelf.dataDir}/metadata:/metadata" @@ -132,170 +53,91 @@ in ]; }; }; - services.dockerRegistry = { - enable = true; - storagePath = "/mnt/Data/docker-registry"; - port = ports.dockerRegistry; - openFirewall = true; - listenAddress = "0.0.0.0"; - enableDelete = true; - }; - services.gitea = { - enable = true; - appName = "Sosnovsky gitea"; - stateDir = gitea.stateDir; - user = gitea.user; - group = gitea.group; - settings = { - server = { - SSH_USER = gitea.user; - DOMAIN = "minipc1.lab.internal"; - HTTP_PORT = gitea.httpPort; - SSH_PORT = gitea.sshPort; - DISABLE_SSH = false; - }; - service = { - DISABLE_REGISTRATION = true; - }; - }; - }; skyg.nixos.common.container-services.iu = { services = { db = { image = "postgres:18"; - ports = [ - "${toString ports.postgresIU}:5432" - ]; - volumes = [ - "/var/lib/iu-postgres:/var/lib/postgresql/data" - ]; + ports = [ "${toString ports.postgresIU}:5432" ]; + volumes = [ "/var/lib/iu-postgres:/var/lib/postgresql/data" ]; environmentFiles = [ config.age.secrets.iu-project.path ]; networks = [ "main" ]; }; iu = { image = "minipc1.lab.internal:5001/iu:2026.07.12-ac2c604"; - ports = [ - "${toString ports.iu}:1947" - ]; - # Explicit command matches the Containerfile ENTRYPOINT + CMD - command = [ - "-config" - "/app/config.toml" - "-mode" - "worker+webapp" - ]; - volumes = [ - ]; - environmentFiles = [ - config.age.secrets.iu-project.path - ]; - networks = [ - "main" - ]; + ports = [ "${toString ports.iu}:1947" ]; + command = [ "-config" "/app/config.toml" "-mode" "worker+webapp" ]; + environmentFiles = [ config.age.secrets.iu-project.path ]; + networks = [ "main" ]; dependsOn = [ "db" ]; - files = { - "/app/config.toml" = '' - [web] - host = "0.0.0.0" - port = 1947 - - [features] - publish_alt_translations = true - enable_favourite_marking = true - - [database] - driver = "postgres" - dsn = "postgres://postgres@db:5432/iu?sslmode=disable" - password_env = "POSTGRES_PASSWORD" - - [worker] - poll_interval_seconds = 1 - job_timeout_seconds = 1200 - - [worker.job.ingest] - enabled = true - interval_seconds = 21600 - - [worker.job.classify_scan] - enabled = true - - [worker.job.classify] - enabled = true - - [worker.queue.translate] - enabled = true - - [worker.queue.rewrite] - enabled = true - - [worker.queue.term_remap] - enabled = true - - [worker.queue.reason_backfill] - enabled = true - - [worker.queue.scan] - enabled = true - interval_seconds = 21600 - - [data-science.ollama] - base_url = "http://fwdesk.lab.internal" - port = 11434 - timeout_seconds = 120 - - [data-science.ollama.models] - rewrite_heb = "aya-expanse" - rewrite_ru = "aya-expanse" - rewrite_en = "aya-expanse" - - [data-science.libretranslate] - endpoint = "http://fwdesk.lab.internal:5000/translate" - timeout_seconds = 120 - - [data-science.classifier] - model_path = "data/classifier.json" - - [data-science.grok_models.models] - rewrite_heb = "grok-4.3" - rewrite_en = "grok-4.3" - rewrite_ru = "grok-4.3" - ''; - }; + files."/app/config.toml" = '' + [web] + host = "0.0.0.0" + port = 1947 + [features] + publish_alt_translations = true + enable_favourite_marking = true + [database] + driver = "postgres" + dsn = "postgres://postgres@db:5432/iu?sslmode=disable" + password_env = "POSTGRES_PASSWORD" + [worker] + poll_interval_seconds = 1 + job_timeout_seconds = 1200 + [worker.job.ingest] + enabled = true + interval_seconds = 21600 + [worker.job.classify_scan] + enabled = true + [worker.job.classify] + enabled = true + [worker.queue.translate] + enabled = true + [worker.queue.rewrite] + enabled = true + [worker.queue.term_remap] + enabled = true + [worker.queue.reason_backfill] + enabled = true + [worker.queue.scan] + enabled = true + interval_seconds = 21600 + [data-science.ollama] + base_url = "http://fwdesk.lab.internal" + port = 11434 + timeout_seconds = 120 + [data-science.ollama.models] + rewrite_heb = "aya-expanse" + rewrite_ru = "aya-expanse" + rewrite_en = "aya-expanse" + [data-science.libretranslate] + endpoint = "http://fwdesk.lab.internal:5000/translate" + timeout_seconds = 120 + [data-science.classifier] + model_path = "data/classifier.json" + [data-science.grok_models.models] + rewrite_heb = "grok-4.3" + rewrite_en = "grok-4.3" + rewrite_ru = "grok-4.3" + ''; }; }; }; - # Buzz — relay + postgres + redis + minio (S3). - age.secrets.buzz-env.file = ../secrets/buzz-env.age; - - age.secrets.cloudflare-dns.file = ../secrets/cloudflare-dns.age; - skyg.server.acme = { - enable = true; - credentialsFile = config.age.secrets.cloudflare-dns.path; - certs."${buzz.publicDomain}" = { - postRun = "${pkgs.docker}/bin/docker restart buzz-caddy-1"; - orderBefore = [ "container-services-buzz" ]; - }; - }; - skyg.nixos.common.container-services.buzz = { enable = true; autoUpdate.enable = true; timeoutStartSec = 600; - networks = { internal = { driver = "bridge"; }; lan = config.skyg.nixos.common.containers.networks.ipvlanLab.compose; }; - volumes = { buzz-postgres = nfsVolume "/mnt/SmallG/buzz/postgres"; buzz-redis = nfsVolume "/mnt/SmallG/buzz/redis"; s3 = nfsVolume "/mnt/SmallG/buzz/s3"; buzz-git = nfsVolume "/mnt/SmallG/buzz/git"; }; - services = { relay = { image = buzz.images.relay; @@ -326,17 +168,13 @@ in }; volumes = [ "buzz-git:/data/git" ]; healthcheck = { - test = [ - "CMD-SHELL" - "bash -ec 'exec 3<>/dev/tcp/127.0.0.1/8080; printf \"GET /_readiness HTTP/1.1\\r\\nHost: 127.0.0.1\\r\\nConnection: close\\r\\n\\r\\n\" >&3; grep -q \"200 OK\" <&3'" - ]; + test = [ "CMD-SHELL" "bash -ec 'exec 3<>/dev/tcp/127.0.0.1/8080; printf \"GET /_readiness HTTP/1.1\\r\\nHost: 127.0.0.1\\r\\nConnection: close\\r\\n\\r\\n\" >&3; grep -q \"200 OK\" <&3'" ]; interval = "10s"; timeout = "3s"; retries = 12; start_period = "30s"; }; }; - caddy = { image = buzz.images.caddy; extraConfig.depends_on.relay.condition = "service_healthy"; @@ -351,20 +189,15 @@ in encode zstd gzip reverse_proxy relay:${toString buzz.port} } - - # Old internal name -> public one (plain :3000 below still serves it). http://${buzz.domain} { redir https://${buzz.publicDomain}{uri} permanent } - :${toString buzz.port} { reverse_proxy relay:${toString buzz.port} } - :8080 { reverse_proxy relay:8080 } - :9102 { reverse_proxy relay:9102 } @@ -374,7 +207,6 @@ in "/var/lib/acme/${buzz.publicDomain}/key.pem:/etc/caddy/tls/key.pem:ro" ]; }; - postgres = { image = buzz.images.posgres; networks = [ "internal" ]; @@ -393,7 +225,6 @@ in start_period = "10s"; }; }; - redis = { image = buzz.images.redis; networks = [ "internal" ]; @@ -406,7 +237,6 @@ in ''; command = [ "sh" "/usr/local/bin/redis-entrypoint.sh" ]; healthcheck = { - # $$ survives compose interpolation so the container shell expands it. test = [ "CMD-SHELL" ''redis-cli -a "$''${REDIS_PASSWORD}" ping | grep -q PONG'' ]; interval = "5s"; timeout = "3s"; @@ -414,7 +244,6 @@ in start_period = "5s"; }; }; - minio = { image = buzz.images.minio; networks = [ "internal" ]; @@ -429,16 +258,11 @@ in start_period = "10s"; }; }; - minio-init = { image = buzz.images.mc; networks = [ "internal" ]; environmentFiles = [ config.age.secrets.buzz-env.path ]; - environment = { - BUZZ_S3_BUCKET = buzz.bucket; - }; - # The image ENTRYPOINT is ["mc"], so the upstream bootstrap sequence is - # shipped as a script and the entrypoint is overridden to run it. + environment.BUZZ_S3_BUCKET = buzz.bucket; files."/usr/local/bin/minio-init.sh" = '' #!/bin/sh set -eu @@ -455,22 +279,6 @@ in }; restart = "no"; }; - }; }; - - # Portainer Edge Agent - age.secrets.portainer-agent-minipc1.file = ../secrets/portainer-agent-minipc1.age; - skyg.nixos.server.portainer = { - enable = true; - mode = "agent"; - agent.edgeKeySecretName = "portainer-agent-minipc1"; - }; - - # Buzz management CLI. - environment.systemPackages = [ buzz-manage ]; - - # Firewall - networking.firewall.allowedUDPPorts = openPorts; - networking.firewall.allowedTCPPorts = openPorts; } diff --git a/hosts/hl-minipc1/default.nix b/hosts/hl-minipc1/default.nix new file mode 100644 index 0000000..30fa0cc --- /dev/null +++ b/hosts/hl-minipc1/default.nix @@ -0,0 +1,65 @@ +{ config, pkgs, ... }: +let + ports = { + nixServe = 5000; + dockerRegistry = 5001; + postgresIU = 7491; + ssh = 22; + iu = 1947; + }; + gitea = { + user = "gitea"; + group = "gitea"; + stateDir = "/var/lib/sosnovsky/gitea"; + sshPort = 2222; + httpPort = 3000; + }; + openPorts = [ + ports.nixServe + ports.dockerRegistry + gitea.sshPort + gitea.httpPort + ports.postgresIU + ports.ssh + ports.iu + ]; + buzz-manage = pkgs.writeShellScriptBin "buzz-manage" '' + export BUZZ_ENV_FILE="${config.age.secrets.buzz-env.path}" + export BUZZ_COMPOSE_BIN="${pkgs.docker-compose}/bin/docker-compose" + ${builtins.readFile ../scripts/hl-minipc1/buzz-manage.sh} + ''; +in +{ + imports = [ + ./containers.nix + ./services + ./hardware-configuration + ./hardware.nix + ]; + + skyg.user.enable = true; + skyg.nixos.common.ssh-server.enable = true; + skyg.server.dns.routing = { + enable = false; + openFirewall = true; + addressesSecretName = "dns-addresses.conf"; + }; + skyg.nixos.common.containers.runtime = "docker"; + skyg.nixos.common.containers.openMetricsPort = true; + skyg.nixos.common.containers.networks.ipvlanLab = { + enable = true; + parent = "eno1"; + ipRange = "10.0.101.16/28"; + }; + skyg.server.admin.enable = true; + skyg.server.exporters.enable = true; + skyg.nixos.server.k3s.enable = false; + skyg.networkDrives.enable = true; + + age.secrets.buzz-env.file = ../secrets/buzz-env.age; + + environment.systemPackages = [ buzz-manage ]; + + networking.firewall.allowedUDPPorts = openPorts; + networking.firewall.allowedTCPPorts = openPorts; +} diff --git a/hosts/hl-minipc1/hardware-configuration/boot.nix b/hosts/hl-minipc1/hardware-configuration/boot.nix new file mode 100644 index 0000000..81b6217 --- /dev/null +++ b/hosts/hl-minipc1/hardware-configuration/boot.nix @@ -0,0 +1,16 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-minipc1/hardware-configuration/default.nix b/hosts/hl-minipc1/hardware-configuration/default.nix new file mode 100644 index 0000000..c9fddf5 --- /dev/null +++ b/hosts/hl-minipc1/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-minipc1/hardware-configuration/file-system.nix b/hosts/hl-minipc1/hardware-configuration/file-system.nix new file mode 100644 index 0000000..9d1f0a7 --- /dev/null +++ b/hosts/hl-minipc1/hardware-configuration/file-system.nix @@ -0,0 +1,23 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/142c88f4-b1bc-4ed9-92ee-2c52cdfa4274"; + fsType = "ext4"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/01FE-EDCC"; + fsType = "vfat"; + }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/ee4a60a8-b0d1-4f5c-a554-1d1d84c89e34"; + fsType = "ext4"; + neededForBoot = true; + options = [ "noatime" ]; + }; + swapDevices = [ ]; +} diff --git a/hosts/hl-minipc1/hardware.nix b/hosts/hl-minipc1/hardware.nix new file mode 100644 index 0000000..209318a --- /dev/null +++ b/hosts/hl-minipc1/hardware.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.fwupd.enable = true; +} diff --git a/hosts/hl-minipc1/services/acme.nix b/hosts/hl-minipc1/services/acme.nix new file mode 100644 index 0000000..679b239 --- /dev/null +++ b/hosts/hl-minipc1/services/acme.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: +{ + age.secrets.cloudflare-dns.file = ../secrets/cloudflare-dns.age; + + skyg.server.acme = { + enable = true; + credentialsFile = config.age.secrets.cloudflare-dns.path; + certs."buzz.home.sosnovsky.ca" = { + postRun = "${pkgs.docker}/bin/docker restart buzz-caddy-1"; + orderBefore = [ "container-services-buzz" ]; + }; + }; +} diff --git a/hosts/hl-minipc1/services/default.nix b/hosts/hl-minipc1/services/default.nix new file mode 100644 index 0000000..3e3765c --- /dev/null +++ b/hosts/hl-minipc1/services/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./tailscale.nix + ./nix-serve.nix + ./docker-registry.nix + ./gitea.nix + ./acme.nix + ./portainer.nix + ]; +} diff --git a/hosts/hl-minipc1/services/docker-registry.nix b/hosts/hl-minipc1/services/docker-registry.nix new file mode 100644 index 0000000..f75c2fc --- /dev/null +++ b/hosts/hl-minipc1/services/docker-registry.nix @@ -0,0 +1,14 @@ +{ ... }: +let + ports = { dockerRegistry = 5001; }; +in +{ + services.dockerRegistry = { + enable = true; + storagePath = "/mnt/Data/docker-registry"; + port = ports.dockerRegistry; + openFirewall = true; + listenAddress = "0.0.0.0"; + enableDelete = true; + }; +} diff --git a/hosts/hl-minipc1/services/gitea.nix b/hosts/hl-minipc1/services/gitea.nix new file mode 100644 index 0000000..f9e9cf9 --- /dev/null +++ b/hosts/hl-minipc1/services/gitea.nix @@ -0,0 +1,29 @@ +{ ... }: +let + gitea = { + user = "gitea"; + group = "gitea"; + stateDir = "/var/lib/sosnovsky/gitea"; + sshPort = 2222; + httpPort = 3000; + }; +in +{ + services.gitea = { + enable = true; + appName = "Sosnovsky gitea"; + stateDir = gitea.stateDir; + user = gitea.user; + group = gitea.group; + settings = { + server = { + SSH_USER = gitea.user; + DOMAIN = "minipc1.lab.internal"; + HTTP_PORT = gitea.httpPort; + SSH_PORT = gitea.sshPort; + DISABLE_SSH = false; + }; + service.DISABLE_REGISTRATION = true; + }; + }; +} diff --git a/hosts/hl-minipc1/services/nix-serve.nix b/hosts/hl-minipc1/services/nix-serve.nix new file mode 100644 index 0000000..03a2457 --- /dev/null +++ b/hosts/hl-minipc1/services/nix-serve.nix @@ -0,0 +1,11 @@ +{ ... }: +let + ports = { nixServe = 5000; }; +in +{ + services.nix-serve = { + enable = true; + secretKeyFile = "/home/ari/cache-keys/minipc1.lab.internal.private"; + port = ports.nixServe; + }; +} diff --git a/hosts/hl-minipc1/services/portainer.nix b/hosts/hl-minipc1/services/portainer.nix new file mode 100644 index 0000000..43e2039 --- /dev/null +++ b/hosts/hl-minipc1/services/portainer.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + age.secrets.portainer-agent-minipc1.file = ../secrets/portainer-agent-minipc1.age; + + skyg.nixos.server.portainer = { + enable = true; + mode = "agent"; + agent.edgeKeySecretName = "portainer-agent-minipc1"; + }; +} diff --git a/hosts/hl-minipc1/services/tailscale.nix b/hosts/hl-minipc1/services/tailscale.nix new file mode 100644 index 0000000..1476326 --- /dev/null +++ b/hosts/hl-minipc1/services/tailscale.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services.tailscale.enable = false; + services.tailscale.disableTaildrop = true; + services.tailscale.useRoutingFeatures = "both"; + services.tailscale.openFirewall = true; +} diff --git a/hosts/hl-minipc2.nix b/hosts/hl-minipc2.nix deleted file mode 100644 index 47bb808..0000000 --- a/hosts/hl-minipc2.nix +++ /dev/null @@ -1,116 +0,0 @@ -{ pkgs, config, ... }: -let - staticIp = ip: { - lan = { - ipv4_address = ip; - }; - }; -in -{ - skyg.user.enable = true; - skyg.nixos.common.ssh-server.enable = true; - skyg.server.dns.routing = { - enable = false; - openFirewall = true; - addressesSecretName = "dns-addresses.conf"; - }; - skyg.nixos.common.containers.networks.ipvlanLab = { - enable = true; - parent = "enp2s0"; - ipRange = "10.0.101.240/28"; - }; - skyg.nixos.common.containers.openMetricsPort = true; - skyg.server.exporters.enable = true; - skyg.networkDrives = { - enable = true; - }; - - # firmware updater - services.fwupd.enable = true; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - # Disable firewall - networking.firewall.enable = false; - - # Scrypted container service group - skyg.nixos.common.container-services.scrypted = { - enable = true; - autoUpdate.enable = true; - services.scrypted = { - image = "ghcr.io/koush/scrypted"; - volumes = [ - "/var/run/dbus:/var/run/dbus" - "/var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket" - "/opt/homelab/scrypted/db:/server/volume" - "scrypted-nvr:/nvr" - ]; - environment.SCRYPTED_NVR_VOLUME = "/nvr"; - network_mode = "host"; - }; - volumes = { - scrypted-nvr = { - driver = "local"; - driver_opts = { - type = "nfs"; - o = "addr=tnas1.lab.internal,rw,nfsvers=4.0,nolock,hard,noatime"; - device = ":/mnt/OneT/NVR"; - }; - }; - }; - }; - - # Drawdb - skyg.nixos.common.container-services.drawdb = { - enable = true; - autoUpdate.enable = true; - services.drawdb = { - image = "ghcr.io/drawdb-io/drawdb:latest"; - environment = { - PORT = "80"; - }; - networks = staticIp "10.0.101.2"; - dns.names = [ "drawdb" ]; - }; - networks.lan = config.skyg.nixos.common.containers.networks.ipvlanLab.compose; - }; - - # Portainer Server - age.secrets.portainer-tls-key.file = ../secrets/portainer-tls-key.age; - skyg.nixos.server.portainer = { - enable = true; - mode = "server"; - server.tls = { - enable = true; - cert = builtins.readFile ../configs/pki/portainer.app.internal.crt; - keySecretName = "portainer-tls-key"; - }; - }; - - age.secrets.stack1.file = ../secrets/stack1.age; - skyg.nixos.common.container-services.stack1 = { - enable = true; - autoUpdate.enable = true; - composeFile = config.age.secrets.stack1.path; - # networks = macvlanNetwork; - }; - age.secrets.stack2.file = ../secrets/stack2.age; - skyg.nixos.common.container-services.stack2 = { - enable = true; - autoUpdate.enable = true; - composeFile = config.age.secrets.stack2.path; - # networks = macvlanNetwork; - }; - - # Scrypted backup timer (image auto-update handled by container-services autoUpdate) - skyg.server.timers = { - scrypted-backups = { - OnCalendar = "daily"; - wantedBy = [ "homelab-terra1-Data-apps.mount" ]; - script = '' - set -eu - ${pkgs.rsync}/bin/rsync -avpzP --delete /opt/homelab/scrypted /homelab/terra1/Data/apps/ - ''; - }; - }; -} diff --git a/hosts/hl-minipc2/default.nix b/hosts/hl-minipc2/default.nix new file mode 100644 index 0000000..865e783 --- /dev/null +++ b/hosts/hl-minipc2/default.nix @@ -0,0 +1,32 @@ +{ pkgs, config, ... }: +let + staticIp = ip: { + lan = { ipv4_address = ip; }; + }; +in +{ + imports = [ + ./services + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ]; + + skyg.user.enable = true; + skyg.nixos.common.ssh-server.enable = true; + skyg.server.dns.routing = { + enable = false; + openFirewall = true; + addressesSecretName = "dns-addresses.conf"; + }; + skyg.nixos.common.containers.networks.ipvlanLab = { + enable = true; + parent = "enp2s0"; + ipRange = "10.0.101.240/28"; + }; + skyg.nixos.common.containers.openMetricsPort = true; + skyg.server.exporters.enable = true; + skyg.networkDrives.enable = true; + + networking.firewall.enable = false; +} diff --git a/hosts/hl-minipc2/hardware-configuration/boot.nix b/hosts/hl-minipc2/hardware-configuration/boot.nix new file mode 100644 index 0000000..e345656 --- /dev/null +++ b/hosts/hl-minipc2/hardware-configuration/boot.nix @@ -0,0 +1,16 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-minipc2/hardware-configuration/default.nix b/hosts/hl-minipc2/hardware-configuration/default.nix new file mode 100644 index 0000000..cda6436 --- /dev/null +++ b/hosts/hl-minipc2/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-minipc2/hardware-configuration/file-system.nix b/hosts/hl-minipc2/hardware-configuration/file-system.nix new file mode 100644 index 0000000..e4e7be5 --- /dev/null +++ b/hosts/hl-minipc2/hardware-configuration/file-system.nix @@ -0,0 +1,16 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/2c1a9e86-5b82-4545-bea1-c1b6b688fdf8"; + fsType = "ext4"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6583-1C43"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + swapDevices = [ ]; +} diff --git a/hosts/hl-minipc2/hardware.nix b/hosts/hl-minipc2/hardware.nix new file mode 100644 index 0000000..209318a --- /dev/null +++ b/hosts/hl-minipc2/hardware.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.fwupd.enable = true; +} diff --git a/hosts/hl-minipc2/services/default.nix b/hosts/hl-minipc2/services/default.nix new file mode 100644 index 0000000..3ca446b --- /dev/null +++ b/hosts/hl-minipc2/services/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./scrypted.nix + ./drawdb.nix + ./portainer.nix + ./stack1.nix + ./stack2.nix + ./timers.nix + ]; +} diff --git a/hosts/hl-minipc2/services/drawdb.nix b/hosts/hl-minipc2/services/drawdb.nix new file mode 100644 index 0000000..0a78bda --- /dev/null +++ b/hosts/hl-minipc2/services/drawdb.nix @@ -0,0 +1,14 @@ +{ config, ... }: +{ + skyg.nixos.common.container-services.drawdb = { + enable = true; + autoUpdate.enable = true; + services.drawdb = { + image = "ghcr.io/drawdb-io/drawdb:latest"; + environment.PORT = "80"; + networks.lan.ipv4_address = "10.0.101.2"; + dns.names = [ "drawdb" ]; + }; + networks.lan = config.skyg.nixos.common.containers.networks.ipvlanLab.compose; + }; +} diff --git a/hosts/hl-minipc2/services/portainer.nix b/hosts/hl-minipc2/services/portainer.nix new file mode 100644 index 0000000..0c49376 --- /dev/null +++ b/hosts/hl-minipc2/services/portainer.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + age.secrets.portainer-tls-key.file = ../secrets/portainer-tls-key.age; + + skyg.nixos.server.portainer = { + enable = true; + mode = "server"; + server.tls = { + enable = true; + cert = builtins.readFile ../configs/pki/portainer.app.internal.crt; + keySecretName = "portainer-tls-key"; + }; + }; +} diff --git a/hosts/hl-minipc2/services/scrypted.nix b/hosts/hl-minipc2/services/scrypted.nix new file mode 100644 index 0000000..b4c7c95 --- /dev/null +++ b/hosts/hl-minipc2/services/scrypted.nix @@ -0,0 +1,26 @@ +{ config, ... }: +{ + skyg.nixos.common.container-services.scrypted = { + enable = true; + autoUpdate.enable = true; + services.scrypted = { + image = "ghcr.io/koush/scrypted"; + volumes = [ + "/var/run/dbus:/var/run/dbus" + "/var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket" + "/opt/homelab/scrypted/db:/server/volume" + "scrypted-nvr:/nvr" + ]; + environment.SCRYPTED_NVR_VOLUME = "/nvr"; + network_mode = "host"; + }; + volumes.scrypted-nvr = { + driver = "local"; + driver_opts = { + type = "nfs"; + o = "addr=tnas1.lab.internal,rw,nfsvers=4.0,nolock,hard,noatime"; + device = ":/mnt/OneT/NVR"; + }; + }; + }; +} diff --git a/hosts/hl-minipc2/services/stack1.nix b/hosts/hl-minipc2/services/stack1.nix new file mode 100644 index 0000000..54f4c14 --- /dev/null +++ b/hosts/hl-minipc2/services/stack1.nix @@ -0,0 +1,9 @@ +{ config, ... }: +{ + age.secrets.stack1.file = ../secrets/stack1.age; + skyg.nixos.common.container-services.stack1 = { + enable = true; + autoUpdate.enable = true; + composeFile = config.age.secrets.stack1.path; + }; +} diff --git a/hosts/hl-minipc2/services/stack2.nix b/hosts/hl-minipc2/services/stack2.nix new file mode 100644 index 0000000..5a06462 --- /dev/null +++ b/hosts/hl-minipc2/services/stack2.nix @@ -0,0 +1,9 @@ +{ config, ... }: +{ + age.secrets.stack2.file = ../secrets/stack2.age; + skyg.nixos.common.container-services.stack2 = { + enable = true; + autoUpdate.enable = true; + composeFile = config.age.secrets.stack2.path; + }; +} diff --git a/hosts/hl-minipc2/services/timers.nix b/hosts/hl-minipc2/services/timers.nix new file mode 100644 index 0000000..572939e --- /dev/null +++ b/hosts/hl-minipc2/services/timers.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + skyg.server.timers.scrypted-backups = { + OnCalendar = "daily"; + wantedBy = [ "homelab-terra1-Data-apps.mount" ]; + script = '' + set -eu + ${pkgs.rsync}/bin/rsync -avpzP --delete /opt/homelab/scrypted /homelab/terra1/Data/apps/ + ''; + }; +} diff --git a/hosts/hl-minipc2/systemd.nix b/hosts/hl-minipc2/systemd.nix new file mode 100644 index 0000000..0057ccf --- /dev/null +++ b/hosts/hl-minipc2/systemd.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/hl-minipc3.nix b/hosts/hl-minipc3/default.nix similarity index 74% rename from hosts/hl-minipc3.nix rename to hosts/hl-minipc3/default.nix index 327e76a..fd4864b 100644 --- a/hosts/hl-minipc3.nix +++ b/hosts/hl-minipc3/default.nix @@ -1,6 +1,11 @@ -{ ... -}: +{ ... }: { + imports = [ + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ]; + skyg.user.enable = true; skyg.nixos.common.ssh-server.enable = true; skyg.server.dns.routing = { @@ -14,7 +19,7 @@ enable = true; envPath = "/opt/k3s/k3s.env"; }; - # Portainer Edge Agent (k3s deployment) + age.secrets.portainer-agent-minipc3.file = ../secrets/portainer-agent-minipc3.age; skyg.nixos.server.portainer = { enable = true; @@ -24,11 +29,6 @@ edgeKeySecretName = "portainer-agent-minipc3"; }; }; - # firmware updater - services.fwupd.enable = true; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - # Disable firewall + networking.firewall.enable = false; } diff --git a/hosts/hl-minipc3/hardware-configuration/boot.nix b/hosts/hl-minipc3/hardware-configuration/boot.nix new file mode 100644 index 0000000..0f2f22f --- /dev/null +++ b/hosts/hl-minipc3/hardware-configuration/boot.nix @@ -0,0 +1,16 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hl-minipc3/hardware-configuration/default.nix b/hosts/hl-minipc3/hardware-configuration/default.nix new file mode 100644 index 0000000..c9fddf5 --- /dev/null +++ b/hosts/hl-minipc3/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-minipc3/hardware-configuration/file-system.nix b/hosts/hl-minipc3/hardware-configuration/file-system.nix new file mode 100644 index 0000000..ce63be4 --- /dev/null +++ b/hosts/hl-minipc3/hardware-configuration/file-system.nix @@ -0,0 +1,15 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, modulesPath, ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/5a468faa-b149-4ae2-9106-f0b5216d6d95"; + fsType = "ext4"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6CC4-8800"; + fsType = "vfat"; + }; + swapDevices = [{ device = "/dev/disk/by-uuid/e847bdf2-e049-428b-a203-8a1eae77ce56"; }]; +} diff --git a/hosts/hl-minipc3/hardware.nix b/hosts/hl-minipc3/hardware.nix new file mode 100644 index 0000000..209318a --- /dev/null +++ b/hosts/hl-minipc3/hardware.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.fwupd.enable = true; +} diff --git a/hosts/hl-minipc3/systemd.nix b/hosts/hl-minipc3/systemd.nix new file mode 100644 index 0000000..0057ccf --- /dev/null +++ b/hosts/hl-minipc3/systemd.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/hl-pi1.nix b/hosts/hl-pi1/default.nix similarity index 52% rename from hosts/hl-pi1.nix rename to hosts/hl-pi1/default.nix index 39376fd..854be37 100644 --- a/hosts/hl-pi1.nix +++ b/hosts/hl-pi1/default.nix @@ -1,11 +1,13 @@ -{ lib -, pkgs -, config -, determinate -, ... -}: +{ lib, pkgs, config, determinate, ... }: { - skyg = { + imports = [ + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ]; + + skyg.user.enable + skyg = { user.enable = false; nixos = { common = { @@ -14,9 +16,7 @@ ssh-server.enable = true; containers.enable = false; networking.nfsServer.enable = false; - hardware = { - pipewire.enable = true; - }; + hardware.pipewire.enable = true; }; desktop = { enable = true; @@ -35,27 +35,12 @@ }; }; - # Determinate Nix builds its own Nix from source (no aarch64-linux binary - # cache hit for us), and its test suite fails under QEMU emulation because - # nested seccomp doesn't work through the translation layer. Skip the test - # suite for this build only — Determinate Nix itself stays enabled. nix.package = lib.mkForce ( determinate.inputs.nix.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (old: { doCheck = false; }) ); - # CM4 boots via Pi firmware + U-Boot reading extlinux.conf (set up by the - # official NixOS SD image) — not systemd-boot/EFI like the other hosts. - boot.loader.grub.enable = false; - boot.loader.generic-extlinux-compatible.enable = true; - - # Serial console, useful for headless debugging over UART. - boot.kernelParams = [ "console=ttyS0,115200n8" "console=tty0" ]; - - # SD image has no swap partition; use compressed RAM swap instead. - zramSwap.enable = true; - programs.dms-greeter = { enable = true; compositor.name = "hyprland"; @@ -66,7 +51,6 @@ user = config.skyg.user.name; }; services.displayManager.defaultSession = "hyprland"; - environment.systemPackages = with pkgs; [ - foot - ]; + + environment.systemPackages = with pkgs; [ foot ]; } diff --git a/hosts/hl-pi1/hardware-configuration/boot.nix b/hosts/hl-pi1/hardware-configuration/boot.nix new file mode 100644 index 0000000..17b20ea --- /dev/null +++ b/hosts/hl-pi1/hardware-configuration/boot.nix @@ -0,0 +1,15 @@ +# +# Clanker ! Do not modify this file! +# +{ lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "usbhid" "usb_storage" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/hosts/hl-pi1/hardware-configuration/default.nix b/hosts/hl-pi1/hardware-configuration/default.nix new file mode 100644 index 0000000..2ddd43e --- /dev/null +++ b/hosts/hl-pi1/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ lib, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-pi1/hardware-configuration/file-system.nix b/hosts/hl-pi1/hardware-configuration/file-system.nix new file mode 100644 index 0000000..980cf54 --- /dev/null +++ b/hosts/hl-pi1/hardware-configuration/file-system.nix @@ -0,0 +1,18 @@ +# +# Clanker ! Do not modify this file! +# +{ lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; + fileSystems."/boot/firmware" = { + device = "/dev/disk/by-label/FIRMWARE"; + fsType = "vfat"; + options = [ "nofail" "noauto" ]; + }; + swapDevices = [ ]; +} diff --git a/hosts/hl-pi1/hardware.nix b/hosts/hl-pi1/hardware.nix new file mode 100644 index 0000000..5db34cd --- /dev/null +++ b/hosts/hl-pi1/hardware.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + boot.kernelParams = [ "console=ttyS0,115200n8" "console=tty0" ]; +} diff --git a/hosts/hl-pi1/systemd.nix b/hosts/hl-pi1/systemd.nix new file mode 100644 index 0000000..49d3cd5 --- /dev/null +++ b/hosts/hl-pi1/systemd.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + zramSwap.enable = true; +} diff --git a/hosts/hl-pi2.nix b/hosts/hl-pi2/default.nix similarity index 50% rename from hosts/hl-pi2.nix rename to hosts/hl-pi2/default.nix index ca6bf73..ca24378 100644 --- a/hosts/hl-pi2.nix +++ b/hosts/hl-pi2/default.nix @@ -1,12 +1,17 @@ { lib, pkgs, config, determinate, ... }: { - skyg = { + imports = [ + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ]; + + skyg.user.enable + skyg = { user.enable = true; nixos = { common.ssh-server.enable = true; - common.hardware = { - pipewire.enable = true; - }; + common.hardware.pipewire.enable = true; desktop = { enable = true; tiler = { @@ -20,25 +25,12 @@ }; }; - # Determinate Nix builds its own Nix from source (no aarch64-linux binary - # cache hit for us), and its test suite fails under QEMU emulation because - # nested seccomp doesn't work through the translation layer. Skip the test - # suite for this build only — Determinate Nix itself stays enabled. nix.package = lib.mkForce ( determinate.inputs.nix.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (old: { doCheck = false; }) ); - # Pi 4 boots via Pi firmware + U-Boot reading extlinux.conf (set up by the - # official NixOS SD image) — not systemd-boot/EFI like the other hosts. - boot.loader.grub.enable = false; - boot.loader.generic-extlinux-compatible.enable = true; - - # Serial console, useful for headless debugging over UART. - boot.kernelParams = [ "console=ttyS0,115200n8" "console=tty0" ]; - - zramSwap.enable = true; programs.dms-greeter = { enable = true; compositor.name = "hyprland"; @@ -49,7 +41,6 @@ user = config.skyg.user.name; }; services.displayManager.defaultSession = "hyprland"; - environment.systemPackages = with pkgs; [ - foot - ]; + + environment.systemPackages = with pkgs; [ foot ]; } diff --git a/hosts/hl-pi2/hardware-configuration/boot.nix b/hosts/hl-pi2/hardware-configuration/boot.nix new file mode 100644 index 0000000..f8a607d --- /dev/null +++ b/hosts/hl-pi2/hardware-configuration/boot.nix @@ -0,0 +1,16 @@ +# +# Clanker ! Do not modify this file! +# +{ lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "usbhid" "usb_storage" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + boot.zfs.forceImportRoot = false; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/hosts/hl-pi2/hardware-configuration/default.nix b/hosts/hl-pi2/hardware-configuration/default.nix new file mode 100644 index 0000000..2ddd43e --- /dev/null +++ b/hosts/hl-pi2/hardware-configuration/default.nix @@ -0,0 +1,10 @@ +# +# Clanker ! Do not modify this file! +# +{ lib, modulesPath, ... }: +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-pi2/hardware-configuration/file-system.nix b/hosts/hl-pi2/hardware-configuration/file-system.nix new file mode 100644 index 0000000..d1f46fb --- /dev/null +++ b/hosts/hl-pi2/hardware-configuration/file-system.nix @@ -0,0 +1,16 @@ +# +# Clanker ! Do not modify this file! +# +{ lib, modulesPath, ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; + fileSystems."/boot/firmware" = { + device = "/dev/disk/by-label/FIRMWARE"; + fsType = "vfat"; + options = [ "nofail" "noauto" ]; + }; + swapDevices = [ ]; +} diff --git a/hosts/hl-pi2/hardware.nix b/hosts/hl-pi2/hardware.nix new file mode 100644 index 0000000..5db34cd --- /dev/null +++ b/hosts/hl-pi2/hardware.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + boot.kernelParams = [ "console=ttyS0,115200n8" "console=tty0" ]; +} diff --git a/hosts/hl-pi2/systemd.nix b/hosts/hl-pi2/systemd.nix new file mode 100644 index 0000000..49d3cd5 --- /dev/null +++ b/hosts/hl-pi2/systemd.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + zramSwap.enable = true; +} diff --git a/hosts/hl-terra1.nix b/hosts/hl-terra1.nix deleted file mode 100644 index 3f0bf38..0000000 --- a/hosts/hl-terra1.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, ... }: -let - openPorts = [ - # nfs - 111 - 2049 - 4000 # statdPort - 4001 # lockdPort - 4002 # mountdPort; - 20048 - # ssh - 22 - # prometheus - 9090 - ]; -in -{ - skyg.user.enable = true; - skyg.nixos.common.ssh-server.enable = true; - skyg.server.dns.routing = { - enable = false; - openFirewall = true; - addressesSecretName = "dns-addresses.conf"; - }; - skyg.nixos.desktop.enable = false; - skyg.server.admin.enable = true; - skyg.server.exporters.enable = true; - - # firmware updater - services.fwupd.enable = true; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - environment.systemPackages = with pkgs; [ - btrfs-progs - ]; - # Firewall - networking.firewall.allowedUDPPorts = openPorts; - networking.firewall.allowedTCPPorts = openPorts; - # NFS - skyg.nixos.common.networking.nfsServer.enable = true; - services.nfs.server = { - lockdPort = 4001; - mountdPort = 4002; - statdPort = 4000; - extraNfsdConfig = ''''; - exports = '' - /mnt/Data/apps 10.0.0.0/16(rw,wdelay,insecure,no_root_squash,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash) - ''; - }; -} diff --git a/hosts/hl-terra1/default.nix b/hosts/hl-terra1/default.nix new file mode 100644 index 0000000..01f017f --- /dev/null +++ b/hosts/hl-terra1/default.nix @@ -0,0 +1,37 @@ +{ pkgs, ... }: +let + openPorts = [ + 111 + 2049 + 4000 + 4001 + 4002 + 20048 + 22 + 9090 + ]; +in +{ + imports = [ + ./services.nix + ./hardware-configuration + ./hardware.nix + ./systemd.nix + ]; + + skyg.user.enable = true; + skyg.nixos.common.ssh-server.enable = true; + skyg.server.dns.routing = { + enable = false; + openFirewall = true; + addressesSecretName = "dns-addresses.conf"; + }; + skyg.nixos.desktop.enable = false; + skyg.server.admin.enable = true; + skyg.server.exporters.enable = true; + + environment.systemPackages = with pkgs; [ btrfs-progs ]; + + networking.firewall.allowedUDPPorts = openPorts; + networking.firewall.allowedTCPPorts = openPorts; +} diff --git a/hosts/hl-terra1/hardware-configuration/boot.nix b/hosts/hl-terra1/hardware-configuration/boot.nix new file mode 100644 index 0000000..8c942e9 --- /dev/null +++ b/hosts/hl-terra1/hardware-configuration/boot.nix @@ -0,0 +1,27 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "uas" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.extraModulePackages = with pkgs.linuxPackages; [ + it87 + hddled + ]; + boot.kernelModules = [ + "kvm-intel" + "coretemp" + "drivetemp" + "it87" + "hddled_tmj33" + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nix.settings.max-jobs = 2; + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; +} diff --git a/hosts/hl-terra1/hardware-configuration/default.nix b/hosts/hl-terra1/hardware-configuration/default.nix new file mode 100644 index 0000000..fb30462 --- /dev/null +++ b/hosts/hl-terra1/hardware-configuration/default.nix @@ -0,0 +1,32 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +let + kernel = config.boot.kernelPackages.kernel; + hddled = pkgs.stdenv.mkDerivation rec { + name = "hddled_tmj33-${version}-${kernel.version}"; + version = "0.3"; + src = pkgs.fetchFromGitHub { + owner = "arnarg"; + repo = "hddled_tmj33"; + rev = version; + sha256 = "sha256-sQ8fLK8NP5sHw/9gJTO6lqgWfwmi1G5KDwWuWujNCZw="; + }; + nativeBuildInputs = kernel.moduleBuildDependencies; + preConfigure = '' + sed -i 's|depmod|#depmod|' Makefile + ''; + makeFlags = [ + "TARGET=${kernel.modDirVersion}" + "KERNEL_MODULES=${kernel.dev}/lib/modules/${kernel.modDirVersion}" + "MODDESTDIR=$(out)/lib/modules/${kernel.modDirVersion}/kernel/drivers/misc" + ]; + }; +in +{ + imports = [ + ./boot.nix + ./file-system.nix + ]; +} diff --git a/hosts/hl-terra1/hardware-configuration/file-system.nix b/hosts/hl-terra1/hardware-configuration/file-system.nix new file mode 100644 index 0000000..0c3eeff --- /dev/null +++ b/hosts/hl-terra1/hardware-configuration/file-system.nix @@ -0,0 +1,20 @@ +# +# Clanker ! Do not modify this file! +# +{ config, lib, pkgs, modulesPath, ... }: +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/a3b275b4-96d4-4eb4-b01f-d80370899791"; + fsType = "ext4"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/AAA7-BCE9"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + fileSystems."/mnt/Data" = { + device = "/dev/sda1"; + fsType = "btrfs"; + }; + swapDevices = [ ]; +} diff --git a/hosts/hl-terra1/hardware.nix b/hosts/hl-terra1/hardware.nix new file mode 100644 index 0000000..209318a --- /dev/null +++ b/hosts/hl-terra1/hardware.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.fwupd.enable = true; +} diff --git a/hosts/hl-terra1/services.nix b/hosts/hl-terra1/services.nix new file mode 100644 index 0000000..1354378 --- /dev/null +++ b/hosts/hl-terra1/services.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + skyg.nixos.common.networking.nfsServer.enable = true; + services.nfs.server = { + lockdPort = 4001; + mountdPort = 4002; + statdPort = 4000; + extraNfsdConfig = ''''; + exports = '' + /mnt/Data/apps 10.0.0.0/16(rw,wdelay,insecure,no_root_squash,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash) + ''; + }; +} diff --git a/hosts/hl-terra1/systemd.nix b/hosts/hl-terra1/systemd.nix new file mode 100644 index 0000000..0057ccf --- /dev/null +++ b/hosts/hl-terra1/systemd.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/iso.nix b/hosts/iso.nix deleted file mode 100644 index ea6ebb2..0000000 --- a/hosts/iso.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - # Root access without password - users.users.root.initialHashedPassword = ""; - security.sudo.wheelNeedsPassword = false; - # Remote-install tools (nix ssh-store, nixos-anywhere) run non-interactive commands over SSH - # that zsh's glob-nomatch abort breaks; keep root on bash for this image only. - users.users.root.shell = lib.mkForce pkgs.bash; - - # Networking - networking.networkmanager.enable = true; - - # Skyg Settings - skyg = { - user.enable = true; - nixos.common = { - ssh-server.enable = true; - }; - }; - - # SSH for remote installation - services.openssh.settings.PermitRootLogin = "yes"; - # # GUI with lightweight desktop - # services.xserver.enable = true; - # services.xserver.displayManager.lightdm.enable = true; - # services.xserver.desktopManager.xfce.enable = true; - - # Core system packages - environment.systemPackages = with pkgs; [ - # Disk tools - parted - gparted # GUI partitioner - cryptsetup - btrfs-progs - dosfstools - ntfs3g - e2fsprogs - - # Utilities - curl - wget - git - htop - zellij - - # Documentation - man-pages - ]; - - # Include documentation - documentation.nixos.enable = true; -} diff --git a/hosts/iso/default.nix b/hosts/iso/default.nix new file mode 100644 index 0000000..60c6484 --- /dev/null +++ b/hosts/iso/default.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: +{ + users.users.root.initialHashedPassword = ""; + security.sudo.wheelNeedsPassword = false; + users.users.root.shell = lib.mkForce pkgs.bash; + + networking.networkmanager.enable = true; + + skyg = { + user.enable = true; + nixos.common.ssh-server.enable = true; + }; + + services.openssh.settings.PermitRootLogin = "yes"; + + environment.systemPackages = with pkgs; [ + parted + gparted + cryptsetup + btrfs-progs + dosfstools + ntfs3g + e2fsprogs + curl + wget + git + htop + zellij + man-pages + ]; + + documentation.nixos.enable = true; +} diff --git a/modules/nixos/desktop/ABOUTME.md b/modules/nixos/desktop/ABOUTME.md index 20a0372..6d2b9cb 100644 --- a/modules/nixos/desktop/ABOUTME.md +++ b/modules/nixos/desktop/ABOUTME.md @@ -56,6 +56,10 @@ skyg.nixos.desktop.fixes.* → fixes/ the desktop apps and Xorg/XWayland now install only in full (non-slim) mode. - Tiler app groups (`control`, `gnome`, `media`) and Hyprland shell `tools` are opt-in — see `tiler/ABOUTME.md`. +- Non-slim desktop sets `xdg.mime.defaultApplications` url-scheme entries to Chromium as a + system-level fallback (a user-level `~/.config/mimeapps.list` still wins). Hosts like `fwbook` + additionally pin every handler declaratively via home-manager `xdg.mimeApps`, which also + stops apps (e.g. Slack) from re-registering themselves as the default browser. ## Conventions diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix index f15e2ef..9a529f5 100644 --- a/modules/nixos/desktop/default.nix +++ b/modules/nixos/desktop/default.nix @@ -67,6 +67,11 @@ let icons.enable = true; sounds.enable = true; terminal-exec.enable = true; + mime.defaultApplications = { + # www links open in Chromium (installed above); user config wins. + "x-scheme-handler/http" = "chromium-browser.desktop"; + "x-scheme-handler/https" = "chromium-browser.desktop"; + }; portal = { enable = true; extraPortals = [