tasks/backup-archive: migrate as ni's host-specific module

In practice, this is only used by it.
This commit is contained in:
Gabriel Arazas 2023-12-15 14:14:15 +08:00
parent 2f0d63ca95
commit 34047a49b4
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
7 changed files with 6 additions and 9 deletions

View File

@ -32,6 +32,7 @@
setup = "networkmanager";
wireguard.enable = true;
};
services.backup.enable = true;
setups = {
desktop.enable = true;
development.enable = true;

View File

@ -4,6 +4,7 @@
./hardware/qol.nix
./networking/setup.nix
./networking/wireguard.nix
./services/backup
./setups/desktop.nix
./setups/development.nix
./setups/gaming.nix

View File

@ -2,7 +2,8 @@
{ config, lib, pkgs, ... }:
let
cfg = config.tasks.backup-archive;
hostCfg = config.hosts.ni;
cfg = hostCfg.services.backup;
borgJobCommonSetting = { patterns ? [ ], passCommand }: {
compression = "zstd,12";
@ -42,12 +43,12 @@ let
pathPrefix = "borg-backup";
in
{
options.tasks.backup-archive.enable =
options.hosts.ni.services.backup.enable =
lib.mkEnableOption "backup setup with BorgBackup";
config = lib.mkIf cfg.enable {
sops.secrets = lib.getSecrets
(lib.getSecret "backup-archive.yaml")
./secrets.yaml
(lib.attachSopsPathPrefix pathPrefix {
"patterns/home" = { };
"patterns/etc" = { };

View File

@ -29,7 +29,6 @@ let
./profiles/i18n.nix
./profiles/server.nix
./profiles/vpn.nix
./tasks/backup-archive
./tasks/multimedia-archive
];
in

View File

@ -1,5 +0,0 @@
= BorgBackup setup for the archive
It's a NixOS configuration that configures my basic BorgBackup backup battlestation for my local archive.
Not all of the required files are here (i.e., the SSH key used for Borg).
In other words, if it's not yours, don't attempt to activate this setup.