Hybrid cloud cluster monorepo with Ansible, K8s, NixOS, and Terraform. cute.haus
ansible terraform nix k8s
1

Configure Feed

Select the types of activity you want to include in your feed.

nix: get rid of option ?

Aly Raffauf (Jun 10, 2026, 8:24 PM EDT) a657ed3d 1207f83a

+31 -59
+12 -34
nix/nixos/profiles/arr.nix
··· 56 56 flake.modules.nixos.backups = { 57 57 config, 58 58 lib, 59 - options, 60 59 pkgs, 61 60 ... 62 61 }: let 63 62 stop = service: "${pkgs.systemd}/bin/systemctl stop ${service}"; 64 63 start = service: "${pkgs.systemd}/bin/systemctl start ${service}"; 65 - in { 66 - config = lib.mkIf (options ? myArr) { 67 - myBackups.jobs = { 68 - bazarr = { 69 - backupCleanupCommand = start "bazarr"; 70 - backupPrepareCommand = stop "bazarr"; 71 - paths = [config.services.bazarr.dataDir]; 72 - }; 73 - 74 - lidarr = { 75 - backupCleanupCommand = start "lidarr"; 76 - backupPrepareCommand = stop "lidarr"; 77 - paths = [config.services.lidarr.dataDir]; 78 - }; 79 - 80 - prowlarr = { 81 - backupCleanupCommand = start "prowlarr"; 82 - backupPrepareCommand = stop "prowlarr"; 83 - paths = [config.services.prowlarr.dataDir]; 84 - }; 85 - 86 - radarr = { 87 - backupCleanupCommand = start "radarr"; 88 - backupPrepareCommand = stop "radarr"; 89 - paths = [config.services.radarr.dataDir]; 90 - }; 91 - 92 - sonarr = { 93 - backupCleanupCommand = start "sonarr"; 94 - backupPrepareCommand = stop "sonarr"; 95 - paths = [config.services.sonarr.dataDir]; 96 - }; 97 - }; 64 + mkJob = service: { 65 + backupCleanupCommand = start service; 66 + backupPrepareCommand = stop service; 67 + paths = [config.services.${service}.dataDir]; 98 68 }; 69 + in { 70 + config.myBackups.jobs = lib.mkMerge [ 71 + (lib.mkIf config.services.bazarr.enable {bazarr = mkJob "bazarr";}) 72 + (lib.mkIf config.services.lidarr.enable {lidarr = mkJob "lidarr";}) 73 + (lib.mkIf config.services.prowlarr.enable {prowlarr = mkJob "prowlarr";}) 74 + (lib.mkIf config.services.radarr.enable {radarr = mkJob "radarr";}) 75 + (lib.mkIf config.services.sonarr.enable {sonarr = mkJob "sonarr";}) 76 + ]; 99 77 }; 100 78 }
+8 -13
nix/nixos/profiles/k3s.nix
··· 131 131 flake.modules.nixos.backups = { 132 132 config, 133 133 lib, 134 - options, 135 134 ... 136 - }: let 137 - cfg = config.myK3s; 138 - in { 139 - config = lib.mkIf (options ? myK3s) { 140 - myBackups.jobs.k3s = lib.mkIf (cfg.role == "server") { 141 - backupPrepareCommand = "${config.services.k3s.package}/bin/k3s etcd-snapshot save"; 142 - paths = [ 143 - "/var/lib/rancher/k3s/server/db/snapshots" 144 - "/var/lib/rancher/k3s/server/cred" 145 - "/var/lib/rancher/k3s/server/tls" 146 - ]; 147 - }; 135 + }: { 136 + config.myBackups.jobs.k3s = lib.mkIf (config.services.k3s.enable && config.services.k3s.role == "server") { 137 + backupPrepareCommand = "${config.services.k3s.package}/bin/k3s etcd-snapshot save"; 138 + paths = [ 139 + "/var/lib/rancher/k3s/server/db/snapshots" 140 + "/var/lib/rancher/k3s/server/cred" 141 + "/var/lib/rancher/k3s/server/tls" 142 + ]; 148 143 }; 149 144 }; 150 145 }
+4 -5
nix/nixos/services/plex.nix
··· 52 52 flake.modules.nixos.backups = { 53 53 config, 54 54 lib, 55 - options, 56 55 pkgs, 57 56 ... 58 57 }: let 59 58 stop = service: "${pkgs.systemd}/bin/systemctl stop ${service}"; 60 59 start = service: "${pkgs.systemd}/bin/systemctl start ${service}"; 61 60 in { 62 - config = lib.mkMerge [ 63 - (lib.mkIf (options ? myPlex) { 64 - myBackups.jobs.plex = { 61 + config.myBackups.jobs = lib.mkMerge [ 62 + (lib.mkIf config.services.plex.enable { 63 + plex = { 65 64 backupCleanupCommand = start "plex"; 66 65 backupPrepareCommand = stop "plex"; 67 66 exclude = ["${config.services.plex.dataDir}/Plex Media Server/Plug-in Support/Databases"]; ··· 70 69 }) 71 70 72 71 (lib.mkIf config.services.tautulli.enable { 73 - myBackups.jobs.tautulli = { 72 + tautulli = { 74 73 backupCleanupCommand = start "tautulli"; 75 74 backupPrepareCommand = stop "tautulli"; 76 75 paths = [config.services.tautulli.dataDir];
+7 -7
nix/nixos/services/qbittorrent.nix
··· 17 17 type = lib.types.str; 18 18 default = "qbittorrent"; 19 19 }; 20 + 20 21 group = lib.mkOption { 21 22 type = lib.types.str; 22 23 default = "qbittorrent"; 23 24 }; 25 + 24 26 port = lib.mkOption { 25 27 type = lib.types.port; 26 28 default = 8080; 27 29 }; 30 + 28 31 openFirewall = lib.mkOption { 29 32 type = lib.types.bool; 30 33 default = false; ··· 52 55 flake.modules.nixos.backups = { 53 56 config, 54 57 lib, 55 - options, 56 58 pkgs, 57 59 ... 58 60 }: let 59 61 stop = service: "${pkgs.systemd}/bin/systemctl stop ${service}"; 60 62 start = service: "${pkgs.systemd}/bin/systemctl start ${service}"; 61 63 in { 62 - config = lib.mkIf (options ? myQbittorrent) { 63 - myBackups.jobs.qbittorrent = { 64 - backupCleanupCommand = start "qbittorrent"; 65 - backupPrepareCommand = stop "qbittorrent"; 66 - paths = [config.services.qbittorrent.profileDir]; 67 - }; 64 + config.myBackups.jobs.qbittorrent = lib.mkIf config.services.qbittorrent.enable { 65 + backupCleanupCommand = start "qbittorrent"; 66 + backupPrepareCommand = stop "qbittorrent"; 67 + paths = [config.services.qbittorrent.profileDir]; 68 68 }; 69 69 }; 70 70 }