feat: Complete sleeper-service deployment with ZFS and network fixes
Some checks are pending
🏠 Home Lab CI/CD Pipeline / 🔍 Validate Configuration (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🔨 Build Configurations (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔒 Security Audit (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📚 Documentation & Modules (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔄 Update Dependencies (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🚀 Deploy Configuration (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📢 Notify Results (push) Blocked by required conditions

 Major deployment milestone achieved:

**sleeper-service Configuration:**
- Successfully deployed flake-based NixOS on Intel Xeon file server
- Resolved ZFS mounting conflicts causing boot failures
- Implemented ZFS native mounting (/mnt/storage, /mnt/storage/media)
- Added Pi-hole DNS integration (10.0.0.14) for package resolution
- Configured systemd-networkd with static IP (10.0.0.8)
- System boots cleanly in ~1 minute with ZFS auto-mounting

**Infrastructure Updates:**
- SSH key management deployed and operational
- Network configuration with multi-tier DNS (Pi-hole, router, Google)
- NFS server configuration for network storage
- Data preservation verified: 903GB ZFS pool intact

**Technical Solutions:**
- Added nomodeset kernel parameter for graphics compatibility
- Disabled NVIDIA drivers for headless server operation
- Removed conflicting ZFS entries from hardware-configuration.nix
- Established remote deployment workflow via rsync + SSH

**Documentation:**
- Updated plan.md with deployment status and lessons learned
- Added deployment commands and troubleshooting notes
- Documented ZFS native mounting migration process

**Data Verified:**
- Films: 184GB, Series: 612GB, Audiobooks: 94GB, Music: 9.1GB, Books: 3.5GB
- Storage pool: 903GB used, 896GB available
- All media accessible via proper ZFS auto-mounting

This represents the first successful multi-machine flake deployment in the home lab infrastructure migration.
This commit is contained in:
Geir Okkenhaug Jerstad 2025-06-06 11:21:12 +02:00
parent 10a4f8df56
commit 7c650856f2
24 changed files with 537 additions and 72 deletions

View file

@ -0,0 +1,20 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
tldr
eza
bat
ripgrep
];
environment.shellAliases = {
vi = "nvim";
vim = "nvim";
h = "tldr";
# oxidized
ls = "eza -l";
cat = "bat";
grep = "rg";
top = "btm --color gruvbox";
# some tools
};
}

View file

@ -0,0 +1,11 @@
{ configs, pkgs, ... }:
{
environment.systemPackages = [
pkgs.audiobookshelf
];
services.audiobookshelf.group = "users";
services.audiobookshelf.enable = true;
services.audiobookshelf.host = "0.0.0.0" ;
services.audiobookshelf.port = 8000;
services.audiobookshelf.openFirewall = true;
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
services.calibre-web = {
enable = true;
group = "users";
listen = {
ip = "0.0.0.0";
port = 8083;
};
options = {
calibreLibrary = "/mnt/remote/media/books/calibre/";
enableBookUploading = true;
};
};
networking.firewall.allowedTCPPorts = [ 8083 ];
}

View file

@ -0,0 +1,97 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./starship.nix
./aliases.nix
./podman.nix
./libvirt.nix
./incus.nix
./jellyfin.nix
./tailscale.nix
./calibre-web.nix
./audiobook.nix
#./ollama.nix
./forgejo.nix
];
# Swap zram
zramSwap = {
enable = true;
algorithm = "zstd";
};
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.efi.efiSysMountPoint = "/boot/";
boot.loader.grub.device = "nodev";
# Disks and Updates
services.fstrim.enable = true;
# Mount remote filesystem
fileSystems."/mnt/remote/media" = {
device = "sleeper-service:/mnt/storage";
fsType = "nfs";
options = [ "x-systemd.automount" ];
};
# Enable all unfree hardware support.
hardware.firmware = with pkgs; [ firmwareLinuxNonfree ];
hardware.enableAllFirmware = true;
hardware.enableRedistributableFirmware = true;
nixpkgs.config.allowUnfree = true;
services.fwupd.enable = true;
# Networking
networking.hostName = "apps";
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Oslo";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "no";
};
users.users.geir = {
isNormalUser = true;
extraGroups = [ "wheel"
"networkmanager"
"libvirt"
"podman"
"incus-admin"
];
packages = with pkgs; [
bottom fastfetch nerdfetch
];
};
environment.systemPackages = with pkgs; [
neovim emacs nano curl htop glances kitty
wget git inxi nethogs fastfetch
];
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "no";
services.openssh.settings.PasswordAuthentication = true;
# Enable Netdata
services.netdata.enable = true;
# Firewall
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 22 19999 23231];
networking.firewall.allowedUDPPorts = [ 22 23231 ];
networking.nftables.enable = true;
system.stateVersion = "23.05";
}

View file

@ -0,0 +1,26 @@
{ pkgs, config, ... }:
{
services.forgejo = {
enable = true;
#user = "git";
};
services.forgejo.settings = {
DEFAULT = {
RUN_MODE = "prod";
};
service = {
DISABLE_REGISTRATION = true;
};
server = {
ROOT_URL = "http://apps:3000";
SSH_DOMAIN = "git.geokkjer.eu";
};
repository = {
ENABLE_PUSH_CREATE_USER = true;
};
other = {
SHOW_FOOTER_VERSION = true;
};
};
}

View file

@ -0,0 +1,40 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b101efbd-a6b3-494d-9c21-21187540dc8d";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E251-F60A";
fsType = "vfat";
};
fileSystems."/mnt/remote/media" =
{ device = "sleeper-service:/mnt/storage";
fsType = "nfs";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp8s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,14 @@
{ config, pkgs, ... }:
{
virtualisation.incus = {
enable = true;
ui.enable = true;
package = pkgs.incus;
};
environment.systemPackages = with pkgs; [
incus
lxc
];
networking.firewall.allowedTCPPorts = [ 8443 ];
}

View file

@ -0,0 +1,9 @@
{ config, pkgs, ... }:
{
services.jellyfin = {
enable = true;
group = "users";
};
networking.firewall.allowedTCPPorts = [ 8096 8920 ];
networking.firewall.allowedUDPPorts = [ 1900 7359 ];
}

View file

@ -0,0 +1,7 @@
{ config, pkgs, lib, ... }:
{
environment.systemPackages = with pkgs;
[
kitty kitty-themes termpdfpy
];
}

View file

@ -0,0 +1,9 @@
{ config, pkgs, ... }:
{
virtualisation.libvirtd.enable = true;
environment.systemPackages = with pkgs; [
qemu_kvm
libvirt
polkit
];
}

View file

@ -0,0 +1,30 @@
{ pkgs, ... }:
{
# Nextcloud Config
environment.etc."nextcloud-admin-pass".text = "siKKerhet666";
services.nextcloud = {
enable = true;
hostName = "server1.tail807ea.ts.net";
# Ssl Let'encrypt
#hostName = "cloud.geokkjer.eu";
#https = true;
# Auto-update Nextcloud Apps
autoUpdateApps.enable = true;
# Set what time makes sense for you
autoUpdateApps.startAt = "05:00:00";
# enable redis cache
configureRedis = true;
# Create db locally , maybe not needed with sqlite
database.createLocally = true;
# Config options
config = {
dbtype = "sqlite";
adminpassFile = "/etc/nextcloud-admin-pass";
trustedProxies = [ "46.226.104.98" "100.75.29.52" ];
extraTrustedDomains = [ "localhost" "*.cloudflare.net" "*.tail807ea.ts.net" "46.226.104.98" "*.geokkjer.eu" ];
};
};
}

View file

@ -0,0 +1,9 @@
{ pkgs, configs, ... }:
{
services.openvscode-server = {
enable = true;
telemetryLevel = "off";
port = 3003;
host = "0.0.0.0";
};
}

View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
virtualisation.podman.enable = true;
virtualisation.podman.dockerCompat = true;
virtualisation.podman.dockerSocket.enable = true;
#virtualisation.defaultNetwork.settings.dns_enabled = true;
environment.systemPackages = with pkgs; [
podman-tui
podman-compose
];
}

View file

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
starship
];
}

View file

@ -0,0 +1,18 @@
{config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
tailscale
];
services.tailscale.enable = true;
networking.firewall = {
# trace: warning: Strict reverse path filtering breaks Tailscale exit node
# use and some subnet routing setups. Consider setting
# `networking.firewall.checkReversePath` = 'loose'
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
};
}
#+end80808080 * nginx
#+begin_src nix

View file

@ -0,0 +1,29 @@
{ pkgs, ... }:
{
services.getty.greetingLine = ''\l'';
console = {
earlySetup = true;
# Joker palette
colors = [
"1b161f"
"ff5555"
"54c6b5"
"d5aa2a"
"bd93f9"
"ff79c6"
"8be9fd"
"bfbfbf"
"1b161f"
"ff6e67"
"5af78e"
"ffce50"
"caa9fa"
"ff92d0"
"9aedfe"
"e6e6e6"
];
};
}

View file

@ -0,0 +1,26 @@
{ pkgs, configs, ... }:
{
services.writefreely = {
enable = true;
admin.name = "geir@geokkjer.eu";
host = "blog.geokkjer.eu";
database = {
type = "sqlite3";
#filename = "writefreely.db";
#database = "writefreely";
};
nginx = {
# Enable Nginx and configure it to serve WriteFreely.
enable = true;
};
settings = {
server = {
port = 8088;
bind = "0.0.0.0";
};
};
};
networking.firewall.allowedTCPPorts = [ 8088 ];
networking.firewall.allowedUDPPorts = [ 8088 ];
}

View file

@ -1,11 +1,10 @@
{ config, pkgs, inputs, unstable, ... }: {
{ config, lib, pkgs, inputs, unstable, ... }: {
imports = [
./hardware-configuration.nix
../../modules/network/network-sleeper-service.nix
# Security modules
../../modules/security/ssh-keys.nix
# Network configuration
../../modules/network/network-sleeper-service.nix
# Services
../../modules/services/nfs.nix
../../modules/system/transmission.nix
@ -20,15 +19,55 @@
zfsSupport = true;
efiSupport = true;
efiInstallAsRemovable = true;
devices = [ "nodev" ];
mirroredBoots = [
{ devices = [ "nodev" ]; path = "/boot"; } ];
};
boot.supportedFilesystems = [ "zfs" ];
boot.loader.grub.memtest86.enable = true;
# Add nomodeset for graphics compatibility
boot.kernelParams = [ "nomodeset" ];
# ZFS services for file server
services.zfs = {
autoScrub.enable = true;
trim.enable = true;
};
# Enable ZFS auto-mounting since we're using ZFS native mountpoints
# systemd.services.zfs-mount.enable = lib.mkForce false;
# Disable graphics for server use - comment out NVIDIA config for now
# hardware.graphics = {
# enable = true;
# };
# hardware.nvidia = {
# modesetting.enable = true;
# open = false;
# package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
# };
# Comment out NVIDIA kernel modules for now
# boot.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
# Comment out NVIDIA utilities for now
# environment.systemPackages = with pkgs; [
# config.boot.kernelPackages.nvidiaPackages.legacy_470
# ];
# Create mount directories early in boot process
systemd.tmpfiles.rules = [
"d /mnt/storage 0755 root root -"
"d /mnt/storage/media 0755 root root -"
];
# Network configuration - using working setup from old config
# networking.hostName = "sleeper-service";
# services.tailscale.enable = true;
# networking.networkmanager.enable = true;
# networking.hostId = "8425e349";
# Time and locale
time.timeZone = "Europe/Oslo";
i18n.defaultLocale = "en_US.UTF-8";
@ -41,26 +80,16 @@
# Enable unfree packages
nixpkgs.config.allowUnfree = true;
# Basic system packages
environment.systemPackages = with pkgs; [
wget
curl
git
htop
eza
bat
ripgrep
du-dust
fd
ncdu
tree
];
# nixpkgs.config.nvidia.acceptLicense = true; # Commented out for now
programs.zsh.enable = true;
# Firewall configuration
networking.firewall.allowedTCPPorts = [ 22 ]; # SSH only (Transmission disabled temporarily)
# Enable SSH
services.openssh.enable = true;
system.stateVersion = "25.05";
# Firewall configuration - disable for simplicity like old config
# networking.firewall.enable = false;
# DO NOT CHANGE - maintains data compatibility
system.stateVersion = "23.11";
}

View file

@ -19,8 +19,6 @@
# ZFS Configuration - only for storage pool
boot.zfs.extraPools = [ "storage" ];
services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true;
# OS remains on ext4
fileSystems."/" =
@ -28,11 +26,11 @@
fsType = "ext4";
};
# ZFS storage pool mounted for NFS exports
fileSystems."/mnt/storage" =
{ device = "storage";
fsType = "zfs";
};
# ZFS storage datasets - removed auto-mounting to prevent boot issues
# Manual mounting required:
# mkdir -p /mnt/storage
# mount -t zfs storage /mnt/storage
# mount -t zfs storage/media /mnt/storage/media
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2C7A-9F08";
@ -46,7 +44,7 @@
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s25.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file