chore: nixfmt *
This commit is contained in:
parent
aae3fd4090
commit
47c5c9dc56
161 changed files with 2693 additions and 3029 deletions
|
@ -1,9 +1,4 @@
|
|||
{ config
|
||||
, hostAddress
|
||||
, localAddress
|
||||
, subvolumes
|
||||
, targetPathSuffix ? ""
|
||||
}:
|
||||
{ config, hostAddress, localAddress, subvolumes, targetPathSuffix ? "" }:
|
||||
|
||||
let
|
||||
passwords = import ../../variables/passwords.crypt.nix;
|
||||
|
@ -13,14 +8,9 @@ in {
|
|||
config = { pkgs, ... }: {
|
||||
system.stateVersion = "20.03"; # Did you read the comment?
|
||||
|
||||
imports = [
|
||||
../profiles/containers/configuration.nix
|
||||
];
|
||||
imports = [ ../profiles/containers/configuration.nix ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
btrfs-progs
|
||||
btrbk
|
||||
];
|
||||
environment.systemPackages = with pkgs; [ btrfs-progs btrbk ];
|
||||
|
||||
networking.firewall.enable = true;
|
||||
|
||||
|
@ -28,17 +18,11 @@ in {
|
|||
enable = true;
|
||||
description = "bkp-sync service";
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
serviceConfig = { Type = "oneshot"; };
|
||||
|
||||
after = [
|
||||
"bkp-run.service"
|
||||
];
|
||||
after = [ "bkp-run.service" ];
|
||||
|
||||
requires = [
|
||||
"bkp-run.service"
|
||||
];
|
||||
requires = [ "bkp-run.service" ];
|
||||
|
||||
path = with pkgs; [ utillinux ];
|
||||
script = ''
|
||||
|
@ -51,17 +35,13 @@ in {
|
|||
enable = true;
|
||||
description = "bkp-run";
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
serviceConfig = { Type = "oneshot"; };
|
||||
|
||||
partOf = [
|
||||
"bkp-sync.service"
|
||||
];
|
||||
partOf = [ "bkp-sync.service" ];
|
||||
|
||||
path = with pkgs; [ btrfs-progs btrbk coreutils ];
|
||||
|
||||
script = let
|
||||
script = let
|
||||
btrbkConf = pkgs.writeText "cfg" ''
|
||||
timestamp_format long
|
||||
ssh_identity ${passwords.storage.backupTarget.keyPath}
|
||||
|
@ -78,7 +58,8 @@ in {
|
|||
|
||||
volume ${subvolumeParentDir}
|
||||
target ${passwords.storage.backupTarget.target}/container-volumes/${targetPathSuffix}
|
||||
${builtins.foldl' (sum: elem: sum + " subvolume " + elem + "\n") "" subvolumes}
|
||||
${builtins.foldl' (sum: elem: sum + " subvolume " + elem + "\n") ""
|
||||
subvolumes}
|
||||
'';
|
||||
in ''
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
|
@ -95,10 +76,10 @@ in {
|
|||
timerConfig = {
|
||||
# Obtained using `systemd-analyze calendar "Wed 23:00"`
|
||||
# OnCalendar = "Wed *-*-* 23:00:00";
|
||||
OnStartupSec="1m";
|
||||
OnStartupSec = "1m";
|
||||
Unit = "bkp-sync.service";
|
||||
OnUnitInactiveSec="2h";
|
||||
Persistent="true";
|
||||
OnUnitInactiveSec = "2h";
|
||||
Persistent = "true";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -122,13 +103,13 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
allowedDevices = [
|
||||
{ node = "/dev/fuse"; modifier = "rw"; }
|
||||
];
|
||||
allowedDevices = [{
|
||||
node = "/dev/fuse";
|
||||
modifier = "rw";
|
||||
}];
|
||||
|
||||
privateNetwork = true;
|
||||
forwardPorts = [
|
||||
];
|
||||
forwardPorts = [ ];
|
||||
|
||||
inherit hostAddress localAddress;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue