global/persist: generalize persist locations
This commit is contained in:
parent
f3c0423a92
commit
e84489f306
12 changed files with 39 additions and 93 deletions
20
modules/global/persist.nix
Normal file
20
modules/global/persist.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -20,5 +20,9 @@ in
|
|||
pulse.enable = true;
|
||||
alsa.enable = true;
|
||||
};
|
||||
|
||||
persist.directories = [
|
||||
"/var/lib/alsa"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -16,5 +16,8 @@ in
|
|||
};
|
||||
programs.dconf.enable = true;
|
||||
environment.systemPackages = with pkgs; [ virt-manager docker-compose ];
|
||||
persist.directories = [
|
||||
"/var/lib/libvirt"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue