refactor: move all persistance to root binds

main
Ricard Illa 2023-06-25 11:26:04 +02:00
parent 9a7a73e3e0
commit 26440ac058
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
3 changed files with 84 additions and 84 deletions

View File

@ -86,6 +86,7 @@ in {
device = "/dev/mapper/data"; device = "/dev/mapper/data";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=vfs_share" "compress=zstd" ]; options = [ "subvol=vfs_share" "compress=zstd" ];
neededForBoot = true;
}; };
"/mnt/backups/0" = { "/mnt/backups/0" = {

View File

@ -84,88 +84,6 @@
./zsh ./zsh
]; ];
home.persistence = {
"/mnt/data/${config.home.homeDirectory}" = {
directories = [
"Audio"
"Calendars"
"Contacts"
"Documents"
"Downloads"
"Images"
"Maildir"
"Monero"
"code"
"misc"
"workspace"
];
allowOther = true;
};
"/mnt/vfs_share/${config.home.homeDirectory}" = {
directories = [ "vfs_share" ];
allowOther = true;
};
"/mnt/persist/${config.home.homeDirectory}" = {
directories = [
".Slic3r"
".abook"
".bitmonero"
".config/Element"
".config/Nextcloud"
".config/Signal"
".config/SuperCollider"
".config/ardour6"
".config/chromium"
".config/kdeconnect"
".config/kicad"
".config/nvim/plugin"
".config/syncthing"
".config/tea"
".config/whatsapp-for-linux"
".electrum"
".gnupg"
".hydrogen"
".john"
".kube"
".librewolf"
".local/share/Bisq"
".local/share/Nextcloud"
".local/share/Steam"
".local/share/SuperCollider"
".local/share/TelegramDesktop"
".local/share/nvim"
{
directory = ".local/share/containers";
method = "symlink";
}
".local/share/dino"
".local/share/direnv"
".local/share/gopass/stores"
".local/share/keyrings"
".local/share/mpd"
".local/share/tor-browser"
".local/share/webkitgtk"
".local/state/wireplumber"
".local/state/zsh"
".mozilla"
".newsboat"
".password-store"
".platformio"
".vagrant.d"
".vdirsyncer"
".virtualenvs"
".wine"
"Nextcloud"
"configs"
# ".cache"
];
files = [ ".mailsynclastrun" ".ssh/known_hosts" ".lmmsrc.xml" ];
allowOther = true;
};
};
home.sessionVariables = { home.sessionVariables = {
EDITOR = "${pkgs.neovim}/bin/nvim"; EDITOR = "${pkgs.neovim}/bin/nvim";
VISUAL = "${pkgs.neovim}/bin/nvim"; VISUAL = "${pkgs.neovim}/bin/nvim";

View File

@ -182,6 +182,7 @@
"plugdev" "plugdev"
"adbusers" "adbusers"
"video" "video"
"vboxusers"
]; ];
subUidRanges = [{ subUidRanges = [{
startUid = 100000; startUid = 100000;
@ -247,8 +248,12 @@
enable = true; enable = true;
defaultNetwork.settings.dns_enabled = true; defaultNetwork.settings.dns_enabled = true;
}; };
libvirtd.enable = true; libvirtd = {
enable = true;
allowedBridges = [ "virbr0" "virbr1" "virbr2" ];
};
spiceUSBRedirection.enable = true; spiceUSBRedirection.enable = true;
virtualbox.host.enable = true;
}; };
services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
@ -282,6 +287,7 @@
swapDevices = [{ device = "/swap/swapfile"; }]; swapDevices = [{ device = "/swap/swapfile"; }];
environment.persistence = { environment.persistence = {
"/mnt/persist" = { "/mnt/persist" = {
directories = [ directories = [
"/etc/NetworkManager/system-connections" "/etc/NetworkManager/system-connections"
@ -291,6 +297,58 @@
"/var/lib/docker" "/var/lib/docker"
"/var/lib/libvirt" "/var/lib/libvirt"
"/var/lib/systemd/coredump" "/var/lib/systemd/coredump"
"/home/rilla/.Slic3r"
"/home/rilla/.abook"
"/home/rilla/.bitmonero"
"/home/rilla/.config/Element"
"/home/rilla/.config/Nextcloud"
"/home/rilla/.config/Signal"
"/home/rilla/.config/SuperCollider"
"/home/rilla/.config/VirtualBox"
"/home/rilla/.config/ardour6"
"/home/rilla/.config/chromium"
"/home/rilla/.config/kdeconnect"
"/home/rilla/.config/kicad"
"/home/rilla/.config/nvim/plugin"
"/home/rilla/.config/syncthing"
"/home/rilla/.config/tea"
"/home/rilla/.config/whatsapp-for-linux"
"/home/rilla/.electrum"
"/home/rilla/.gnupg"
"/home/rilla/.hydrogen"
"/home/rilla/.john"
"/home/rilla/.kube"
"/home/rilla/.librewolf"
"/home/rilla/.local/share/Bisq"
"/home/rilla/.local/share/Nextcloud"
"/home/rilla/.local/share/Steam"
"/home/rilla/.local/share/SuperCollider"
"/home/rilla/.local/share/TelegramDesktop"
"/home/rilla/.local/share/containers"
"/home/rilla/.local/share/dino"
"/home/rilla/.local/share/direnv"
"/home/rilla/.local/share/gopass/stores"
"/home/rilla/.local/share/keyrings"
"/home/rilla/.local/share/mpd"
"/home/rilla/.local/share/nvim"
"/home/rilla/.local/share/tor-browser"
"/home/rilla/.local/share/webkitgtk"
"/home/rilla/.local/state/wireplumber"
"/home/rilla/.local/state/zsh"
"/home/rilla/.mozilla"
"/home/rilla/.newsboat"
"/home/rilla/.password-store"
"/home/rilla/.platformio"
"/home/rilla/.vagrant.d"
"/home/rilla/.vdirsyncer"
"/home/rilla/.virtualenvs"
"/home/rilla/.wine"
"/home/rilla/Nextcloud"
"/home/rilla/VirtualBox VMs"
"/home/rilla/configs"
# "/home/rilla/.cache"
]; ];
files = [ files = [
"/etc/machine-id" "/etc/machine-id"
@ -298,10 +356,30 @@
"/etc/ssh/ssh_host_ed25519_key.pub" "/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_ed25519_key-cert.pub" "/etc/ssh/ssh_host_ed25519_key-cert.pub"
"/etc/ssh/user_ca.pub" "/etc/ssh/user_ca.pub"
"/home/rilla/.lmmsrc.xml"
"/home/rilla/.mailsynclastrun"
"/home/rilla/.ssh/known_hosts"
]; ];
}; };
"/mnt/data" = { "/mnt/data" = {
directories = [ "/etc/luks-keys" ]; directories = [
"/etc/luks-keys"
"/home/rilla/Audio"
"/home/rilla/Calendars"
"/home/rilla/Contacts"
"/home/rilla/Documents"
"/home/rilla/Downloads"
"/home/rilla/Images"
"/home/rilla/Maildir"
"/home/rilla/Monero"
"/home/rilla/code"
"/home/rilla/misc"
"/home/rilla/workspace"
];
files = [ files = [
"/etc/btrbk/id_ed25519" "/etc/btrbk/id_ed25519"
"/etc/btrbk/id_ed25519.pub" "/etc/btrbk/id_ed25519.pub"
@ -309,6 +387,9 @@
]; ];
}; };
"/mnt/logs" = { directories = [ "/var/log" ]; }; "/mnt/logs" = { directories = [ "/var/log" ]; };
"/mnt/vfs_share" = {
directories = [ "/home/rilla/vfs_share" ];
};
}; };
# Open ports in the firewall. # Open ports in the firewall.