Skip generating bind mounts if no bind mounts are configured.

This fixes #105 by no longer generating an empty bash function. Empty
functions in bash are invalid, which cause the activation to fail.
This commit is contained in:
Rene Hollander 2023-04-15 09:38:56 +02:00
parent df1692e2d9
commit 6f4fc9d70c
No known key found for this signature in database
GPG key ID: ED042B77E4789F81

View file

@ -399,7 +399,7 @@ in
in
mkMerge [
(mkIf (any (path: cfg.${path}.directories != [ ]) persistentStoragePaths) {
(mkIf (any (path: (filter isSymlink cfg.${path}.directories) != [ ]) persistentStoragePaths) {
# Clean up existing empty directories in the way of links
cleanEmptyLinkTargets =
dag.entryBefore
@ -407,7 +407,8 @@ in
''
${concatMapStrings mkLinkCleanupForPath persistentStoragePaths}
'';
})
(mkIf (any (path: (filter isBindfs cfg.${path}.directories) != [ ]) persistentStoragePaths) {
createAndMountPersistentStoragePaths =
dag.entryBefore
[ "writeBoundary" ]