add backup
This commit is contained in:
@@ -110,6 +110,8 @@ in{
|
|||||||
inputs.agenix.packages."x86_64-linux".default
|
inputs.agenix.packages."x86_64-linux".default
|
||||||
btop
|
btop
|
||||||
shash
|
shash
|
||||||
|
gparted
|
||||||
|
restic
|
||||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||||
# wget
|
# wget
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
./modules/nextcloud.nix
|
./modules/nextcloud.nix
|
||||||
./modules/acme.nix
|
./modules/acme.nix
|
||||||
./modules/samba.nix
|
./modules/samba.nix
|
||||||
|
./modules/backup.nix
|
||||||
#./modules/dyndns.nix i think ddclient is deprecated
|
#./modules/dyndns.nix i think ddclient is deprecated
|
||||||
#./modules/home-assistant.nix idk dont like this
|
#./modules/home-assistant.nix idk dont like this
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fileSystems."/mnt/backup" =
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-uuid/8c49cdd0-78a0-45cc-93f1-4287524d20c3";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
|||||||
21
test-server/modules/backup.nix
Normal file
21
test-server/modules/backup.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{ config, pkgs, lib, inputs, ... }:
|
||||||
|
{
|
||||||
|
age.secrets.restic-pw = {
|
||||||
|
file = ../secrets/restic-pw.age;
|
||||||
|
};
|
||||||
|
services.restic = {
|
||||||
|
backups = {
|
||||||
|
localbackup = {
|
||||||
|
exclude = [
|
||||||
|
"/home/*/.cache"
|
||||||
|
];
|
||||||
|
initialize = true;
|
||||||
|
passwordFile = config.age.secrets.restic-pw.path;
|
||||||
|
paths = [
|
||||||
|
"/home"
|
||||||
|
];
|
||||||
|
repository = "/mnt/backup";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
BIN
test-server/secrets/restic-pw.age
Normal file
BIN
test-server/secrets/restic-pw.age
Normal file
Binary file not shown.
@@ -7,4 +7,5 @@ in
|
|||||||
"github-runner-pw.age".publicKeys = [ nix-test-vm ];
|
"github-runner-pw.age".publicKeys = [ nix-test-vm ];
|
||||||
"duckdns.age".publicKeys = [ nix-test-vm ];
|
"duckdns.age".publicKeys = [ nix-test-vm ];
|
||||||
"nextcloud-admin.age".publicKeys = [ nix-test-vm ];
|
"nextcloud-admin.age".publicKeys = [ nix-test-vm ];
|
||||||
|
"restic-pw.age".publicKeys = [ nix-test-vm ];
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user