mirror of
https://github.com/nix-community/impermanence
synced 2024-11-10 05:44:17 +00:00
feat(nixos): allow persistant locations to be disabled
This commit is contained in:
parent
df1692e2d9
commit
5a39142bbb
1 changed files with 6 additions and 1 deletions
|
@ -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 (
|
||||
|
|
Loading…
Reference in a new issue