diff --git a/hosts/nixos/hs/system.nix b/hosts/nixos/hs/system.nix index c09dd9a..a66e022 100644 --- a/hosts/nixos/hs/system.nix +++ b/hosts/nixos/hs/system.nix @@ -253,7 +253,7 @@ # Borg backup configuration services.borg-client-custom = { enable = true; - repositoryUrl = "ssh://backup-box/./hs"; + repositoryUrl = "ssh://borg-server/./hs"; backupPaths = [ "/mnt/storage/appbulk/immich/library/" "/mnt/storage/Media/DCIM" diff --git a/hosts/nixos/thinkpad/system.nix b/hosts/nixos/thinkpad/system.nix index 0c700fc..3445239 100644 --- a/hosts/nixos/thinkpad/system.nix +++ b/hosts/nixos/thinkpad/system.nix @@ -6,7 +6,7 @@ ../system-default.nix ../../../modules/tailscale.nix ../../../modules/login-display.nix - ../../../modules/borg/client.nix + ../../../modules/borg/server.nix ]; # Bootloader - standard UEFI setup @@ -191,21 +191,12 @@ showBorgStatus = true; }; - # Borg backup configuration - services.borg-client-custom = { + services.borg-server-custom = { enable = true; - repositoryUrl = "ssh://backup-box/./thinkpad"; - backupPaths = [ - "/home/yanlin/Archive" - "/home/yanlin/Credentials" - "/home/yanlin/Documents" - ]; - backupFrequency = "*-*-* 00:00:00"; - retention = { - keepDaily = 7; - keepWeekly = 4; - keepMonthly = 6; - keepYearly = 2; + users = { + borg = { + publicKeys = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICp2goZiuSfwMA02GsHhYzUZHrQPPBgP5sWSNP9kQR3e yanlin@imac"; + }; }; }; diff --git a/modules/ssh.nix b/modules/ssh.nix index bc0c94e..9bb5d39 100644 --- a/modules/ssh.nix +++ b/modules/ssh.nix @@ -61,6 +61,12 @@ port = 23; }; + "borg-server" = { + hostname = "vpn.thinkpad.yanlincs.com"; + user = "borg"; + identityFile = "~/Credentials/ssh_keys/thinkpad"; + }; + }; }; }