From 4b4a65e57bfe4a0b45bc66fd00f6a8f8d1c0a127 Mon Sep 17 00:00:00 2001 From: blake Date: Tue, 7 Oct 2025 15:09:48 -0500 Subject: [PATCH] 24 current 2025-10-07 14:53:20 25.05.20251001.5b5be50 6.12.49 * --- flake.nix | 2 +- hosts/snowbelle/configuration.nix | 3 ++- modules/system/backups.nix | 4 ++-- modules/system/default.nix | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 351766e..9b58054 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ # flake for blakes nixos config # define new devices in outputs -# generation: 23 current 2025-10-07 14:49:54 25.05.20251001.5b5be50 6.12.49 * +# generation: 24 current 2025-10-07 14:53:20 25.05.20251001.5b5be50 6.12.49 * { description = "blakes nix config"; inputs = { diff --git a/hosts/snowbelle/configuration.nix b/hosts/snowbelle/configuration.nix index 216c426..e019c2d 100644 --- a/hosts/snowbelle/configuration.nix +++ b/hosts/snowbelle/configuration.nix @@ -12,13 +12,14 @@ modules = { system = { ssh.enable = true; + backups.enable = true; + backups.path = "/holocron/backups"; sops.enable = true; docker.enable = true; syncthing.enable = true; # syncthing.mode = "server"; tailscale.enable = true; nvidia.enable = true; - backups.enable = true; }; homelab = { zfs.enable = true; diff --git a/modules/system/backups.nix b/modules/system/backups.nix index a0b9a92..b957643 100644 --- a/modules/system/backups.nix +++ b/modules/system/backups.nix @@ -26,7 +26,7 @@ in }; }; - config = lib.mkIf (backup_paths != []) { + config = lib.mkIf (cfg.enable && backup_paths != []) { systemd.services.backups = { description = "backup service with borg!"; path = [ pkgs.borgbackup ]; @@ -54,7 +54,7 @@ in --stats \ --show-rc \ --compression lz4 \ - "$BORG_REPO::$(hostname)-$(date +'%Y-%m-%dT%H:%M:%S')" \ + "$BORG_REPO::${config.networking.hostName)-$(date +'%Y-%m-%dT%H:%M:%S')" \ ${lib.concatStringsSep " " cfg.paths} # Prune old backups according to retention policy diff --git a/modules/system/default.nix b/modules/system/default.nix index 72b87bc..0569519 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -3,20 +3,20 @@ { imports = [ ./ssh.nix + ./backups.nix ./sops.nix ./docker.nix ./tailscale.nix ./syncthing.nix ./nvidia.nix - ./backups.nix ]; modules.system.ssh.enable = lib.mkDefault true; + modules.system.backups.enable = lib.mkDefault true; modules.system.sops.enable = lib.mkDefault true; modules.system.docker.enable = lib.mkDefault false; modules.system.tailscale.enable = lib.mkDefault true; modules.system.syncthing.enable = lib.mkDefault false; modules.system.nvidia.enable = lib.mkDefault false; - modules.system.backups.enable = lib.mkDefault false; }