add backup

This commit is contained in:
Kopatz
2023-10-26 15:17:00 +02:00
parent eb7757f6b3
commit 224f1c3562
6 changed files with 30 additions and 0 deletions

View File

@@ -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
]; ];

View File

@@ -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

View File

@@ -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

View 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";
};
};
};
}

Binary file not shown.

View File

@@ -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 ];
} }