remove deprecated hosts
This commit is contained in:
parent
1132fc230a
commit
bf0628057f
9 changed files with 0 additions and 679 deletions
|
|
@ -1,34 +0,0 @@
|
||||||
{
|
|
||||||
disko.devices = {
|
|
||||||
disk = {
|
|
||||||
main = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/nvme0n1";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
ESP = {
|
|
||||||
size = "512M";
|
|
||||||
type = "EF00";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "vfat";
|
|
||||||
mountpoint = "/boot";
|
|
||||||
mountOptions = [ "fmask=0077" "dmask=0077" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
root = {
|
|
||||||
size = "100%";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "ext4";
|
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
|
||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
../home-default.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware-configuration.nix
|
|
||||||
../system-default.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
systemd-boot.configurationLimit = 10;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
timeout = 3;
|
|
||||||
};
|
|
||||||
|
|
||||||
jovian.devices.steamdeck.enable = true;
|
|
||||||
|
|
||||||
jovian.steam = {
|
|
||||||
enable = true;
|
|
||||||
autoStart = true;
|
|
||||||
user = "yanlin";
|
|
||||||
};
|
|
||||||
|
|
||||||
jovian.steamos.useSteamOSConfig = true;
|
|
||||||
|
|
||||||
jovian.hardware.has.amd.gpu = true;
|
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "deck";
|
|
||||||
networkmanager.enable = true;
|
|
||||||
firewall.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.yanlin = {
|
|
||||||
extraGroups = [ "networkmanager" "wheel" "video" "audio" "input" ];
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGmKZ0FbXhYRHVkVTeSmpPrvuG8sC8La3Yx2gWb4ncuc yanlin@imac"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
pciutils
|
|
||||||
usbutils
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
# Import Immich configuration from declarative config file
|
|
||||||
immichConfig = import ../../../config/immich.nix;
|
|
||||||
|
|
||||||
# Convert Nix configuration to JSON string
|
|
||||||
immichConfigJson = builtins.toJSON immichConfig;
|
|
||||||
|
|
||||||
# Write config file to a location accessible by the container
|
|
||||||
immichConfigFile = pkgs.writeText "immich.json" immichConfigJson;
|
|
||||||
|
|
||||||
# Universal container configuration
|
|
||||||
commonUID = "1000";
|
|
||||||
commonGID = "100";
|
|
||||||
systemTZ = config.time.timeZone;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# Container definitions for hs host
|
|
||||||
virtualisation.oci-containers.containers = {
|
|
||||||
|
|
||||||
# Immich photo and video backup system
|
|
||||||
immich = {
|
|
||||||
image = "ghcr.io/imagegenius/immich:latest";
|
|
||||||
|
|
||||||
volumes = [
|
|
||||||
"/var/lib/containers/config/immich:/config"
|
|
||||||
"/mnt/storage/appbulk/immich:/photos"
|
|
||||||
"/mnt/storage/Media/DCIM:/libraries"
|
|
||||||
# Mount the declarative config file
|
|
||||||
"${immichConfigFile}:/config/immich.json:ro"
|
|
||||||
];
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
PUID = commonUID;
|
|
||||||
PGID = commonGID;
|
|
||||||
TZ = systemTZ;
|
|
||||||
# Point to the mounted config file
|
|
||||||
IMMICH_CONFIG_FILE = "/config/immich.json";
|
|
||||||
# Database connection (keep as env vars for security)
|
|
||||||
DB_HOSTNAME = "immich-db";
|
|
||||||
DB_USERNAME = "postgres";
|
|
||||||
DB_PASSWORD = "postgres";
|
|
||||||
DB_DATABASE_NAME = "postgres";
|
|
||||||
DB_PORT = "5432";
|
|
||||||
# Redis connection
|
|
||||||
REDIS_HOSTNAME = "immich-redis";
|
|
||||||
REDIS_PORT = "6379";
|
|
||||||
# Machine Learning server (internal)
|
|
||||||
MACHINE_LEARNING_HOST = "0.0.0.0";
|
|
||||||
MACHINE_LEARNING_PORT = "3003";
|
|
||||||
MACHINE_LEARNING_WORKERS = "1";
|
|
||||||
MACHINE_LEARNING_WORKER_TIMEOUT = "120";
|
|
||||||
};
|
|
||||||
|
|
||||||
ports = [
|
|
||||||
"5000:8080"
|
|
||||||
];
|
|
||||||
|
|
||||||
extraOptions = [
|
|
||||||
"--network=podman"
|
|
||||||
"--device=/dev/dri:/dev/dri" # Hardware acceleration
|
|
||||||
];
|
|
||||||
|
|
||||||
dependsOn = [ "immich-db" "immich-redis" ];
|
|
||||||
autoStart = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# PostgreSQL database for Immich with vector extension
|
|
||||||
immich-db = {
|
|
||||||
image = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0";
|
|
||||||
|
|
||||||
volumes = [
|
|
||||||
"/var/lib/containers/config/immich-db:/var/lib/postgresql/data"
|
|
||||||
];
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
POSTGRES_PASSWORD = "postgres";
|
|
||||||
POSTGRES_USER = "postgres";
|
|
||||||
POSTGRES_DB = "postgres";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraOptions = [
|
|
||||||
"--network=podman"
|
|
||||||
];
|
|
||||||
|
|
||||||
autoStart = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Redis cache for Immich
|
|
||||||
immich-redis = {
|
|
||||||
image = "docker.io/redis:7.2-alpine";
|
|
||||||
|
|
||||||
extraOptions = [
|
|
||||||
"--network=podman"
|
|
||||||
];
|
|
||||||
|
|
||||||
autoStart = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,137 +0,0 @@
|
||||||
{
|
|
||||||
disko.devices = {
|
|
||||||
disk = {
|
|
||||||
# First drive of ZFS mirror pair (ZHITAI 1TB #1)
|
|
||||||
main1 = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/disk/by-id/ata-ZHITAI_SC001_XT_1000GB_ZTB401TAB244431J4R";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
# GRUB BIOS boot partition
|
|
||||||
boot = {
|
|
||||||
size = "1M";
|
|
||||||
type = "EF02";
|
|
||||||
};
|
|
||||||
# EFI System Partition (mirrored manually)
|
|
||||||
esp1 = {
|
|
||||||
size = "500M";
|
|
||||||
type = "EF00";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "vfat";
|
|
||||||
mountpoint = "/boot";
|
|
||||||
mountOptions = [ "umask=0077" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# ZFS partition
|
|
||||||
zfs = {
|
|
||||||
size = "100%";
|
|
||||||
content = {
|
|
||||||
type = "zfs";
|
|
||||||
pool = "rpool";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Second drive of ZFS mirror pair (ZHITAI 1TB #2)
|
|
||||||
main2 = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/disk/by-id/ata-ZHITAI_SC001_XT_1000GB_ZTB401TAB244431KEG";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
# GRUB BIOS boot partition
|
|
||||||
boot = {
|
|
||||||
size = "1M";
|
|
||||||
type = "EF02";
|
|
||||||
};
|
|
||||||
# EFI System Partition (backup)
|
|
||||||
esp2 = {
|
|
||||||
size = "500M";
|
|
||||||
type = "EF00";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "vfat";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# ZFS partition
|
|
||||||
zfs = {
|
|
||||||
size = "100%";
|
|
||||||
content = {
|
|
||||||
type = "zfs";
|
|
||||||
pool = "rpool";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
zpool = {
|
|
||||||
rpool = {
|
|
||||||
type = "zpool";
|
|
||||||
mode = "mirror";
|
|
||||||
rootFsOptions = {
|
|
||||||
compression = "lz4";
|
|
||||||
acltype = "posixacl";
|
|
||||||
xattr = "sa";
|
|
||||||
relatime = "on";
|
|
||||||
normalization = "formD";
|
|
||||||
canmount = "off";
|
|
||||||
dnodesize = "auto";
|
|
||||||
};
|
|
||||||
mountpoint = "/";
|
|
||||||
|
|
||||||
datasets = {
|
|
||||||
# Root dataset
|
|
||||||
root = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
options = {
|
|
||||||
canmount = "off";
|
|
||||||
mountpoint = "none";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Root filesystem
|
|
||||||
"root/nixos" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/";
|
|
||||||
options = {
|
|
||||||
canmount = "noauto";
|
|
||||||
mountpoint = "/";
|
|
||||||
"com.sun:auto-snapshot" = "true";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Home directory
|
|
||||||
"root/home" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/home";
|
|
||||||
options = {
|
|
||||||
canmount = "on";
|
|
||||||
mountpoint = "/home";
|
|
||||||
"com.sun:auto-snapshot" = "true";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Nix store (no snapshots needed)
|
|
||||||
"root/nix" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/nix";
|
|
||||||
options = {
|
|
||||||
canmount = "on";
|
|
||||||
mountpoint = "/nix";
|
|
||||||
"com.sun:auto-snapshot" = "false";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
# Hardware configuration for home server (hs)
|
|
||||||
# Generated by nixos-generate-config and customized for this system
|
|
||||||
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
||||||
|
|
||||||
# Boot configuration - detected kernel modules for this hardware
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"sdhci_pci"
|
|
||||||
];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
# ZFS filesystems are managed by disko configuration
|
|
||||||
# No filesystem declarations needed here - disko handles all mounts
|
|
||||||
|
|
||||||
# No swap devices configured
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
# Networking hardware
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
# Hardware-specific settings
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
|
|
||||||
# CPU microcode updates
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
# For AMD systems, use this instead:
|
|
||||||
# hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
|
|
||||||
# Enable firmware updates
|
|
||||||
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
../home-default.nix
|
|
||||||
../../../modules/syncthing.nix
|
|
||||||
../../../modules/schedule.nix
|
|
||||||
../../../modules/media/yt-dlp.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
services.scheduled-commands.aicloud-backup = {
|
|
||||||
enable = true;
|
|
||||||
description = "Backup aicloud files";
|
|
||||||
interval = "*-*-* 18:00:00";
|
|
||||||
commands = [
|
|
||||||
"rsync -avP aicloud:~/ /mnt/storage/Backup/aicloud/ --exclude='/.*'"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.yt-dlp-custom = {
|
|
||||||
enable = true;
|
|
||||||
downloadDir = "/mnt/storage/Media/web-video";
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
{ config, pkgs, ... }: {
|
|
||||||
imports = [
|
|
||||||
./hardware-configuration.nix
|
|
||||||
./containers.nix
|
|
||||||
../system-default.nix
|
|
||||||
../../../modules/vpn/tailscale.nix
|
|
||||||
../../../modules/podman.nix
|
|
||||||
../../../modules/borg/client.nix
|
|
||||||
../../../modules/login-display.nix
|
|
||||||
../../../modules/file-server/samba.nix
|
|
||||||
../../../modules/media/server.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# GRUB bootloader with ZFS support
|
|
||||||
boot.loader.grub = {
|
|
||||||
enable = true;
|
|
||||||
devices = [
|
|
||||||
"/dev/disk/by-id/ata-ZHITAI_SC001_XT_1000GB_ZTB401TAB244431J4R"
|
|
||||||
"/dev/disk/by-id/ata-ZHITAI_SC001_XT_1000GB_ZTB401TAB244431KEG"
|
|
||||||
]; # Install GRUB on both ZFS mirror drives
|
|
||||||
efiSupport = true;
|
|
||||||
efiInstallAsRemovable = true;
|
|
||||||
zfsSupport = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable systemd stage-1 and ZFS support
|
|
||||||
boot.initrd.systemd.enable = true;
|
|
||||||
boot.supportedFilesystems = [ "zfs" "xfs" ];
|
|
||||||
boot.zfs.forceImportRoot = false;
|
|
||||||
|
|
||||||
# ZFS ARC memory configuration for 32GB system
|
|
||||||
boot.kernelParams = [
|
|
||||||
"zfs.zfs_arc_max=17179869184" # 16GB max ARC size
|
|
||||||
"zfs.zfs_arc_min=2147483648" # 2GB min ARC size
|
|
||||||
];
|
|
||||||
|
|
||||||
# XFS drive mounts
|
|
||||||
fileSystems."/mnt/wd-12t-1" = {
|
|
||||||
device = "/dev/disk/by-id/ata-HGST_HUH721212ALE604_5PK2N4GB-part1";
|
|
||||||
fsType = "xfs";
|
|
||||||
options = [ "defaults" "noatime" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/mnt/wd-12t-2" = {
|
|
||||||
device = "/dev/disk/by-id/ata-HGST_HUH721212ALE604_5PJ7Z3LE-part1";
|
|
||||||
fsType = "xfs";
|
|
||||||
options = [ "defaults" "noatime" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/mnt/wd-14t-1" = {
|
|
||||||
device = "/dev/disk/by-id/ata-WDC_WD140EDFZ-11A0VA0_9MGJULEK-part1";
|
|
||||||
fsType = "xfs";
|
|
||||||
options = [ "defaults" "noatime" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Parity drive for SnapRAID
|
|
||||||
fileSystems."/mnt/parity" = {
|
|
||||||
device = "/dev/disk/by-id/ata-ST16000NM000J-2TW103_WRS0F8BE-part1";
|
|
||||||
fsType = "xfs";
|
|
||||||
options = [ "defaults" "noatime" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# MergerFS union mount (needs to be after XFS mounts)
|
|
||||||
fileSystems."/mnt/storage" = {
|
|
||||||
device = "/mnt/wd-12t-1:/mnt/wd-12t-2:/mnt/wd-14t-1";
|
|
||||||
fsType = "mergerfs";
|
|
||||||
options = [
|
|
||||||
"defaults"
|
|
||||||
"allow_other"
|
|
||||||
"use_ino"
|
|
||||||
"cache.files=partial"
|
|
||||||
"dropcacheonclose=true"
|
|
||||||
"category.create=mfs"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Network configuration
|
|
||||||
networking = {
|
|
||||||
hostName = "hs";
|
|
||||||
hostId = "8425e349"; # Required for ZFS, good practice for any system
|
|
||||||
networkmanager.enable = true;
|
|
||||||
firewall = { enable = false; };
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# Host-specific SSH configuration
|
|
||||||
services.openssh = {
|
|
||||||
settings = {
|
|
||||||
PermitRootLogin = "yes"; # Allow root login for this server
|
|
||||||
};
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Define a user account
|
|
||||||
users.users.root = {
|
|
||||||
# Clear any inherited password settings
|
|
||||||
hashedPassword = null;
|
|
||||||
hashedPasswordFile = null;
|
|
||||||
password = null;
|
|
||||||
initialHashedPassword = null;
|
|
||||||
initialPassword = null;
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG35m0DgTrEOAM+1wAlYZ8mvLelNTcx65cFccGPQcxmo yanlin@imac"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Host-specific user configuration
|
|
||||||
users.users.yanlin = {
|
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
|
||||||
hashedPassword = "$6$8NUV0JK33hs3XBYe$osnYKzENDLYHQEpj8Z5F6ECpLdc8Y3RZcVGxQ0bc/6DepTwugAkfX8h6ItI01dJyk8RstiGsWVVCKGwXaL.sN.";
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG35m0DgTrEOAM+1wAlYZ8mvLelNTcx65cFccGPQcxmo yanlin@imac"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Intel graphics for hardware acceleration (QSV/VA-API)
|
|
||||||
hardware.graphics = {
|
|
||||||
enable = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
intel-media-driver
|
|
||||||
intel-vaapi-driver
|
|
||||||
libva-vdpau-driver
|
|
||||||
libvdpau-va-gl
|
|
||||||
vpl-gpu-rt
|
|
||||||
intel-compute-runtime
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Host-specific packages
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
smartmontools
|
|
||||||
zfs
|
|
||||||
mergerfs
|
|
||||||
snapraid
|
|
||||||
intel-gpu-tools
|
|
||||||
];
|
|
||||||
|
|
||||||
# ZFS services configuration
|
|
||||||
services.zfs = {
|
|
||||||
autoScrub = {
|
|
||||||
enable = true;
|
|
||||||
interval = "monthly";
|
|
||||||
pools = [ "rpool" ];
|
|
||||||
};
|
|
||||||
autoSnapshot = {
|
|
||||||
enable = true;
|
|
||||||
frequent = 4;
|
|
||||||
hourly = 24;
|
|
||||||
daily = 7;
|
|
||||||
weekly = 4;
|
|
||||||
monthly = 12;
|
|
||||||
};
|
|
||||||
trim = {
|
|
||||||
enable = true;
|
|
||||||
interval = "weekly";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# SnapRAID configuration for parity protection
|
|
||||||
services.snapraid = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Parity file location on 16TB drive
|
|
||||||
parityFiles = [
|
|
||||||
"/mnt/parity/snapraid.parity"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Content files for metadata (stored on multiple drives for redundancy)
|
|
||||||
contentFiles = [
|
|
||||||
"/var/snapraid.content"
|
|
||||||
"/mnt/parity/.snapraid.content"
|
|
||||||
"/mnt/wd-12t-1/.snapraid.content"
|
|
||||||
"/mnt/wd-12t-2/.snapraid.content"
|
|
||||||
"/mnt/wd-14t-1/.snapraid.content"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Data disks to protect
|
|
||||||
dataDisks = {
|
|
||||||
d1 = "/mnt/wd-12t-1/";
|
|
||||||
d2 = "/mnt/wd-12t-2/";
|
|
||||||
d3 = "/mnt/wd-14t-1/";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Sync and scrub schedule
|
|
||||||
sync.interval = "02:00";
|
|
||||||
scrub.interval = "Mon *-*-* 06:00:00";
|
|
||||||
|
|
||||||
# Files and directories to exclude from parity
|
|
||||||
exclude = [
|
|
||||||
"*.unrecoverable"
|
|
||||||
"/tmp/"
|
|
||||||
"/lost+found/"
|
|
||||||
"*.!sync"
|
|
||||||
".DS_Store"
|
|
||||||
"._.DS_Store"
|
|
||||||
".Spotlight-V100/"
|
|
||||||
".TemporaryItems/"
|
|
||||||
".Trashes/"
|
|
||||||
".fseventsd/"
|
|
||||||
"Thumbs.db"
|
|
||||||
"*.tmp"
|
|
||||||
"*.tmp.*"
|
|
||||||
"*.temp"
|
|
||||||
"*.temp.*"
|
|
||||||
"*.!qB"
|
|
||||||
"*.part"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Login display with SMART disk health status
|
|
||||||
services.login-display = {
|
|
||||||
enable = true;
|
|
||||||
showSystemInfo = true;
|
|
||||||
showSmartStatus = true;
|
|
||||||
smartDrives = {
|
|
||||||
"/dev/disk/by-id/ata-ZHITAI_SC001_XT_1000GB_ZTB401TAB244431J4R" = "ZFS_Mirror_1";
|
|
||||||
"/dev/disk/by-id/ata-ZHITAI_SC001_XT_1000GB_ZTB401TAB244431KEG" = "ZFS_Mirror_2";
|
|
||||||
"/dev/disk/by-id/ata-HGST_HUH721212ALE604_5PK2N4GB" = "Data_1_12TB";
|
|
||||||
"/dev/disk/by-id/ata-HGST_HUH721212ALE604_5PJ7Z3LE" = "Data_2_12TB";
|
|
||||||
"/dev/disk/by-id/ata-WDC_WD140EDFZ-11A0VA0_9MGJULEK" = "Data_3_14TB";
|
|
||||||
"/dev/disk/by-id/ata-ST16000NM000J-2TW103_WRS0F8BE" = "Parity_16TB";
|
|
||||||
};
|
|
||||||
showDiskUsage = true;
|
|
||||||
diskUsagePaths = [ "/" "/home/" "/mnt/storage" "/mnt/parity" ];
|
|
||||||
showSnapraidStatus = true;
|
|
||||||
showBorgStatus = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.tailscale-custom = {
|
|
||||||
exitNode = true;
|
|
||||||
subnetRoutes = [ "10.1.1.0/24" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Samba file sharing
|
|
||||||
services.samba-custom = {
|
|
||||||
sharedPath = "/mnt/storage/Media";
|
|
||||||
shareName = "Media";
|
|
||||||
user = "yanlin";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Media server services
|
|
||||||
services.media-server = {
|
|
||||||
user = "yanlin";
|
|
||||||
sonarr.enable = true;
|
|
||||||
radarr.enable = true;
|
|
||||||
jellyfin.enable = true;
|
|
||||||
deluge.enable = true;
|
|
||||||
plex.enable = true;
|
|
||||||
lidarr.enable = true;
|
|
||||||
bazarr.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Borg backup configuration
|
|
||||||
services.borg-client-custom = {
|
|
||||||
enable = true;
|
|
||||||
repositoryUrl = "ssh://borg-server/./hs";
|
|
||||||
backupPaths = [
|
|
||||||
"/mnt/storage/appbulk/immich/library/"
|
|
||||||
"/mnt/storage/Media/DCIM"
|
|
||||||
"/mnt/storage/Media/nsfw"
|
|
||||||
];
|
|
||||||
backupFrequency = "*-*-* 00:00:00";
|
|
||||||
retention = {
|
|
||||||
keepDaily = 7;
|
|
||||||
keepWeekly = 4;
|
|
||||||
keepMonthly = 6;
|
|
||||||
keepYearly = 2;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue