sane.fs: simplify

This commit is contained in:
2024-09-30 10:12:47 +00:00
parent 50c52683ff
commit e29842aa9d

View File

@@ -146,6 +146,8 @@ let
mkMountConfig = path: opt: let
fsEntry = config.fileSystems."${path}";
in {
# create the mount point, with desired acl
systemd.tmpfiles.settings."00-10-sane-fs"."${path}".d = opt.generated.acl;
fileSystems."${path}" = {
device = opt.mount.bind;
options = [
@@ -184,14 +186,10 @@ let
mkFsConfig = path: opt: lib.mkMerge (
[{
# satisfy mkTypedMerge
systemd.tmpfiles.settings."00-10-sane-fs" = {};
}]
++ lib.optional (opt.mount != null) (mkMountConfig path opt)
++ lib.optional (opt.dir != null) (mkDirConfig path opt)
++ lib.optional (opt.file != null) (mkFileConfig path opt)
++ lib.optional (opt.symlink != null) (mkSymlinkConfig path opt)
lib.optional (opt.mount != null) (mkMountConfig path opt)
++ lib.optional (opt.dir != null) (mkDirConfig path opt)
++ lib.optional (opt.file != null) (mkFileConfig path opt)
++ lib.optional (opt.symlink != null) (mkSymlinkConfig path opt)
);
# return all ancestors of this path.