Skip to content

Commit

Permalink
nixos: avoid side effects to fileSystems if possible
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jian-lin committed Jun 22, 2024
1 parent 363b3e8 commit 837e712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 837e712

Please sign in to comment.