feat(nixos): allow persistant locations to be disabled

This commit is contained in:
Bernardo Meurer 2023-05-14 16:59:19 -04:00
parent df1692e2d9
commit 5a39142bbb
No known key found for this signature in database

View file

@ -43,7 +43,7 @@ let
cfg = config.environment.persistence;
users = config.users.users;
allPersistentStoragePaths = { directories = [ ]; files = [ ]; users = [ ]; }
// (zipAttrsWith (_name: flatten) (attrValues cfg));
// (zipAttrsWith (_name: flatten) (filter (v: v.enable) (attrValues cfg)));
inherit (allPersistentStoragePaths) files directories;
mountFile = pkgs.runCommand "impermanence-mount-file" { buildInputs = [ pkgs.bash ]; } ''
cp ${./mount-file.bash} $out
@ -201,6 +201,11 @@ in
{
options =
{
enable = mkOption {
type = bool;
default = true;
description = "Whether to enable this persistent storage location.";
};
users = mkOption {
type = attrsOf (
submodule (