This commit is contained in:
mjallen18
2026-03-18 20:39:24 -05:00
parent 4a7b2f835e
commit 46b249560f
18 changed files with 142 additions and 917 deletions

View File

@@ -11,6 +11,7 @@ in
{
imports = [
./boot.nix
./nas-defaults.nix
./apps.nix
./disabled.nix
# ./nas-pool.nix
@@ -18,7 +19,6 @@ in
./services.nix
./sops.nix
./vpn.nix
# testcontainer
];
services.kmscon = disabled;

View File

@@ -0,0 +1,86 @@
# NAS-wide defaults for all mkModule services.
#
# Every service's configDir and dataDir default to paths on the NAS bcachefs
# pool. Setting them here via lib.mkDefault means individual service
# declarations in apps.nix only need to override when they deviate from the
# convention, keeping apps.nix concise.
#
# The companion RequiresMountsFor in mkModule uses these paths to derive the
# correct systemd mount dependency automatically — no service needs to hardcode
# "media-nas-main.mount" by name.
{ lib, namespace, ... }:
let
appdata = "/media/nas/main/appdata";
data = "/media/nas/main";
svcDefault = name: {
${namespace}.services.${name} = {
configDir = lib.mkDefault appdata;
dataDir = lib.mkDefault data;
};
};
in
{
# Bespoke services that define their own path options (not via mkModule).
# Set NAS-specific paths here so the module defaults stay generic.
${namespace}.services.your_spotify.configPath = lib.mkDefault "${appdata}/your_spotify";
${namespace}.services.ocis = {
dataPath = lib.mkDefault "${data}/ocis";
configPath = lib.mkDefault "${appdata}/ocis";
};
imports = map svcDefault [
"actual"
"ai"
"arrs"
"attic"
"authentik"
"authentikRac"
"booklore"
"caddy"
"calibre"
"calibre-web"
"code-server"
"collabora"
"coturn"
"crowdsec"
"dispatcharr"
"free-games-claimer"
"gitea"
"glance"
"glances"
"grafana"
"guacd"
"headscale"
"immich"
"jellyfin"
"jellyseerr"
"lubelogger"
"manyfold"
"matrix"
"minecraft"
"mongodb"
"nebula"
"nebula-lighthouse"
"netbootxyz"
"nextcloud"
"ntfy"
"onlyoffice"
"opencloud"
"orca-slicer"
"paperless"
"paperless-ai"
"protonmail-bridge"
"restic"
"sparky-fitness"
"sparky-fitness-server"
"sparky-fitness-db"
"sunshine"
"tdarr"
"termix"
"tunarr"
"unmanic"
"uptime-kuma"
"wyoming"
];
}