fix(borg): fix build failure when no borg configs
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-03-01 21:45:20 -05:00
parent 25ab7c3b2d
commit 1470111ab2

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) filterAttrs mapAttrs mkDefault mkOption types; inherit (lib) filterAttrs mapAttrs mkDefault mkIf mkOption types;
cfg = config.services.borgbackup; cfg = config.services.borgbackup;
secrets = config.sops.secrets; secrets = config.sops.secrets;
@ -16,6 +16,7 @@ in {
}; };
configs = mkOption { configs = mkOption {
type = types.attrs; type = types.attrs;
default = {};
}; };
}; };
@ -25,7 +26,7 @@ in {
pve.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/4mrp8E4Ittwg8feRmPtDHSDR2+Pq4uZHeF5MweVcW"; pve.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/4mrp8E4Ittwg8feRmPtDHSDR2+Pq4uZHeF5MweVcW";
}; };
services.borgbackup = { services.borgbackup = mkIf (cfg.configs != {}) {
defaults = { defaults = {
environment = mkDefault {BORG_RSH = "ssh -i ${secrets.borg-ssh.path}";}; environment = mkDefault {BORG_RSH = "ssh -i ${secrets.borg-ssh.path}";};