Refactor persistence structure
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -11,7 +11,7 @@ usage() {
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
if [ -d "/persist.bak" ]; then btrfs -q subvolume delete "/persist.bak"; fi
|
||||
if [ -d "/persist/user.bak" ]; then btrfs -q subvolume delete "/persist/user.bak"; fi
|
||||
if [ -n "$backup_location" ]; then rm -f "$backup_location.tmp"; fi
|
||||
|
||||
if [ -n "$mount_location" ]; then
|
||||
@@ -56,11 +56,11 @@ fi
|
||||
|
||||
backup_location="$backup_location/$(hostname)-$(date +%Y-%m-%d-%H-%M-%S).btrfs.gz"
|
||||
|
||||
echo "Creating /persist snapshot..."
|
||||
btrfs -q subvolume snapshot -r "/persist" "/persist.bak"
|
||||
echo "Creating /persist/user snapshot..."
|
||||
btrfs -q subvolume snapshot -r "/persist/user" "/persist/user.bak"
|
||||
|
||||
echo "Creating backup at $backup_location..."
|
||||
btrfs -q send "/persist.bak" | gzip > "$backup_location.tmp"
|
||||
btrfs -q send "/persist/user.bak" | gzip > "$backup_location.tmp"
|
||||
|
||||
mv "$backup_location.tmp" "$backup_location"
|
||||
|
||||
|
@@ -8,10 +8,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/persist"."/var/lib/bluetooth" = { };
|
||||
environment.persistence."/persist/state"."/var/lib/bluetooth" = { };
|
||||
|
||||
systemd.services.bluetooth.after = [
|
||||
config.environment.persistence."/persist"."/var/lib/bluetooth".mount
|
||||
config.environment.persistence."/persist/state"."/var/lib/bluetooth".mount
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [ { services.mpris-proxy.enable = config.services.pipewire.enable; } ];
|
||||
|
@@ -18,12 +18,12 @@
|
||||
};
|
||||
|
||||
environment = {
|
||||
persistence."/persist"."/var/lib/docker" = { };
|
||||
persistence."/persist/state"."/var/lib/docker" = { };
|
||||
systemPackages = with pkgs; [ docker-compose ];
|
||||
};
|
||||
|
||||
systemd = {
|
||||
services.docker.after = [ config.environment.persistence."/persist"."/var/lib/docker".mount ];
|
||||
sockets.docker.after = [ config.environment.persistence."/persist"."/var/lib/docker".mount ];
|
||||
services.docker.after = [ config.environment.persistence."/persist/state"."/var/lib/docker".mount ];
|
||||
sockets.docker.after = [ config.environment.persistence."/persist/state"."/var/lib/docker".mount ];
|
||||
};
|
||||
}
|
||||
|
@@ -38,11 +38,13 @@
|
||||
ln -s ${config.sops.secrets."machineId".path} $out
|
||||
'';
|
||||
|
||||
persistence."/persist" = {
|
||||
"/etc/nixos" = { };
|
||||
"/var/lib/nixos" = { };
|
||||
"/var/lib/systemd" = { };
|
||||
"/var/log" = { };
|
||||
persistence = {
|
||||
"/persist/user"."/etc/nixos" = { };
|
||||
"/persist/state" = {
|
||||
"/var/lib/nixos" = { };
|
||||
"/var/lib/systemd" = { };
|
||||
"/var/log" = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@
|
||||
"ovmf/edk2-i386-vars.fd".source =
|
||||
"${config.virtualisation.libvirtd.qemu.package}/share/qemu/edk2-i386-vars.fd";
|
||||
};
|
||||
persistence."/persist"."/var/lib/libvirt" = { };
|
||||
persistence."/persist/state"."/var/lib/libvirt" = { };
|
||||
};
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
|
@@ -2,9 +2,9 @@
|
||||
{
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
environment.persistence."/persist"."/etc/NetworkManager/system-connections" = { };
|
||||
environment.persistence."/persist/state"."/etc/NetworkManager/system-connections" = { };
|
||||
|
||||
systemd.services.NetworkManager.after = [
|
||||
config.environment.persistence."/persist"."/etc/NetworkManager/system-connections".mount
|
||||
config.environment.persistence."/persist/state"."/etc/NetworkManager/system-connections".mount
|
||||
];
|
||||
}
|
||||
|
@@ -63,8 +63,8 @@ prepare_disk() {
|
||||
}
|
||||
|
||||
copy_keys() {
|
||||
mkdir -p "$root/persist/etc/ssh"
|
||||
cp -f "$flake/hosts/$host/secrets/ssh_host_ed25519_key" "$root/persist/etc/ssh/ssh_host_ed25519_key"
|
||||
mkdir -p "$root/persist/state/etc/ssh"
|
||||
cp -f "$flake/hosts/$host/secrets/ssh_host_ed25519_key" "$root/persist/state/etc/ssh/ssh_host_ed25519_key"
|
||||
|
||||
for path in "$flake/hosts/$host/users"/*; do
|
||||
if [[ -z "$key" ]]; then
|
||||
@@ -73,8 +73,8 @@ copy_keys() {
|
||||
|
||||
local user
|
||||
user=$(basename "$path")
|
||||
mkdir -p "$root/persist/home/$user/.config/sops-nix"
|
||||
cp -f "$flake/secrets/$key/key.txt" "$root/persist/home/$user/.config/sops-nix/key.txt"
|
||||
mkdir -p "$root/persist/state/home/$user/.config/sops-nix"
|
||||
cp -f "$flake/secrets/$key/key.txt" "$root/persist/state/home/$user/.config/sops-nix/key.txt"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ set_permissions() {
|
||||
for path in "$flake/hosts/$host/users"/*; do
|
||||
local user
|
||||
user=$(basename "$path")
|
||||
chown -R "$(cat "$flake/hosts/$host/users/$user/uid"):100" "$root/persist/home/$user"
|
||||
chown -R "$(cat "$flake/hosts/$host/users/$user/uid"):100" "$root/persist/*/home/$user"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -92,8 +92,9 @@ install() {
|
||||
|
||||
copy_config() {
|
||||
echo "Copying configuration..."
|
||||
rm -rf "$root/persist/etc/nixos"
|
||||
cp -r "$flake" "$root/persist/etc/nixos"
|
||||
mkdir -p "$root/persist/user/etc/nixos"
|
||||
rm -rf "$root/persist/user/etc/nixos"
|
||||
cp -r "$flake" "$root/persist/user/etc/nixos"
|
||||
}
|
||||
|
||||
finish() {
|
||||
|
@@ -14,7 +14,7 @@
|
||||
};
|
||||
|
||||
environment = {
|
||||
persistence."/persist"."/var/lib/containers" = { };
|
||||
persistence."/persist/state"."/var/lib/containers" = { };
|
||||
|
||||
systemPackages = with pkgs; [
|
||||
podman-compose
|
||||
|
@@ -18,19 +18,19 @@
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/persist" = {
|
||||
environment.persistence."/persist/state" = {
|
||||
"/var/lib/cups/ppd" = { };
|
||||
"/var/lib/cups/printers.conf" = { };
|
||||
};
|
||||
|
||||
systemd = {
|
||||
services.cups.after = [
|
||||
config.environment.persistence."/persist"."/var/lib/cups/ppd".mount
|
||||
config.environment.persistence."/persist"."/var/lib/cups/printers.conf".mount
|
||||
config.environment.persistence."/persist/state"."/var/lib/cups/ppd".mount
|
||||
config.environment.persistence."/persist/state"."/var/lib/cups/printers.conf".mount
|
||||
];
|
||||
sockets.cups.after = [
|
||||
config.environment.persistence."/persist"."/var/lib/cups/ppd".mount
|
||||
config.environment.persistence."/persist"."/var/lib/cups/printers.conf".mount
|
||||
config.environment.persistence."/persist/state"."/var/lib/cups/ppd".mount
|
||||
config.environment.persistence."/persist/state"."/var/lib/cups/printers.conf".mount
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||
|
||||
environment = {
|
||||
persistence."/persist"."/etc/ssh/ssh_host_ed25519_key" = { };
|
||||
persistence."/persist/state"."/etc/ssh/ssh_host_ed25519_key" = { };
|
||||
|
||||
systemPackages = with pkgs; [
|
||||
sops
|
||||
@@ -22,7 +22,9 @@
|
||||
|
||||
age = {
|
||||
generateKey = true;
|
||||
sshKeyPaths = [ config.environment.persistence."/persist"."/etc/ssh/ssh_host_ed25519_key".source ];
|
||||
sshKeyPaths = [
|
||||
config.environment.persistence."/persist/state"."/etc/ssh/ssh_host_ed25519_key".source
|
||||
];
|
||||
keyFile = "/var/lib/sops-nix/key.txt";
|
||||
};
|
||||
};
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{
|
||||
environment = {
|
||||
enableAllTerminfo = true;
|
||||
persistence."/persist"."/var/lib/fail2ban" = { };
|
||||
persistence."/persist/state"."/var/lib/fail2ban" = { };
|
||||
};
|
||||
|
||||
services = {
|
||||
|
@@ -6,7 +6,7 @@
|
||||
};
|
||||
|
||||
environment = {
|
||||
persistence."/persist"."/var/lib/zsh" = { };
|
||||
persistence."/persist/state"."/var/lib/zsh" = { };
|
||||
pathsToLink = [ "/share/zsh" ];
|
||||
};
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
users.users.${user}.extraGroups = [ "adbusers" ];
|
||||
|
||||
environment.persistence."/persist" = {
|
||||
environment.persistence."/persist/state" = {
|
||||
"${home}/.local/share/android/adbkey" = { };
|
||||
"${home}/.local/share/android/adbkey.pub" = { };
|
||||
};
|
||||
|
@@ -14,7 +14,7 @@
|
||||
update_ms = 1000;
|
||||
proc_tree = true;
|
||||
cpu_single_graph = true;
|
||||
disks_filter = "/ /nix /persist /cache";
|
||||
disks_filter = "/ /nix /persist";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -37,14 +37,14 @@ lib.mkMerge [
|
||||
};
|
||||
}
|
||||
(lib.mkIf rootless {
|
||||
environment.persistence."/persist"."${home}/.local/share/docker" = { };
|
||||
environment.persistence."/persist/state"."${home}/.local/share/docker" = { };
|
||||
|
||||
systemd.user = {
|
||||
services.docker.after = [
|
||||
config.environment.persistence."/persist"."${home}/.local/share/docker".mount
|
||||
config.environment.persistence."/persist/state"."${home}/.local/share/docker".mount
|
||||
];
|
||||
sockets.docker.after = [
|
||||
config.environment.persistence."/persist"."${home}/.local/share/docker".mount
|
||||
config.environment.persistence."/persist/state"."${home}/.local/share/docker".mount
|
||||
];
|
||||
};
|
||||
})
|
||||
|
@@ -10,8 +10,8 @@
|
||||
}:
|
||||
{
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.kube" = { };
|
||||
"/cache"."${home}/.kube/cache" = { };
|
||||
"/persist/user"."${home}/.kube" = { };
|
||||
"/persist/cache"."${home}/.kube/cache" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
|
@@ -115,7 +115,7 @@
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.local/share/direnv/allow" = { };
|
||||
"/cache"."${home}/.cache/direnv" = { };
|
||||
"/persist/state"."${home}/.local/share/direnv/allow" = { };
|
||||
"/persist/cache"."${home}/.cache/direnv" = { };
|
||||
};
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
}:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/nix" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.cache/nix" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ nurl ];
|
||||
|
@@ -4,10 +4,10 @@
|
||||
}:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
environment.persistence."/persist"."${home}/.local/state/wireplumber" = { };
|
||||
environment.persistence."/persist/state"."${home}/.local/state/wireplumber" = { };
|
||||
|
||||
systemd.user.services.wireplumber.after = [
|
||||
config.environment.persistence."/persist"."${home}/.local/state/wireplumber".mount
|
||||
config.environment.persistence."/persist/state"."${home}/.local/state/wireplumber".mount
|
||||
];
|
||||
|
||||
home-manager.users.${user} = {
|
||||
|
@@ -9,7 +9,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment.persistence."/persist"."${home}/.local/share/containers" = { };
|
||||
environment.persistence."/persist/state"."${home}/.local/share/containers" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
imports = [ inputs.quadlet-nix.homeManagerModules.quadlet ];
|
||||
|
@@ -4,7 +4,7 @@
|
||||
}:
|
||||
{ ... }:
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/ranger" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.cache/ranger" = { };
|
||||
|
||||
home-manager.users.${user}.programs = {
|
||||
ranger = {
|
||||
|
@@ -4,14 +4,14 @@
|
||||
}:
|
||||
{ config, inputs, ... }:
|
||||
{
|
||||
environment.persistence."/persist"."${home}/.config/sops-nix/key.txt" = { };
|
||||
environment.persistence."/persist/state"."${home}/.config/sops-nix/key.txt" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
imports = [ inputs.sops-nix.homeManagerModules.sops ];
|
||||
|
||||
sops.age.keyFile =
|
||||
config.environment.persistence."/persist"."${home}/.config/sops-nix/key.txt".source;
|
||||
config.environment.persistence."/persist/state"."${home}/.config/sops-nix/key.txt".source;
|
||||
home.sessionVariables.SOPS_AGE_KEY_FILE =
|
||||
config.environment.persistence."/persist"."${home}/.config/sops-nix/key.txt".source;
|
||||
config.environment.persistence."/persist/state"."${home}/.config/sops-nix/key.txt".source;
|
||||
};
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
}:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
environment.persistence."/persist" = {
|
||||
environment.persistence."/persist/user" = {
|
||||
"${home}/Desktop" = { };
|
||||
"${home}/Documents" = { };
|
||||
"${home}/Downloads" = { };
|
||||
|
@@ -5,7 +5,7 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
environment = {
|
||||
persistence."/persist"."${home}/.local/share/zsh" = { };
|
||||
persistence."/persist/state"."${home}/.local/share/zsh" = { };
|
||||
# If we set this under home-manager.users.${user}.home.sessionVariables,
|
||||
# it runs too late in the init process and zsh fails.
|
||||
sessionVariables.ZDOTDIR = "$HOME/.config/zsh";
|
||||
|
@@ -20,8 +20,8 @@
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.config/chromium" = { };
|
||||
"/cache"."${home}/.cache/chromium" = { };
|
||||
"/persist/state"."${home}/.config/chromium" = { };
|
||||
"/persist/cache"."${home}/.cache/chromium" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
|
@@ -12,7 +12,7 @@ let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/cliphist" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.cache/cliphist" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ cliphist ];
|
||||
@@ -24,7 +24,7 @@ in
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/cliphist".mount
|
||||
config.environment.persistence."/persist/cache"."${home}/.cache/cliphist".mount
|
||||
];
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ in
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/cliphist".mount
|
||||
config.environment.persistence."/persist/cache"."${home}/.cache/cliphist".mount
|
||||
];
|
||||
};
|
||||
|
||||
|
@@ -23,11 +23,11 @@ in
|
||||
];
|
||||
|
||||
environment.persistence = {
|
||||
"/persist" = {
|
||||
"/persist/state" = {
|
||||
"${home}/.config/darktable/data.db" = { };
|
||||
"${home}/.config/darktable/library.db" = { };
|
||||
};
|
||||
"/cache"."${home}/.cache/darktable" = { };
|
||||
"/persist/cache"."${home}/.cache/darktable" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
}:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
environment.persistence."/persist"."${home}/.config/vesktop" = { };
|
||||
environment.persistence."/persist/state"."${home}/.config/vesktop" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ vesktop ];
|
||||
|
@@ -13,8 +13,8 @@ let
|
||||
in
|
||||
{
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.mozilla" = { };
|
||||
"/cache"."${home}/.cache/mozilla" = { };
|
||||
"/persist/state"."${home}/.mozilla" = { };
|
||||
"/persist/cache"."${home}/.cache/mozilla" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
|
@@ -12,7 +12,7 @@ let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/kitty" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.cache/kitty" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
programs.kitty = {
|
||||
|
@@ -10,8 +10,8 @@
|
||||
}:
|
||||
{
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.config/libreoffice/4/user" = { };
|
||||
"/cache"."${home}/.config/libreoffice/4/cache" = { };
|
||||
"/persist/state"."${home}/.config/libreoffice/4/user" = { };
|
||||
"/persist/cache"."${home}/.config/libreoffice/4/cache" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
|
@@ -13,7 +13,7 @@
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.config/obs-studio" = { };
|
||||
"/persist/state"."${home}/.config/obs-studio" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user}.programs.obs-studio.enable = true;
|
||||
|
@@ -15,7 +15,7 @@ let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.config/obsidian" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.config/obsidian" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
programs.obsidian = {
|
||||
@@ -605,9 +605,9 @@ in
|
||||
|
||||
theme.template = lib.attrsets.mapAttrs' (
|
||||
_: vault:
|
||||
lib.attrsets.nameValuePair
|
||||
"${vault.target}/.obsidian/plugins/obsidian-style-settings/data.json"
|
||||
{ source = ./theme.json; }
|
||||
lib.attrsets.nameValuePair "${vault.target}/.obsidian/plugins/obsidian-style-settings/data.json" {
|
||||
source = ./theme.json;
|
||||
}
|
||||
) hmConfig.programs.obsidian.vaults;
|
||||
|
||||
sops.secrets."google/geocoding".sopsFile = ../../../../../../secrets/personal/secrets.yaml;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.config/qalculate/qalculate-gtk.history" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.config/qalculate/qalculate-gtk.history" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ qalculate-gtk ];
|
||||
|
@@ -12,7 +12,7 @@ let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/rofi" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.cache/rofi" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
programs.rofi = {
|
||||
|
@@ -28,8 +28,8 @@ in
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.config/spotify" = { };
|
||||
"/cache"."${home}/.cache/spotify" = { };
|
||||
"/persist/state"."${home}/.config/spotify" = { };
|
||||
"/persist/cache"."${home}/.cache/spotify" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
|
@@ -9,7 +9,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment.persistence."/persist" = {
|
||||
environment.persistence."/persist/state" = {
|
||||
"${home}/.steam" = { };
|
||||
"${home}/.local/share/Steam" = { };
|
||||
};
|
||||
@@ -49,8 +49,8 @@
|
||||
Unit = {
|
||||
Description = "Sync Steam games with Games directory";
|
||||
After = [
|
||||
config.environment.persistence."/persist"."${home}/.local/share/Steam".mount
|
||||
config.environment.persistence."/persist"."${home}/Games".mount
|
||||
config.environment.persistence."/persist/state"."${home}/.local/share/Steam".mount
|
||||
config.environment.persistence."/persist/user"."${home}/Games".mount
|
||||
];
|
||||
DefaultDependencies = false;
|
||||
};
|
||||
@@ -67,8 +67,8 @@
|
||||
Unit = {
|
||||
Description = "Monitor Steam games directory for changes";
|
||||
After = [
|
||||
config.environment.persistence."/persist"."${home}/.local/share/Steam".mount
|
||||
config.environment.persistence."/persist"."${home}/Games".mount
|
||||
config.environment.persistence."/persist/state"."${home}/.local/share/Steam".mount
|
||||
config.environment.persistence."/persist/user"."${home}/Games".mount
|
||||
];
|
||||
};
|
||||
|
||||
|
@@ -26,7 +26,7 @@ let
|
||||
);
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/swww" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.cache/swww" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ swww ];
|
||||
@@ -37,7 +37,7 @@ in
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/swww".mount
|
||||
config.environment.persistence."/persist/cache"."${home}/.cache/swww".mount
|
||||
];
|
||||
};
|
||||
|
||||
|
@@ -14,7 +14,7 @@ let
|
||||
themeBin = lib.meta.getExe hmConfig.theme.pkg;
|
||||
in
|
||||
{
|
||||
environment.persistence."/persist"."${home}/.config/theme" = { };
|
||||
environment.persistence."/persist/state"."${home}/.config/theme" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
imports = [ (import ./options.nix { inherit user home; }) ];
|
||||
|
@@ -12,9 +12,9 @@ let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
# Bastard: https://github.com/microsoft/vscode/issues/3884
|
||||
# FIXME: https://github.com/microsoft/vscode/issues/3884
|
||||
# Also for Discord, but those guys are even bigger bastards.
|
||||
environment.persistence."/persist"."${home}/.config/Code" = { };
|
||||
environment.persistence."/persist/state"."${home}/.config/Code" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
@@ -59,12 +59,20 @@
|
||||
mountpoint = "/persist";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
"@persist/user" = {
|
||||
mountpoint = "/persist/user";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@cache" = {
|
||||
mountpoint = "/cache";
|
||||
"@persist/state" = {
|
||||
mountpoint = "/persist/state";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/cache" = {
|
||||
mountpoint = "/persist/cache";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
inherit mountOptions;
|
||||
};
|
||||
};
|
||||
|
@@ -59,12 +59,20 @@
|
||||
mountpoint = "/persist";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
"@persist/user" = {
|
||||
mountpoint = "/persist/user";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@cache" = {
|
||||
mountpoint = "/cache";
|
||||
"@persist/state" = {
|
||||
mountpoint = "/persist/state";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/cache" = {
|
||||
mountpoint = "/persist/cache";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
inherit mountOptions;
|
||||
};
|
||||
};
|
||||
|
@@ -4,7 +4,7 @@
|
||||
}:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.local/share/go" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.local/share/go" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
programs.go = {
|
||||
|
@@ -7,7 +7,7 @@ let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.local/share/gradle" = { };
|
||||
environment.persistence."/persist/cache"."${home}/.local/share/gradle" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
programs.gradle = {
|
||||
|
@@ -43,32 +43,39 @@
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
"@persist" = {
|
||||
mountpoint = "/persist";
|
||||
subvolumes =
|
||||
let
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"compress=zstd:1"
|
||||
"noatime"
|
||||
];
|
||||
in
|
||||
{
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist" = {
|
||||
mountpoint = "/persist";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/user" = {
|
||||
mountpoint = "/persist/user";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/state" = {
|
||||
mountpoint = "/persist/state";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/cache" = {
|
||||
mountpoint = "/persist/cache";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
inherit mountOptions;
|
||||
};
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@cache" = {
|
||||
mountpoint = "/cache";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@@ -91,7 +91,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/persist"."/etc/asusd/aura_19b6.ron" = { };
|
||||
environment.persistence."/persist/state"."/etc/asusd/aura_19b6.ron" = { };
|
||||
|
||||
programs.gamescope.env = {
|
||||
__NV_PRIME_RENDER_OFFLOAD = "1";
|
||||
|
@@ -51,12 +51,20 @@
|
||||
mountpoint = "/persist";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
"@persist/user" = {
|
||||
mountpoint = "/persist/user";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@cache" = {
|
||||
mountpoint = "/cache";
|
||||
"@persist/state" = {
|
||||
mountpoint = "/persist/state";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/cache" = {
|
||||
mountpoint = "/persist/cache";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
inherit mountOptions;
|
||||
};
|
||||
};
|
||||
|
@@ -74,7 +74,7 @@ cat <<'EOF' > "./hosts/$host/format.nix"
|
||||
{
|
||||
disko.devices = {
|
||||
disk.main = {
|
||||
device = ""; # Set this to the device you want to install to
|
||||
device = ""; # TODO: Set this to the device you want to install to
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
@@ -95,6 +95,14 @@ cat <<'EOF' > "./hosts/$host/format.nix"
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
name = "swap";
|
||||
size = ""; # TODO: Set this to the swap size you want
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
@@ -108,32 +116,39 @@ cat <<'EOF' > "./hosts/$host/format.nix"
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
"@persist" = {
|
||||
mountpoint = "/persist";
|
||||
subvolumes =
|
||||
let
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"compress=zstd:1"
|
||||
"noatime"
|
||||
];
|
||||
in
|
||||
{
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist" = {
|
||||
mountpoint = "/persist";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/user" = {
|
||||
mountpoint = "/persist/user";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/state" = {
|
||||
mountpoint = "/persist/state";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/cache" = {
|
||||
mountpoint = "/persist/cache";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
inherit mountOptions;
|
||||
};
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@cache" = {
|
||||
mountpoint = "/cache";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user