WIP home/borgmatic: correctly deduce system hostname from os config
Also add some TODOs for future me :^)
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user