Update to (somewhat?) dendritic pattern

Heavily inspired by https://github.com/Doc-Steve/dendritic-design-with-flake-parts.

> Atomic commits? Never heard of them!
This commit is contained in:
Weckyy702
2026-03-15 15:04:47 +01:00
parent 5f41ff2b1b
commit e34b5ecce3
81 changed files with 1413 additions and 1073 deletions

View File

@@ -0,0 +1,67 @@
{
flake.modules.homeManager.borgmatic =
{ config
, pkgs
, ...
}:
let
hostname = config.networking.hostname;
username = config.home.username;
in
{
home.packages = with pkgs; [
libnotify
];
programs.borgmatic = {
backups.default = {
location = {
repositories = [
{
label = "duke";
path = "ssh://borg@duke.veltnet:2222/home/borg/backups/${hostname}-${username}";
}
];
excludeHomeManagerSymlinks = true;
patterns = [
#TODO: home.homeDirectory might be usable here
"R /home/${username}/Documents"
"R /home/${username}/.ssh"
"- /home/${username}/Documents/SteamLibrary"
"- /home/${username}/Documents/PrismLauncher instances"
"- /home/${username}/Documents/.Trash-1000"
"- /home/${username}/Documents/VMs/Data"
"- **/node_modules"
"- **/.git"
"- **/.cache"
"- **/*build"
"- **/target"
"- **/.venv"
"- **/venv"
"- **/.gradle"
"- **/out"
"- **/dist"
"- **/.pio"
];
};
retention.keepWeekly = 2;
storage.extraConfig.ssh_command = "ssh -i /home/${username}/.ssh/id_ed25519_borg";
#FIXME: consistency checks!!!
};
};
systemd.user.services.borgmatic = {
Unit.Description = "Create a backup using borgmatic";
Service.ExecStart = "${pkgs.borgmatic}/bin/borgmatic create --stats";
};
systemd.user.timers.borgmatic = {
Unit.Description = "Create weekly backups using borgmatic";
Timer = {
OnCalendar = "Weekly";
Persistent = true;
};
Install.WantedBy = [ "timers.target" ];
};
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.nixos.debuginfod = {
services.nixseparatedebuginfod2.enable = true;
};
}

View File

@@ -0,0 +1,47 @@
{
flake.modules.nixos.kanata = {
services.kanata = {
enable = true;
#TODO: move kanata config to module
keyboards.remap-specials = {
config = ''
(deflocalkeys-linux
ö 39
)
(defsrc
a s d j k l ö
)
(defvar
tap-time 200
hold-time 200
)
(defalias
a (tap-hold $tap-time $hold-time a lmet)
s (tap-hold $tap-time $hold-time s lctl)
d (tap-hold $tap-time $hold-time d lsft)
k (tap-hold $tap-time $hold-time k rsft)
l (tap-hold $tap-time $hold-time l rctl)
ö (tap-hold $tap-time $hold-time ö ralt)
activate (tap-dance $tap-time (j _ _ (layer-switch home-mods)))
deactivate (tap-dance $tap-time (j _ _ (layer-switch base)))
)
(deflayer base
a s d @activate k l ö
)
(deflayer home-mods
@a @s @d @deactivate @k @l @ö
)
'';
extraDefCfg = ''
process-unmapped-keys yes
'';
};
};
};
}

View File

@@ -0,0 +1,5 @@
{
flake.modules.nixos.mullvad = {
services.mullvad-vpn.enable = true;
};
}

View File

@@ -0,0 +1,6 @@
{
flake.modules.nixos.openssh = { lib, ... }: {
services.openssh.enable = true;
services.openssh.openFirewall = lib.mkDefault false;
};
}

View File

@@ -0,0 +1,9 @@
{
flake.modules.nixos.pipewire = {
services.pipewire = {
alsa.enable = true;
enable = true;
wireplumber.enable = true;
};
};
}