From b23ebe640d06a398a693c5329cf5bde8aa09f0dd Mon Sep 17 00:00:00 2001 From: Weckyy702 Date: Tue, 17 Mar 2026 00:08:29 +0100 Subject: [PATCH] WIP home/borgmatic: correctly deduce system hostname from os config Also add some TODOs for future me :^) --- modules/services/borgmatic.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/services/borgmatic.nix b/modules/services/borgmatic.nix index c5dedc3..277acd8 100644 --- a/modules/services/borgmatic.nix +++ b/modules/services/borgmatic.nix @@ -1,19 +1,23 @@ { flake.modules.homeManager.borgmatic = { config + , osConfig , pkgs + , lib , ... }: let - hostname = config.networking.hostname; + hostname = osConfig.networking.hostName; username = config.home.username; in { home.packages = with pkgs; [ libnotify + borgmatic ]; programs.borgmatic = { + enable = true; backups.default = { location = { repositories = [ @@ -25,6 +29,7 @@ excludeHomeManagerSymlinks = true; patterns = [ #TODO: home.homeDirectory might be usable here + #TODO: should be user and machine specific "R /home/${username}/Documents" "R /home/${username}/.ssh" "- /home/${username}/Documents/SteamLibrary" @@ -50,6 +55,8 @@ }; }; + #TODO: there is a services.borgmatic + systemd.user.services.borgmatic = { Unit.Description = "Create a backup using borgmatic"; Service.ExecStart = "${pkgs.borgmatic}/bin/borgmatic create --stats";