Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/modules/security/lock-kernel-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ with lib;
if x.fsType == "vfat"
then [ "vfat" "nls-cp437" "nls-iso8859-1" ]
else [ x.fsType ]
else []) config.system.build.fileSystems;
else []) config.system.fileSystems;

systemd.services.disable-kernel-module-loading = rec {
description = "Disable kernel module loading";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/activation/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ in
system.build = mkOption {
internal = true;
default = {};
type = types.attrs;
type = with types; lazyAttrsOf unspecified;
description = ''
Attribute set of derivations used to setup the system.
'';
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/stage-1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let
# The initrd only has to mount `/` or any FS marked as necessary for
# booting (such as the FS containing `/nix/store`, or an FS needed for
# mounting `/`, like `/` on a loopback).
fileSystems = filter utils.fsNeededForBoot config.system.build.fileSystems;
fileSystems = filter utils.fsNeededForBoot config.system.fileSystems;

# A utility for enumerating the shared-library dependencies of a program
findLibs = pkgs.buildPackages.writeShellScriptBin "find-libs" ''
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/tasks/encrypted-devices.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with lib;

let
fileSystems = config.system.build.fileSystems ++ config.swapDevices;
fileSystems = config.system.fileSystems ++ config.swapDevices;
encDevs = filter (dev: dev.encrypted.enable) fileSystems;
keyedEncDevs = filter (dev: dev.encrypted.keyFile != null) encDevs;
keylessEncDevs = filter (dev: dev.encrypted.keyFile == null) encDevs;
Expand Down
11 changes: 10 additions & 1 deletion nixos/modules/tasks/filesystems.nix
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ in
'';
};

system.fileSystems = mkOption {
internal = true;
default = [];
type = with types; listOf unspecified;
description = ''
Topologically ordered list of config.fileSystems
'';
};

system.fsPackages = mkOption {
internal = true;
default = [ ];
Expand Down Expand Up @@ -223,7 +232,7 @@ in
];

# Export for use in other modules
system.build.fileSystems = fileSystems;
system.fileSystems = fileSystems;
system.build.earlyMountScript = makeSpecialMounts (toposort fsBefore (attrValues config.boot.specialFileSystems)).result;

boot.supportedFilesystems = map (fs: fs.fsType) fileSystems;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/tasks/filesystems/f2fs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ with lib;

let
inInitrd = any (fs: fs == "f2fs") config.boot.initrd.supportedFilesystems;
fileSystems = filter (x: x.fsType == "f2fs") config.system.build.fileSystems;
fileSystems = filter (x: x.fsType == "f2fs") config.build.fileSystems;
in
{
config = mkIf (any (fs: fs == "f2fs") config.boot.supportedFilesystems) {
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/tasks/filesystems/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let

fsToPool = fs: datasetToPool fs.device;

zfsFilesystems = filter (x: x.fsType == "zfs") config.system.build.fileSystems;
zfsFilesystems = filter (x: x.fsType == "zfs") config.system.fileSystems;

allPools = unique ((map fsToPool zfsFilesystems) ++ cfgZfs.extraPools);

Expand Down Expand Up @@ -467,7 +467,7 @@ in

systemd.services = let
getPoolFilesystems = pool:
filter (x: x.fsType == "zfs" && (fsToPool x) == pool) config.system.build.fileSystems;
filter (x: x.fsType == "zfs" && (fsToPool x) == pool) config.system.fileSystems;

getPoolMounts = pool:
let
Expand Down