Add postgres bins to borgmatic environment
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m25s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m25s
This commit is contained in:
parent
296da660c0
commit
c25405ccbf
@ -1,33 +1,31 @@
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.modules.services.borgmatic;
|
||||
hostname = config.networking.hostName;
|
||||
in {
|
||||
options.modules.services.borgmatic = {
|
||||
enable = mkOption {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
description = mdDoc "Enable backups on this host with `borgmatic`";
|
||||
description = lib.mdDoc "Enable backups on this host with `borgmatic`";
|
||||
};
|
||||
directories = mkOption {
|
||||
type = types.listOf types.str;
|
||||
directories = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [];
|
||||
example = [
|
||||
"/home/jordan/Documents"
|
||||
];
|
||||
description = mdDoc "List of directories to backup";
|
||||
description = lib.mdDoc "List of directories to backup";
|
||||
};
|
||||
repoPath = mkOption {
|
||||
type = types.str;
|
||||
repoPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "ssh://example@example.repo.borgbase.com/./repo";
|
||||
description = mdDoc "Destination borg repository for backup";
|
||||
description = lib.mdDoc "Destination borg repository for backup";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
age.secrets."passwords/services/borg/${hostname}-passphrase" = {
|
||||
file = "${inputs.secrets}/passwords/services/borg/${hostname}-passphrase.age";
|
||||
};
|
||||
@ -47,6 +45,9 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
# Add `pg_dumpall` to unit environment
|
||||
systemd.services.borgmatic.path = [ pkgs.postgresql ];
|
||||
|
||||
# Without this override, `cat` is unavailable for `encryption_passcommand`
|
||||
systemd.services.borgmatic.confinement.fullUnit = true;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user