mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Reformat nix files
This commit is contained in:
parent
292619386b
commit
600844c56d
2 changed files with 29 additions and 28 deletions
|
|
@ -2,11 +2,12 @@
|
|||
with lib;
|
||||
let
|
||||
cfg = config.services.custom-backup-job;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.services.custom-backup-job = {
|
||||
additionalReadWritePaths = mkOption {
|
||||
type = with types; listOf path;
|
||||
default = [];
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
additionalPreHook = mkOption {
|
||||
|
|
@ -21,30 +22,30 @@ in {
|
|||
};
|
||||
|
||||
config = {
|
||||
services.borgbackup.jobs.data = {
|
||||
paths = [ "/nix/var/data" ];
|
||||
doInit = false;
|
||||
repo = "backup@212.129.12.205:./";
|
||||
encryption = {
|
||||
mode = "repokey-blake2";
|
||||
passCommand = "cat /var/keys/borgbackup-passphrase";
|
||||
};
|
||||
readWritePaths = [
|
||||
"/var/keys/borgbackup-ssh-key"
|
||||
] ++ cfg.additionalReadWritePaths;
|
||||
preHook = ''
|
||||
#There is no way to specify the permissions on keys so we fix them here
|
||||
chmod 0600 /var/keys/borgbackup-ssh-key
|
||||
'' + cfg.additionalPreHook;
|
||||
environment = { BORG_RSH = "ssh -i /var/keys/borgbackup-ssh-key"; };
|
||||
compression = "lz4";
|
||||
startAt = cfg.startAt;
|
||||
prune.keep = {
|
||||
within = "2d";
|
||||
daily = 14;
|
||||
weekly = 8;
|
||||
monthly = 12;
|
||||
};
|
||||
};
|
||||
services.borgbackup.jobs.data = {
|
||||
paths = [ "/nix/var/data" ];
|
||||
doInit = false;
|
||||
repo = "backup@212.129.12.205:./";
|
||||
encryption = {
|
||||
mode = "repokey-blake2";
|
||||
passCommand = "cat /var/keys/borgbackup-passphrase";
|
||||
};
|
||||
readWritePaths = [
|
||||
"/var/keys/borgbackup-ssh-key"
|
||||
] ++ cfg.additionalReadWritePaths;
|
||||
preHook = ''
|
||||
#There is no way to specify the permissions on keys so we fix them here
|
||||
chmod 0600 /var/keys/borgbackup-ssh-key
|
||||
'' + cfg.additionalPreHook;
|
||||
environment = { BORG_RSH = "ssh -i /var/keys/borgbackup-ssh-key"; };
|
||||
compression = "lz4";
|
||||
startAt = cfg.startAt;
|
||||
prune.keep = {
|
||||
within = "2d";
|
||||
daily = 14;
|
||||
weekly = 8;
|
||||
monthly = 12;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
initialScript = "/var/keys/postgres-init.sql";
|
||||
enableTCPIP = true;
|
||||
identMap = ''
|
||||
root_as_others root synapse
|
||||
root_as_others root synapse
|
||||
'';
|
||||
authentication = ''
|
||||
local all postgres peer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue