chore: format with alejandra
This commit is contained in:
parent
05f0cbdfb4
commit
89f5f65f2d
181 changed files with 2720 additions and 2560 deletions
|
@ -1,17 +1,20 @@
|
|||
{ config, hostAddress, localAddress, subvolumes, targetPathSuffix ? ""
|
||||
, autoStart ? false }:
|
||||
|
||||
let
|
||||
{
|
||||
config,
|
||||
hostAddress,
|
||||
localAddress,
|
||||
subvolumes,
|
||||
targetPathSuffix ? "",
|
||||
autoStart ? false,
|
||||
}: let
|
||||
passwords = import ../../variables/passwords.crypt.nix;
|
||||
subvolumeParentDir = "/var/lib/container-volumes";
|
||||
|
||||
in {
|
||||
config = { pkgs, ... }: {
|
||||
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;
|
||||
|
||||
|
@ -19,13 +22,13 @@ 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 ];
|
||||
path = with pkgs; [utillinux];
|
||||
script = ''
|
||||
set -x
|
||||
true
|
||||
|
@ -36,11 +39,11 @@ 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 ];
|
||||
path = with pkgs; [btrfs-progs btrbk coreutils];
|
||||
|
||||
script = let
|
||||
btrbkConf = pkgs.writeText "cfg" ''
|
||||
|
@ -60,7 +63,7 @@ in {
|
|||
volume ${subvolumeParentDir}
|
||||
target ${passwords.storage.backupTarget.target}/container-volumes/${targetPathSuffix}
|
||||
${builtins.foldl' (sum: elem: sum + " subvolume " + elem + "\n") ""
|
||||
subvolumes}
|
||||
subvolumes}
|
||||
'';
|
||||
in ''
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
|
@ -73,7 +76,7 @@ in {
|
|||
systemd.timers."bkp" = {
|
||||
description = "Timer to trigger bkp periodically";
|
||||
enable = true;
|
||||
wantedBy = [ "timer.target" "multi-user.target" ];
|
||||
wantedBy = ["timer.target" "multi-user.target"];
|
||||
timerConfig = {
|
||||
# Obtained using `systemd-analyze calendar "Wed 23:00"`
|
||||
# OnCalendar = "Wed *-*-* 23:00:00";
|
||||
|
@ -104,15 +107,17 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
allowedDevices = [{
|
||||
node = "/dev/fuse";
|
||||
modifier = "rw";
|
||||
}];
|
||||
allowedDevices = [
|
||||
{
|
||||
node = "/dev/fuse";
|
||||
modifier = "rw";
|
||||
}
|
||||
];
|
||||
|
||||
extraFlags = [ "--resolv-conf=bind-host" ];
|
||||
extraFlags = ["--resolv-conf=bind-host"];
|
||||
|
||||
privateNetwork = true;
|
||||
forwardPorts = [ ];
|
||||
forwardPorts = [];
|
||||
|
||||
inherit hostAddress localAddress;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue