This commit is contained in:
Joseph Hanson 2024-07-26 22:25:10 -05:00
parent 59e0545be0
commit e5ea595228
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
3 changed files with 64 additions and 19 deletions

View file

@ -93,26 +93,26 @@ in
# repo = "ssh://t3zvn0dd@t3zvn0dd.repo.borgbase.com/./repo";
# repoKeyPath = "/run/secrets/borgbackup/telchar";
# };
};
services = {
podman.enable = true;
libvirt-qemu.enable = true;
services = {
podman.enable = true;
libvirt-qemu.enable = true;
# Sanoid
sanoid = {
enable = true;
inherit (sanoidConfig.outputs) templates datasets;
};
# Sanoid
sanoid = {
enable = true;
inherit (sanoidConfig.outputs) templates datasets;
};
# Unifi & Lego-Auto
unifi.enable = true;
lego-auto = {
enable = true;
dnsimpleTokenPath = "${config.sops.secrets."lego/dnsimple/token".path}";
domains = "gandalf.jahanson.tech";
email = "joe@veri.dev";
provider = "dnsimple";
};
# Unifi & Lego-Auto
unifi.enable = true;
lego-auto = {
enable = true;
dnsimpleTokenPath = "${config.sops.secrets."lego/dnsimple/token".path}";
domains = "gandalf.jahanson.tech";
email = "joe@veri.dev";
provider = "dnsimple";
};
};
}
};
}

View file

@ -0,0 +1,44 @@
{ lib, config, ... }:
let
cfg = config.mySystem.system.borgbackup;
in
{
options.mySystem.system.borgbackup = {
enable = lib.mkEnableOption "borgbackup";
paths = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
required = true;
};
exclude = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
required = false;
};
repo = lib.mkOption {
example = "borgbackup@myserver:repo";
type = lib.types.str;
default = "";
required = true;
};
repoKeyPath = lib.mkOption {
example = "/run/secrets/borgbackup/telchar";
type = lib.types.str;
default = "";
required = false;
};
};
config = lib.mkIf cfg.enable {
services.borgbackup.jobs."borgbackup" = {
paths = cfg.paths;
exclude = cfg.exclude;
repo = cfg.repo;
encryption = {
mode = "repokey-blake2";
passCommand = "cat ${cfg.repoKeyPath}";
};
environment.BORG_RSH = "ssh -i /etc/ssh/ssh_host_ed25519_key";
};
};
}

View file

@ -1,5 +1,6 @@
{
imports = [
./borg
./impermanence.nix
./motd
./nix.nix