WIP home/borgmatic: correctly deduce system hostname from os config

Also add some TODOs for future me :^)
This commit is contained in:
2026-03-17 00:08:29 +01:00
parent ef35e06dfd
commit b23ebe640d

View File

@@ -1,19 +1,23 @@
{ {
flake.modules.homeManager.borgmatic = flake.modules.homeManager.borgmatic =
{ config { config
, osConfig
, pkgs , pkgs
, lib
, ... , ...
}: }:
let let
hostname = config.networking.hostname; hostname = osConfig.networking.hostName;
username = config.home.username; username = config.home.username;
in in
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
libnotify libnotify
borgmatic
]; ];
programs.borgmatic = { programs.borgmatic = {
enable = true;
backups.default = { backups.default = {
location = { location = {
repositories = [ repositories = [
@@ -25,6 +29,7 @@
excludeHomeManagerSymlinks = true; excludeHomeManagerSymlinks = true;
patterns = [ patterns = [
#TODO: home.homeDirectory might be usable here #TODO: home.homeDirectory might be usable here
#TODO: should be user and machine specific
"R /home/${username}/Documents" "R /home/${username}/Documents"
"R /home/${username}/.ssh" "R /home/${username}/.ssh"
"- /home/${username}/Documents/SteamLibrary" "- /home/${username}/Documents/SteamLibrary"
@@ -50,6 +55,8 @@
}; };
}; };
#TODO: there is a services.borgmatic
systemd.user.services.borgmatic = { systemd.user.services.borgmatic = {
Unit.Description = "Create a backup using borgmatic"; Unit.Description = "Create a backup using borgmatic";
Service.ExecStart = "${pkgs.borgmatic}/bin/borgmatic create --stats"; Service.ExecStart = "${pkgs.borgmatic}/bin/borgmatic create --stats";