mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-06-17 02:06:32 +05:30
refactor(boot): consolidate impermanence configuration options
This commit is contained in:
@@ -17,8 +17,29 @@
|
||||
];
|
||||
|
||||
tnix = {
|
||||
boot.secure-boot.enable = true;
|
||||
boot.impermanence.enable = true;
|
||||
boot = {
|
||||
secure-boot.enable = true;
|
||||
|
||||
impermanence = {
|
||||
enable = true;
|
||||
|
||||
home = {
|
||||
directories = [
|
||||
".config/sops"
|
||||
".local/share/nvim"
|
||||
".local/share/opencode"
|
||||
".local/share/zsh"
|
||||
".local/share/zoxide"
|
||||
".local/state/lazygit"
|
||||
];
|
||||
|
||||
files = [
|
||||
".wakatime.cfg"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.openssh.enable = true;
|
||||
|
||||
services = {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
userName,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -16,6 +17,28 @@
|
||||
|
||||
options.tnix.boot.impermanence = {
|
||||
enable = lib.mkEnableOption "Enable impermanence";
|
||||
|
||||
directories = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
files = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
options.tnix.boot.impermanence.home = {
|
||||
directories = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
files = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.impermanence.enable {
|
||||
@@ -27,13 +50,34 @@
|
||||
"/var/log"
|
||||
"/var/lib"
|
||||
"/etc/NetworkManager/system-connections"
|
||||
];
|
||||
]
|
||||
++ cfg.impermanence.directories;
|
||||
|
||||
files = [
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||
];
|
||||
]
|
||||
++ cfg.impermanence.files;
|
||||
};
|
||||
|
||||
home-manager.users.${userName} = {
|
||||
home.persistence."/persist" = {
|
||||
directories = [
|
||||
"Downloads"
|
||||
"Music"
|
||||
"Wallpapers"
|
||||
"Documents"
|
||||
"Videos"
|
||||
"Projects"
|
||||
"Stuff"
|
||||
".ssh"
|
||||
]
|
||||
++ cfg.impermanence.home.directories;
|
||||
|
||||
files = cfg.impermanence.home.files;
|
||||
};
|
||||
};
|
||||
|
||||
boot.initrd.systemd = {
|
||||
|
||||
Reference in New Issue
Block a user