mirror of
https://github.com/kmein/niveum
synced 2026-03-21 20:31:07 +01:00
feat: restic
This commit is contained in:
11
configs/backup.nix
Normal file
11
configs/backup.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
services.restic.backups.niveum = {
|
||||||
|
initialize = true;
|
||||||
|
repository = "rest:http://zaatar.r:3571/";
|
||||||
|
timerConfig = { OnCalendar = "00:05"; RandomizedDelaySec = "5h"; };
|
||||||
|
passwordFile = toString <secrets/restic/password>;
|
||||||
|
paths = [
|
||||||
|
"/home/kfm/work"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -194,6 +194,7 @@ in {
|
|||||||
}) localAddresses;
|
}) localAddresses;
|
||||||
}
|
}
|
||||||
./alacritty.nix
|
./alacritty.nix
|
||||||
|
./backup.nix
|
||||||
./bash.nix
|
./bash.nix
|
||||||
./beets.nix
|
./beets.nix
|
||||||
./bluetooth.nix
|
./bluetooth.nix
|
||||||
|
|||||||
31
systems/zaatar/backup.nix
Normal file
31
systems/zaatar/backup.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
resticPort = 3571;
|
||||||
|
niveumLib = import <niveum/lib>;
|
||||||
|
inherit (niveumLib) retiolumAddresses;
|
||||||
|
firewall = niveumLib.firewall lib;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.restic.server = {
|
||||||
|
enable = true;
|
||||||
|
appendOnly = true;
|
||||||
|
dataDir = "/backup/restic";
|
||||||
|
prometheus = true;
|
||||||
|
extraFlags = [ "--no-auth" "--prometheus-no-auth" ]; # auth is done via firewall
|
||||||
|
listenAddress = ":${toString resticPort}";
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall =
|
||||||
|
let
|
||||||
|
dport = resticPort;
|
||||||
|
protocol = "tcp";
|
||||||
|
rules = [
|
||||||
|
(firewall.accept { inherit dport protocol; source = retiolumAddresses.kabsa.ipv4; })
|
||||||
|
(firewall.accept { inherit dport protocol; source = retiolumAddresses.manakish.ipv4; })
|
||||||
|
(firewall.accept { inherit dport protocol; source = retiolumAddresses.makanek.ipv4; })
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
extraCommands = firewall.addRules rules;
|
||||||
|
extraStopCommands = firewall.removeRules rules;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./backup.nix
|
||||||
./gaslight.nix
|
./gaslight.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./kiosk.nix
|
./kiosk.nix
|
||||||
|
|||||||
Reference in New Issue
Block a user