mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 16:34:33 +00:00
Support persisting data separately from config
This commit is contained in:
parent
4a10a3536a
commit
507f364e5b
|
@ -25,5 +25,18 @@ in {
|
||||||
# Docker, etc. Requires NixOS configuration programs.fuse.userAllowOther = true;
|
# Docker, etc. Requires NixOS configuration programs.fuse.userAllowOther = true;
|
||||||
allowOther = true;
|
allowOther = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.persistence."${cfg.persistentDataMountPoint}" = {
|
||||||
|
directories = [
|
||||||
|
|
||||||
|
] ++ cfg.extraDataDirectories;
|
||||||
|
|
||||||
|
files = [
|
||||||
|
|
||||||
|
] ++ cfg.extraDataFiles;
|
||||||
|
|
||||||
|
# See comment for this above
|
||||||
|
allowOther = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,14 +53,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
persistentMountPoint = "/persist/home";
|
persistentMountPoint = "/persist/home";
|
||||||
extraDirectories = [
|
extraDirectories = [
|
||||||
# Nixos flake
|
|
||||||
"dots"
|
|
||||||
|
|
||||||
# Personal data
|
|
||||||
"Downloads"
|
|
||||||
"Personal"
|
|
||||||
"Media"
|
|
||||||
|
|
||||||
# Browsers
|
# Browsers
|
||||||
".mozilla"
|
".mozilla"
|
||||||
".mullvad"
|
".mullvad"
|
||||||
|
@ -95,6 +87,20 @@
|
||||||
".config/pcmanfm-qt/default/recent-files.conf"
|
".config/pcmanfm-qt/default/recent-files.conf"
|
||||||
".config/qalculate/qalculate-gtk.cfg"
|
".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
|
# Configure automatic root subvolume wiping on boot from initrd
|
||||||
|
|
|
@ -60,7 +60,7 @@ in
|
||||||
extraDirectories = mkOption {
|
extraDirectories = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
example = literalExpression ''["Downloads"]'';
|
example = literalExpression ''[".config/chromium"]'';
|
||||||
description = ''
|
description = ''
|
||||||
Additional directories in home to link to persistent storage.
|
Additional directories in home to link to persistent storage.
|
||||||
'';
|
'';
|
||||||
|
@ -70,13 +70,46 @@ in
|
||||||
default = "/persist/home";
|
default = "/persist/home";
|
||||||
description = ''
|
description = ''
|
||||||
Path to a persistent directory (usually a mount point to a
|
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.
|
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.
|
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
|
autoWipeBtrfs = let
|
||||||
|
|
Loading…
Reference in a new issue