Reformat nix files

This commit is contained in:
Paul-Henri Froidmont 2021-07-16 03:09:29 +02:00
parent 292619386b
commit 600844c56d
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
2 changed files with 29 additions and 28 deletions

View file

@ -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;
};
};
};
}

View file

@ -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