From 85fca14d01860ebc3694d0596663c3c22e9edf48 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 12 Mar 2022 19:59:53 -0800 Subject: hosts: add profiles Profiles contain a collection of modules. --- hosts/common/nas.nix | 34 ---------------------------------- hosts/common/server/default.nix | 7 ------- hosts/profiles/nas.nix | 35 +++++++++++++++++++++++++++++++++++ hosts/profiles/server.nix | 7 +++++++ hosts/tahoe/default.nix | 2 +- 5 files changed, 43 insertions(+), 42 deletions(-) delete mode 100644 hosts/common/nas.nix delete mode 100644 hosts/common/server/default.nix create mode 100644 hosts/profiles/nas.nix create mode 100644 hosts/profiles/server.nix diff --git a/hosts/common/nas.nix b/hosts/common/nas.nix deleted file mode 100644 index dd6d81d..0000000 --- a/hosts/common/nas.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ - ./server/default.nix - ./server/samba.nix - ./server/prometheus.nix - ./server/grafana.nix - ./server/traefik.nix - ./server/transmission.nix - ./server/unifi.nix - ./server/gitea.nix - ./server/rclone.nix - ]; - - users.groups.nas.gid = 5000; - users.users.nas = { - uid = 5000; - group = "nas"; - isSystemUser = true; - }; - - services.restic.backups = { - media = { - paths = [ "/data/fast/music" "/data/fast/photos" ]; - repository = "/data/slow/backups/systems"; - passwordFile = config.age.secrets.restic-repo-systems.path; - timerConfig = { OnCalendar = "00:55"; }; - initialize = true; - extraBackupArgs = [ "--tag media" ]; - pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ]; - }; - }; -} diff --git a/hosts/common/server/default.nix b/hosts/common/server/default.nix deleted file mode 100644 index 2986f66..0000000 --- a/hosts/common/server/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ - ./monitoring.nix - ]; -} diff --git a/hosts/profiles/nas.nix b/hosts/profiles/nas.nix new file mode 100644 index 0000000..10ba67c --- /dev/null +++ b/hosts/profiles/nas.nix @@ -0,0 +1,35 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ + # other profiles + ./server.nix + ../common/server/samba.nix + ../common/server/prometheus.nix + ../common/server/grafana.nix + ../common/server/traefik.nix + ../common/server/transmission.nix + ../common/server/unifi.nix + ../common/server/gitea.nix + ../common/server/rclone.nix + ]; + + users.groups.nas.gid = 5000; + users.users.nas = { + uid = 5000; + group = "nas"; + isSystemUser = true; + }; + + services.restic.backups = { + media = { + paths = [ "/data/fast/music" "/data/fast/photos" ]; + repository = "/data/slow/backups/systems"; + passwordFile = config.age.secrets.restic-repo-systems.path; + timerConfig = { OnCalendar = "00:55"; }; + initialize = true; + extraBackupArgs = [ "--tag media" ]; + pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ]; + }; + }; +} diff --git a/hosts/profiles/server.nix b/hosts/profiles/server.nix new file mode 100644 index 0000000..667b828 --- /dev/null +++ b/hosts/profiles/server.nix @@ -0,0 +1,7 @@ +o{ config, pkgs, lib, ... }: + +{ + imports = [ + ../common/server/monitoring.nix + ]; +} diff --git a/hosts/tahoe/default.nix b/hosts/tahoe/default.nix index 8d78461..5a746dd 100644 --- a/hosts/tahoe/default.nix +++ b/hosts/tahoe/default.nix @@ -3,7 +3,7 @@ { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ../common/nas.nix + ../profiles/nas.nix ../common/system/tailscale.nix ]; -- cgit 1.4.1