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;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.custom-backup-job;
|
cfg = config.services.custom-backup-job;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.custom-backup-job = {
|
options.services.custom-backup-job = {
|
||||||
additionalReadWritePaths = mkOption {
|
additionalReadWritePaths = mkOption {
|
||||||
type = with types; listOf path;
|
type = with types; listOf path;
|
||||||
default = [];
|
default = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
additionalPreHook = mkOption {
|
additionalPreHook = mkOption {
|
||||||
|
|
@ -21,30 +22,30 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
services.borgbackup.jobs.data = {
|
services.borgbackup.jobs.data = {
|
||||||
paths = [ "/nix/var/data" ];
|
paths = [ "/nix/var/data" ];
|
||||||
doInit = false;
|
doInit = false;
|
||||||
repo = "backup@212.129.12.205:./";
|
repo = "backup@212.129.12.205:./";
|
||||||
encryption = {
|
encryption = {
|
||||||
mode = "repokey-blake2";
|
mode = "repokey-blake2";
|
||||||
passCommand = "cat /var/keys/borgbackup-passphrase";
|
passCommand = "cat /var/keys/borgbackup-passphrase";
|
||||||
};
|
};
|
||||||
readWritePaths = [
|
readWritePaths = [
|
||||||
"/var/keys/borgbackup-ssh-key"
|
"/var/keys/borgbackup-ssh-key"
|
||||||
] ++ cfg.additionalReadWritePaths;
|
] ++ cfg.additionalReadWritePaths;
|
||||||
preHook = ''
|
preHook = ''
|
||||||
#There is no way to specify the permissions on keys so we fix them here
|
#There is no way to specify the permissions on keys so we fix them here
|
||||||
chmod 0600 /var/keys/borgbackup-ssh-key
|
chmod 0600 /var/keys/borgbackup-ssh-key
|
||||||
'' + cfg.additionalPreHook;
|
'' + cfg.additionalPreHook;
|
||||||
environment = { BORG_RSH = "ssh -i /var/keys/borgbackup-ssh-key"; };
|
environment = { BORG_RSH = "ssh -i /var/keys/borgbackup-ssh-key"; };
|
||||||
compression = "lz4";
|
compression = "lz4";
|
||||||
startAt = cfg.startAt;
|
startAt = cfg.startAt;
|
||||||
prune.keep = {
|
prune.keep = {
|
||||||
within = "2d";
|
within = "2d";
|
||||||
daily = 14;
|
daily = 14;
|
||||||
weekly = 8;
|
weekly = 8;
|
||||||
monthly = 12;
|
monthly = 12;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
initialScript = "/var/keys/postgres-init.sql";
|
initialScript = "/var/keys/postgres-init.sql";
|
||||||
enableTCPIP = true;
|
enableTCPIP = true;
|
||||||
identMap = ''
|
identMap = ''
|
||||||
root_as_others root synapse
|
root_as_others root synapse
|
||||||
'';
|
'';
|
||||||
authentication = ''
|
authentication = ''
|
||||||
local all postgres peer
|
local all postgres peer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue