Setup restic backup service; enable postgresql for general use
This commit is contained in:
6
nix/application/postgresql.nix
Normal file
6
nix/application/postgresql.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{ pkgs, config, ...}: {
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
settings.port = 5432;
|
||||
};
|
||||
}
|
@ -20,6 +20,9 @@
|
||||
miniflux.file = ../../secrets/miniflux.age;
|
||||
bitwarden-env.file = ../../secrets/bitwarden-env.age;
|
||||
transmission-env.file = ../../secrets/transmission-env.age;
|
||||
"restic/env".file = ../../secrets/restic/env.age;
|
||||
"restic/password".file = ../../secrets/restic/env.age;
|
||||
"restic/repo".file = ../../secrets/restic/env.age;
|
||||
};
|
||||
identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
};
|
||||
|
28
nix/system/backups.nix
Normal file
28
nix/system/backups.nix
Normal file
@ -0,0 +1,28 @@
|
||||
{ pkgs, config, ...}: {
|
||||
services.restic.backups = {
|
||||
daily = {
|
||||
initialize = true;
|
||||
|
||||
environmentFile = config.age.secrets."restic/env".path;
|
||||
passwordFile = config.age.secrets."restic/password".path;
|
||||
repository = "s3:https://s3.amazonaws.com/matricxbackups";
|
||||
|
||||
paths = [
|
||||
"${config.users.users.sezycei.home}/srv"
|
||||
"${config.users.users.sezycei.home}/nix"
|
||||
"${config.users.users.sezycei.home}/keys"
|
||||
"${config.users.users.sezycei.home}/dev"
|
||||
];
|
||||
|
||||
exclude = [
|
||||
"*minecraft/OLD*"
|
||||
];
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user