storage-refactor #9
63 changed files with 81 additions and 78 deletions
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
config = lib.mkIf (config.impermanence.enable) {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"desktop"
|
||||
"downloads"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ in {
|
|||
# If impermanence is not enabled for this user but system impermanence is enabled,
|
||||
# persist the entire home directory as fallback
|
||||
(lib.mkIf (osConfig.storage.impermanence.enable && !cfg.enable && cfg.fallbackPersistence.enable) {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = ["."];
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
}
|
||||
)
|
||||
(lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
files = lib.lists.flatten (
|
||||
builtins.map (hostKey: [".ssh/${hostKey.path}" ".ssh/${hostKey.path}.pub"]) config.programs.openssh.hostKeys
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
config = lib.mkIf (config.programs.anki.enable && config.impermanence.enable) {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
".local/share/Anki2"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/Bitwarden"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/bruno/"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/calibre"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.dataHome}/DaVinciResolve"
|
||||
"${config.xdg.configHome}/blackmagic"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.dataHome}/DBeaverData/"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/discord/"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
};
|
||||
in {
|
||||
config = lib.mkIf (config.programs.firefox.enable && config.impermanence.enable) {
|
||||
home.persistence."/persist/home" = lib.mkMerge (
|
||||
home.persistence."/persist/replicate/home" = lib.mkMerge (
|
||||
(
|
||||
lib.attrsets.mapAttrsToList
|
||||
(profile: _: buildProfilePersistence profile)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/FreeCAD"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/GIMP"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
# configuration
|
||||
"${config.xdg.configHome}/JetBrains/"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/inkscape"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ in {
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/kdenliverc"
|
||||
"${config.xdg.dataHome}/kdenlive"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/kritarc"
|
||||
"${config.xdg.dataHome}/krita"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/libreoffice"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
".MakeMKV"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ in {
|
|||
}
|
||||
(
|
||||
mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/mapillary-uploader"
|
||||
"${config.xdg.dataHome}/mapillary-uploader"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
config = lib.mkIf config.programs.obs-studio.enable (lib.mkMerge [
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/obs-studio"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
config = lib.mkIf config.programs.obsidian.enable (lib.mkMerge [
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/obsidian"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ in {
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/olympus"
|
||||
"${config.xdg.dataHome}/olympus"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/OpenRGB"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/MusicBrainz"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/ProStudioMasters"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/protonvpn"
|
||||
"${config.xdg.configHome}/Proton"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/qBittorrent"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/qFlipper"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/Signal"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
{
|
||||
directory = "${config.xdg.dataHome}/Steam";
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.dataHome}/torbrowser"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/chromium"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
"${config.xdg.configHome}/via"
|
||||
"${config.xdg.dataHome}/via"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
}
|
||||
(
|
||||
lib.mkIf config.impermanence.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
home.persistence."/persist/replicate/home" = {
|
||||
directories = [
|
||||
{
|
||||
directory = ".vmware";
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.ollama.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."/var/lib/private/ollama" = {
|
||||
enable = true;
|
||||
owner.name = config.services.ollama.user;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.actual.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${dataDirectory}" = {
|
||||
owner.name = "actual";
|
||||
group.name = "actual";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.bazarr.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${bazarr_data_directory}" = {
|
||||
owner.name = "bazarr";
|
||||
group.name = "bazarr";
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.crab-hole.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${workingDirectory}" = {
|
||||
owner.name = "crab-hole";
|
||||
group.name = "crab-hole";
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.fail2ban.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${dataFolder}" = {
|
||||
owner.name = "fail2ban";
|
||||
group.name = "fail2ban";
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.flaresolverr.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."/var/lib/flaresolverr" = {
|
||||
owner.name = "flaresolverr";
|
||||
group.name = "flaresolverr";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.forgejo.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${stateDir}" = {
|
||||
owner.name = "forgejo";
|
||||
group.name = "forgejo";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.home-assistant.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${configDir}" = {
|
||||
owner.name = "hass";
|
||||
group.name = "hass";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.immich.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${mediaLocation}" = {
|
||||
owner.name = "immich";
|
||||
group.name = "immich";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.jackett.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${jackett_data_directory}" = {
|
||||
owner.name = "jackett";
|
||||
group.name = "jackett";
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ in {
|
|||
})
|
||||
(lib.mkIf config.services.jellyfin.impermanence.enable {
|
||||
storage.impermanence.datasets = {
|
||||
"persist/system/root" = {
|
||||
"persist/replicate/system/root" = {
|
||||
directories = {
|
||||
"${jellyfin_data_directory}" = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.lidarr.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${lidarr_data_directory}" = {
|
||||
owner.name = "lidarr";
|
||||
group.name = "lidarr";
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ in {
|
|||
);
|
||||
}
|
||||
# (lib.mkIf config.host.impermanence.enable {
|
||||
# environment.persistence."/persist/system/root" = {
|
||||
# environment.persistence."/persist/replicate/system/root" = {
|
||||
# enable = true;
|
||||
# hideMounts = true;
|
||||
# directories = [
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.panoramax.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."/var/lib/panoramax" = {
|
||||
owner.name = "panoramax";
|
||||
group.name = "panoramax";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.paperless.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${dataDir}" = {
|
||||
owner.name = "paperless";
|
||||
group.name = "paperless";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.postgresql.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${dataDir}" = {
|
||||
owner.name = "postgres";
|
||||
group.name = "postgres";
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ in {
|
|||
lib.mkIf config.services.qbittorrent.impermanence.enable
|
||||
{
|
||||
storage.impermanence.datasets = {
|
||||
"persist/system/root" = {
|
||||
"persist/replicate/system/root" = {
|
||||
directories."${qbittorent_profile_directory}" = {
|
||||
owner.name = "qbittorrent";
|
||||
group.name = "qbittorrent";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.radarr.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${radarr_data_directory}" = {
|
||||
owner.name = "radarr";
|
||||
group.name = "radarr";
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.reverseProxy.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${dataDir}" = {
|
||||
owner.name = "acme";
|
||||
group.name = "acme";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.sonarr.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${sonarr_data_directory}" = {
|
||||
owner.name = "sonarr";
|
||||
group.name = "sonarr";
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
systemd.services."wyoming-faster-whisper-en".serviceConfig.ProcSubset = lib.mkForce "all";
|
||||
}
|
||||
(lib.mkIf config.host.impermanence.enable {
|
||||
environment.persistence."/persist/system/root" = {
|
||||
environment.persistence."/persist/replicate/system/root" = {
|
||||
enable = true;
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.openssh.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
files = builtins.listToAttrs (
|
||||
lib.lists.flatten (
|
||||
builtins.map (hostKey: [
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ in {
|
|||
"var-lib-private-permissions" = {
|
||||
deps = ["specialfs"];
|
||||
text = ''
|
||||
mkdir -p /persist/system/root/var/lib/private
|
||||
chmod 0700 /persist/system/root/var/lib/private
|
||||
mkdir -p /persist/replicate/system/root/var/lib/private
|
||||
chmod 0700 /persist/replicate/system/root/var/lib/private
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
lib.mkIf config.storage.zfs.enable (lib.mkMerge [
|
||||
{
|
||||
storage.zfs.datasets = {
|
||||
"persist/system/nix" = {
|
||||
"persist/local/nix" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
|
|
@ -22,15 +22,12 @@
|
|||
atime = "off";
|
||||
relatime = "off";
|
||||
};
|
||||
"persist/system/var/log" = {
|
||||
"persist/replicate/system/var/log" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = "/var/log";
|
||||
};
|
||||
snapshot = {
|
||||
autoSnapshot = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -53,11 +50,11 @@
|
|||
})
|
||||
(lib.mkIf config.storage.impermanence.enable {
|
||||
boot.initrd.postResumeCommands = lib.mkAfter ''
|
||||
zfs rollback -r rpool/local/system/root@blank
|
||||
zfs rollback -r rpool/ephemeral/system/root@blank
|
||||
'';
|
||||
|
||||
storage.zfs.datasets = {
|
||||
"local/system/root" = {
|
||||
"ephemeral/system/root" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
|
|
@ -70,10 +67,13 @@
|
|||
};
|
||||
|
||||
storage.impermanence.datasets = {
|
||||
"persist/system/root" = {
|
||||
"persist/replicate/system/root" = {
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = "/persist/system/root";
|
||||
mountPoint = "/persist/replicate/system/root";
|
||||
};
|
||||
snapshot = {
|
||||
autoSnapshot = true;
|
||||
};
|
||||
directories = {
|
||||
"/var/lib/nixos".enable = true;
|
||||
|
|
@ -83,10 +83,13 @@
|
|||
"/etc/machine-id".enable = true;
|
||||
};
|
||||
};
|
||||
"persist/home" = {
|
||||
"persist/replicate/home" = {
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = "/persist/home";
|
||||
mountPoint = "/persist/replicate/home";
|
||||
};
|
||||
snapshot = {
|
||||
autoSnapshot = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ in {
|
|||
};
|
||||
cache = lib.mkOption {
|
||||
type = lib.types.listOf deviceType;
|
||||
default = {};
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ in {
|
|||
members = builtins.map (device: hashDisk device.device) vdev;
|
||||
})
|
||||
config.storage.zfs.pool.vdevs;
|
||||
cache = builtins.map (device: hashDisk device.device) (builtins.attrValues config.storage.zfs.pool.cache);
|
||||
cache = builtins.map (device: hashDisk device.device) config.storage.zfs.pool.cache;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ in {
|
|||
})
|
||||
config.services.syncthing.settings.folders;
|
||||
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories = {
|
||||
"${mountDir}" = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ in {
|
|||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.tailscale.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
directories."${tailscale_data_directory}" = {
|
||||
enable = true;
|
||||
owner.name = "root";
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ in {
|
|||
# sops age key needs to be available to pre persist for user generation
|
||||
storage.zfs.datasets = lib.mkMerge [
|
||||
{
|
||||
"local/system/sops" = {
|
||||
"persist/local/system/sops" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
|
|
@ -417,7 +417,7 @@ in {
|
|||
}
|
||||
(lib.mkMerge (
|
||||
builtins.map (user: {
|
||||
"local/home/${user.name}" = {
|
||||
"ephemeral/home/${user.name}" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
|
|
@ -432,7 +432,7 @@ in {
|
|||
|
||||
# Post resume commands to rollback user home datasets to blank snapshots
|
||||
boot.initrd.postResumeCommands = lib.mkAfter (
|
||||
lib.strings.concatLines (builtins.map (user: "zfs rollback -r rpool/local/home/${user.name}@blank")
|
||||
lib.strings.concatLines (builtins.map (user: "zfs rollback -r rpool/ephemeral/home/${user.name}@blank")
|
||||
normalUsers)
|
||||
);
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ in {
|
|||
systemd = {
|
||||
tmpfiles.rules =
|
||||
builtins.map (
|
||||
user: "d /persist/home/${user.name} 700 ${user.name} ${user.name} -"
|
||||
user: "d /persist/replicate/home/${user.name} 700 ${user.name} ${user.name} -"
|
||||
)
|
||||
normalUsers;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue