mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-06-17 10:16:31 +05:30
refactor(boot): consolidate impermanence configuration options
This commit is contained in:
@@ -17,8 +17,29 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
tnix = {
|
tnix = {
|
||||||
boot.secure-boot.enable = true;
|
boot = {
|
||||||
boot.impermanence.enable = true;
|
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;
|
networking.openssh.enable = true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
userName,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -16,6 +17,28 @@
|
|||||||
|
|
||||||
options.tnix.boot.impermanence = {
|
options.tnix.boot.impermanence = {
|
||||||
enable = lib.mkEnableOption "Enable 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 {
|
config = lib.mkIf cfg.impermanence.enable {
|
||||||
@@ -27,13 +50,34 @@
|
|||||||
"/var/log"
|
"/var/log"
|
||||||
"/var/lib"
|
"/var/lib"
|
||||||
"/etc/NetworkManager/system-connections"
|
"/etc/NetworkManager/system-connections"
|
||||||
];
|
]
|
||||||
|
++ cfg.impermanence.directories;
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
"/etc/ssh/ssh_host_rsa_key"
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
"/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 = {
|
boot.initrd.systemd = {
|
||||||
|
|||||||
Reference in New Issue
Block a user