add a restic-server

This commit is contained in:
Andreas Zweili 2022-01-27 19:32:05 +01:00
parent 968d9792cf
commit b0f89b7a14
4 changed files with 19 additions and 11 deletions

View File

@ -197,12 +197,12 @@
./modules/unbound
];
backup = mkComputer
restic-server = mkComputer
(mkVM
{ hostname = "backup"; ip = "10.7.89.117"; inherit self; })
{ hostname = "server-server"; ip = "10.7.89.30"; inherit self; })
./home-manager/headless.nix
[
./modules/restic-share
./modules/restic-server
];
};
homeConfigurations = {

View File

@ -0,0 +1,15 @@
{ username, ... }:
let
repository = "/mnt/restic";
in
{
fileSystems.${repository} = {
device = "10.7.89.108:restic";
fsType = "nfs";
};
services.restic.server = {
enable = true;
dataDir = repository;
extraFlags = [ "--no-auth" ];
};
}

View File

@ -1,7 +0,0 @@
{ ... }:
{
fileSystems."/mnt/restic" = {
device = "10.7.89.108:restic";
fsType = "nfs";
};
}

View File

@ -2,7 +2,7 @@
{
services.restic.backups.${username} = {
user = username;
repository = "sftp:borg@10.7.89.117:restic";
repository = "rest:http://10.7.89.30:8000";
timerConfig.OnCalendar = "hourly";
passwordFile = "/home/${username}/.nixos/secrets/passwords/restic.key";
paths = [ "/home/${username}/" ];