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:
67
modules/services/borgmatic.nix
Normal file
67
modules/services/borgmatic.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/services/debuginfo.nix
Normal file
5
modules/services/debuginfo.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
flake.modules.nixos.debuginfod = {
|
||||
services.nixseparatedebuginfod2.enable = true;
|
||||
};
|
||||
}
|
||||
47
modules/services/kanata.nix
Normal file
47
modules/services/kanata.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/services/mullvad.nix
Normal file
5
modules/services/mullvad.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
flake.modules.nixos.mullvad = {
|
||||
services.mullvad-vpn.enable = true;
|
||||
};
|
||||
}
|
||||
6
modules/services/openssh.nix
Normal file
6
modules/services/openssh.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
flake.modules.nixos.openssh = { lib, ... }: {
|
||||
services.openssh.enable = true;
|
||||
services.openssh.openFirewall = lib.mkDefault false;
|
||||
};
|
||||
}
|
||||
9
modules/services/pipewire.nix
Normal file
9
modules/services/pipewire.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
flake.modules.nixos.pipewire = {
|
||||
services.pipewire = {
|
||||
alsa.enable = true;
|
||||
enable = true;
|
||||
wireplumber.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user