introduce backup.dirs

This commit is contained in:
Your Name 2025-06-10 20:29:50 +02:00
commit 37370de57d
7 changed files with 87 additions and 18 deletions

37
homes/common/backup.nix Normal file
View file

@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}:
with lib;
with types;
{
options.backup = {
dirs = mkOption {
type = listOf string;
default = [ ];
description = ''
List of all folders that should be backed up.
Path is a String and must be the full path.
'';
example = [
"/home/palo/.ssh"
"/home/palo/.gnupg"
];
};
};
config = lib.mkMerge [
(lib.mkIf (config.backup.dirs != [ ]) {
home.file."backup.info".text = ''
Backup is not configured yet, but these folders need
to be backed up if you set one up.
${concatStringsSep "\n" (map (path: "- ${path}") (sort lessThan config.backup.dirs))}
'';
})
];
}

View file

@ -2,10 +2,11 @@
{
imports = [
./backup.nix
./editor.nix
./network.nix
./starship-rs
./packages.nix
./starship-rs
./terminal.nix
./zfs.nix
];

View file

@ -2,13 +2,14 @@
{
imports = [
../palo
./ssh.nix
./keymapper.nix
./ssh.nix
./taskwarrior.nix
];
gui.enable = true;
gui.bugwarrior.enable = false;
gui.mimeapps.enable = false;
home.username = "ingolf-wagner";
home.homeDirectory = "/home/ingolf-wagner";
@ -20,6 +21,7 @@
pkgs.xterm # just in case
pkgs.openconnect
pkgs.ferdium
pkgs.networkmanager-openconnect
];
home.shellAliases = {

View file

@ -1,4 +1,8 @@
{ lib, ... }:
{ lib, config, ... }:
{
programs.ssh.matchBlocks."*".identityFile = lib.mkForce "~/.ssh/ingolf.wagner@jobrad.org";
backup.dirs = [
"${config.home.homeDirectory}/.ssh"
];
}

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
{
programs.taskwarrior = {
enable = true;
@ -10,4 +10,9 @@
};
};
};
backup.dirs = [
config.programs.taskwarrior.dataLocation
"${config.xdg.configHome}/timewarrior"
];
}

View file

@ -8,6 +8,7 @@
./gpg.nix
./gui
./i3.nix
./mimeapps.nix
./packages
./ssh.nix
./stylix.nix
@ -24,20 +25,6 @@
settings.tree_view = true;
};
xdg.configFile."mimeapps.list".text = ''
[Default Applications]
text/html=browser-select.desktop
x-scheme-handler/http=browser-select.desktop
x-scheme-handler/https=browser-select.desktop
x-scheme-handler/about=browser-select.desktop
x-scheme-handler/mailto=thunderbird.desktop;
x-scheme-handler/unknown=browser-select.desktop
x-scheme-handler/postman=Postman.desktop
image/png=sxiv.desktop
image/jpeg=sxiv.desktop
x-scheme-handler/magnet=userapp-transmission-gtk-YPS6F2.desktop
'';
xdg.configFile."khal/config".text = ''
[calendars]

33
homes/palo/mimeapps.nix Normal file
View file

@ -0,0 +1,33 @@
{
pkgs,
lib,
config,
...
}:
with lib;
{
options.gui = {
mimeapps.enable = mkOption {
type = lib.types.bool;
default = config.gui.enable;
};
};
config = lib.mkMerge [
(lib.mkIf config.gui.mimeapps.enable {
xdg.configFile."mimeapps.list".text = ''
[Default Applications]
text/html=browser-select.desktop
x-scheme-handler/http=browser-select.desktop
x-scheme-handler/https=browser-select.desktop
x-scheme-handler/about=browser-select.desktop
x-scheme-handler/mailto=thunderbird.desktop;
x-scheme-handler/unknown=browser-select.desktop
x-scheme-handler/postman=Postman.desktop
image/png=sxiv.desktop
image/jpeg=sxiv.desktop
x-scheme-handler/magnet=userapp-transmission-gtk-YPS6F2.desktop
'';
})
];
}