From 092626b75407fd0c2d8c243eae4ec8fcf7949c62 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sat, 13 Dec 2025 11:13:51 +0100 Subject: [PATCH] add borg client to thinkpad --- hosts/nixos/thinkpad/system.nix | 28 ++++++++++++++++++++++------ modules/ssh.nix | 19 +++++-------------- modules/syncthing.nix | 5 +---- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/hosts/nixos/thinkpad/system.nix b/hosts/nixos/thinkpad/system.nix index 115cedc..a67e1a9 100644 --- a/hosts/nixos/thinkpad/system.nix +++ b/hosts/nixos/thinkpad/system.nix @@ -8,7 +8,8 @@ ../../../modules/podman.nix ../../../modules/tailscale.nix ../../../modules/login-display.nix - ../../../modules/borg/server.nix + ../../../modules/borg/client.nix + ../../../modules/samba.nix ]; # Bootloader - standard UEFI setup @@ -192,15 +193,30 @@ "/dev/nvme0n1" = "System_SSD"; }; showDiskUsage = true; + showBorgStatus = true; }; - services.borg-server-custom = { + services.borg-client-custom = { enable = true; - users = { - borg = { - publicKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICp2goZiuSfwMA02GsHhYzUZHrQPPBgP5sWSNP9kQR3e yanlin@imac" ]; - }; + repositoryUrl = "ssh://borg-box/./thinkpad"; + backupPaths = [ + "/home/yanlin/immich/ext-library/" + "/home/yanlin/immich/photo-library/library/admin/" + "/home/yanlin/nsfw" + ]; + backupFrequency = "*-*-* 00:00:00"; + retention = { + keepDaily = 7; + keepWeekly = 4; + keepMonthly = 6; + keepYearly = 2; }; }; + services.samba-custom = { + sharedPath = "/home/yanlin/nsfw/"; + shareName = "nsfw"; + user = "yanlin"; + }; + } diff --git a/modules/ssh.nix b/modules/ssh.nix index c8af9e2..3153db4 100644 --- a/modules/ssh.nix +++ b/modules/ssh.nix @@ -30,15 +30,6 @@ identityFile = "~/Credentials/ssh_keys/aicloud"; }; - "hs" = { - hostname = "hs.yanlincs.com"; - user = "yanlin"; - identityFile = "~/Credentials/ssh_keys/nas"; - setEnv = { - TERM = "xterm-256color"; - }; - }; - "thinkpad" = { hostname = "thinkpad.yanlincs.com"; user = "yanlin"; @@ -54,11 +45,11 @@ identityFile = "~/Credentials/ssh_keys/hetzner"; }; - "borg-server" = { - hostname = "thinkpad.yanlincs.com"; - user = "borg"; - identityFile = "~/Credentials/ssh_keys/thinkpad"; - proxyJump = "vps"; + "borg-box" = { + hostname = "u518619.your-storagebox.de"; + user = "u518619"; + port = 23; + identityFile = "~/Credentials/ssh_keys/hetzner"; }; }; diff --git a/modules/syncthing.nix b/modules/syncthing.nix index 0d9b065..4c80267 100644 --- a/modules/syncthing.nix +++ b/modules/syncthing.nix @@ -22,7 +22,7 @@ let stignoreContent = lib.concatStringsSep "\n" commonIgnores; # Device groupings - pcDevices = [ "macbook" "imac" "hs" "thinkpad" ]; + pcDevices = [ "macbook" "imac" "thinkpad" ]; touchDevices = [ "iphone" "ipad" ]; allDevices = pcDevices ++ touchDevices; @@ -69,9 +69,6 @@ in "iphone" = { id = "NMWI5MP-J4FC4A6-SDDXZPD-G66TJCO-2W7KGFD-RJWQ53U-I7GUVWP-WHF4QQO"; }; - "hs" = { - id = "GH5D3DJ-PAGKBL6-3VDZJRT-QG4ZMRD-GHCCA3Y-HM2H5CE-NAMJYRR-VHLOOQH"; - }; "thinkpad" = { id = "OMZKASU-QPZDCQ2-7QRHRD4-3TPAXLM-AYRMWXB-A6E5OIZ-MGR422V-JYARQA6"; };