diff --git a/home/impermanence/default.nix b/home/impermanence/default.nix index 0c7f196..998659c 100644 --- a/home/impermanence/default.nix +++ b/home/impermanence/default.nix @@ -25,5 +25,18 @@ in { # Docker, etc. Requires NixOS configuration programs.fuse.userAllowOther = true; allowOther = true; }; + + home.persistence."${cfg.persistentDataMountPoint}" = { + directories = [ + + ] ++ cfg.extraDataDirectories; + + files = [ + + ] ++ cfg.extraDataFiles; + + # See comment for this above + allowOther = true; + }; }; } diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index e579cbc..e9b0e21 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -53,14 +53,6 @@ enable = true; persistentMountPoint = "/persist/home"; extraDirectories = [ - # Nixos flake - "dots" - - # Personal data - "Downloads" - "Personal" - "Media" - # Browsers ".mozilla" ".mullvad" @@ -95,6 +87,20 @@ ".config/pcmanfm-qt/default/recent-files.conf" ".config/qalculate/qalculate-gtk.cfg" ]; + + persistentDataMountPoint = "/data/Data"; + extraDataDirectories = [ + # Nixos flake + "dots" + + # XDG user dirs + "Downloads" + "Media" + + # Other personal data + "Personal" + ]; + extraDataFiles = []; }; # Configure automatic root subvolume wiping on boot from initrd diff --git a/options/system/impermanence.nix b/options/system/impermanence.nix index ff50350..a5fe4ff 100644 --- a/options/system/impermanence.nix +++ b/options/system/impermanence.nix @@ -60,7 +60,7 @@ in extraDirectories = mkOption { default = []; type = types.listOf types.str; - example = literalExpression ''["Downloads"]''; + example = literalExpression ''[".config/chromium"]''; description = '' Additional directories in home to link to persistent storage. ''; @@ -70,13 +70,46 @@ in default = "/persist/home"; description = '' Path to a persistent directory (usually a mount point to a - standalone partition / subvolume), which will hold the persistent + standalone partition or subvolume), which will hold the persistent system state files. - This does not expect any subdirectories, all of the persistent home files + This does not create any subdirectories, all of the persistent home files will be put directly in here. The user should be the owner of this direcotry. ''; }; + + persistentDataMountPoint = mkOption { + default = "/persist/home"; + description = '' + Path to a persistent directory (usually a mount point to a + standalone partition or subvolume), which will hold the persistent + data files. + + This does not create any subdirectories, all of the persistent home files + fill be put directly in here. The user should be the owner of this directory. + + If you don't wish to distinguish between data and system / configuration files, + you can point this to the same location. + ''; + }; + + extraDataFiles = mkOption { + default = []; + type = types.listOf types.str; + example = literalExpression ''["notes.txt"]''; + description = '' + Additional files in home to link to persistent data storage. + ''; + }; + + extraDataDirectories = mkOption { + default = []; + type = types.listOf types.str; + example = literalExpression ''["Downloads"]''; + description = '' + Additional directories in home to link to persistent data storage. + ''; + }; }; autoWipeBtrfs = let