nixos: avoid side effects to fileSystems if possible

This is a good idea in itself.

Additionally, it avoids issues if users want to use mkDefault in their
fileSystems config and have no persistent directories.
This commit is contained in:
Lin Jian 2024-06-16 15:36:09 +08:00
parent 363b3e8622
commit 837e71297f
No known key found for this signature in database
GPG key ID: A6698D36434F75A5

View file

@ -506,9 +506,9 @@ in
in
foldl' recursiveUpdate { } (map mkPersistFileService files);
fileSystems = bindMounts;
fileSystems = mkIf (directories != [ ]) bindMounts;
# So the mounts still make it into a VM built from `system.build.vm`
virtualisation.fileSystems = bindMounts;
virtualisation.fileSystems = mkIf (directories != [ ]) bindMounts;
system.activationScripts =
let