global/persist: generalize persist locations

This commit is contained in:
Infinidoge 2024-04-28 01:22:47 -04:00
parent f3c0423a92
commit e84489f306
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A
12 changed files with 39 additions and 93 deletions

View file

@ -0,0 +1,20 @@
{ config, lib, ... }:
with lib;
{
persist = {
directories = [
"/home"
"/etc/nixos"
"/etc/nixos-private"
"/var/log"
"/var/lib/systemd/coredump"
"/var/lib/tailscale"
"/root/.ssh"
];
files = [
"/etc/machine-id"
];
};
}

View file

@ -20,5 +20,9 @@ in
pulse.enable = true;
alsa.enable = true;
};
persist.directories = [
"/var/lib/alsa"
];
};
}

View file

@ -57,6 +57,10 @@ in
variables.LAPTOP = "True";
systemPackages = with pkgs; [ acpi brightnessctl ] ++ optional config.powerManagement.powertop.enable pkgs.powertop;
};
persist.directories = [
"/var/lib/systemd/backlight"
];
})
(mkIf cfg.portable {

View file

@ -8,4 +8,8 @@ in
options.modules.hardware.peripherals.fprint-sensor = mkOpt types.attrs { };
config.services.fprintd = mkAliasDefinitions options.modules.hardware.peripherals.fprint-sensor;
config.persist.directories = mkIf cfg.enable [
"/var/lib/fprint"
];
}

View file

@ -26,6 +26,10 @@ in
(mkIf cfg.bluetooth.enable {
hardware.bluetooth.enable = true;
services.blueman.enable = cfg.bluetooth.blueman.enable;
persist.directories = [
"/var/lib/bluetooth"
];
})
(mkIf cfg.wifi.enable {
networking.wireless = {

View file

@ -16,5 +16,8 @@ in
};
programs.dconf.enable = true;
environment.systemPackages = with pkgs; [ virt-manager docker-compose ];
persist.directories = [
"/var/lib/libvirt"
];
};
}