nixos-generate-config: preserve vfat filesystem mount permissions

The default is to mount these world-readable, but that's a security risk
for the EFI System Partition.

Ref https://github.com/NixOS/nixpkgs/issues/279362.

Changed files
+11
nixos
modules
installer
+11
nixos/modules/installer/tools/nixos-generate-config.pl
···
}
}
+
# Preserve umask (fmask, dmask) settings for vfat filesystems.
+
# (The default is to mount these world-readable, but that's a security risk
+
# for the EFI System Partition.)
+
if ($fsType eq "vfat") {
+
for (@superOptions) {
+
if ($_ =~ /fmask|dmask/) {
+
push @extraOptions, $_;
+
}
+
}
+
}
+
# is this a stratis fs?
my $stableDevPath = findStableDevPath $device;
my $stratisPool;