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

@ -10,28 +10,10 @@
persist = { persist = {
directories = [ directories = [
"/home"
"/etc/nixos"
"/etc/nixos-private"
# /var directories
"/var/log"
"/var/lib/bluetooth"
"/var/lib/systemd/coredump"
"/var/lib/tailscale"
"/var/lib/alsa"
"/srv" "/srv"
]; ];
files = [ files = [
"/etc/machine-id"
"/root/.local/share/nix/trusted-settings.json"
"/root/.ssh/known_hosts"
"/root/.ssh/id_ed25519"
"/root/.ssh/id_ed25519.pub"
"/root/.ssh/immutable_files.txt"
]; ];
}; };

View file

@ -10,27 +10,9 @@
persist = { persist = {
directories = [ directories = [
"/home"
"/etc/nixos"
"/etc/nixos-private"
"/root/.local/share/nix"
"/root/.ssh"
"/root/.cache/borg"
# /var directories
"/var/log"
"/var/lib/fprint"
"/var/lib/bluetooth"
"/var/lib/systemd/coredump"
"/var/lib/systemd/backlight"
"/var/lib/tailscale"
"/var/lib/alsa"
"/var/lib/libvirt"
]; ];
files = [ files = [
"/etc/machine-id"
]; ];
}; };

View file

@ -35,26 +35,10 @@
persist = { persist = {
directories = [ directories = [
"/home"
"/etc/nixos"
"/etc/nixos-private"
# /var directories
"/var/log"
"/var/lib/systemd/coredump"
"/var/lib/tailscale"
"/srv" "/srv"
]; ];
files = [ files = [
"/etc/machine-id"
"/root/.local/share/nix/trusted-settings.json"
"/root/.ssh/known_hosts"
"/root/.ssh/id_ed25519"
"/root/.ssh/id_ed25519.pub"
"/root/.ssh/immutable_files.txt"
]; ];
}; };

View file

@ -17,21 +17,9 @@
persist = { persist = {
directories = [ directories = [
"/home"
"/etc/nixos"
"/etc/nixos-private"
"/root/.local/share/nix"
"/root/.ssh"
# /var directories
"/var/log"
"/var/lib/systemd/coredump"
"/var/lib/tailscale"
]; ];
files = [ files = [
"/etc/machine-id"
]; ];
}; };

View file

@ -37,27 +37,10 @@
persist = { persist = {
directories = [ directories = [
"/home"
"/etc/nixos"
"/etc/nixos-private"
# /var directories
"/var/log"
"/var/lib/systemd/coredump"
"/var/lib/tailscale"
"/var/lib/thelounge"
"/srv" "/srv"
]; ];
files = [ files = [
"/etc/machine-id"
"/root/.local/share/nix/trusted-settings.json"
"/root/.ssh/known_hosts"
"/root/.ssh/id_ed25519"
"/root/.ssh/id_ed25519.pub"
"/root/.ssh/immutable_files.txt"
]; ];
}; };
} }

View file

@ -18,21 +18,9 @@
persist = { persist = {
directories = [ directories = [
"/home"
"/etc/nixos"
"/etc/nixos-private"
"/root/.local/share/nix"
"/root/.ssh"
# /var directories
"/var/log"
"/var/lib/systemd/coredump"
"/var/lib/tailscale"
]; ];
files = [ files = [
"/etc/machine-id"
]; ];
}; };

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; pulse.enable = true;
alsa.enable = true; alsa.enable = true;
}; };
persist.directories = [
"/var/lib/alsa"
];
}; };
} }

View file

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

View file

@ -8,4 +8,8 @@ in
options.modules.hardware.peripherals.fprint-sensor = mkOpt types.attrs { }; options.modules.hardware.peripherals.fprint-sensor = mkOpt types.attrs { };
config.services.fprintd = mkAliasDefinitions options.modules.hardware.peripherals.fprint-sensor; 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 { (mkIf cfg.bluetooth.enable {
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
services.blueman.enable = cfg.bluetooth.blueman.enable; services.blueman.enable = cfg.bluetooth.blueman.enable;
persist.directories = [
"/var/lib/bluetooth"
];
}) })
(mkIf cfg.wifi.enable { (mkIf cfg.wifi.enable {
networking.wireless = { networking.wireless = {

View file

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