* Move the modulesTree and modprobe options to the kernel.nix module.

svn path=/nixos/branches/modular-nixos/; revision=15747
This commit is contained in:
Eelco Dolstra 2009-05-27 09:57:30 +00:00
parent 690416cf1a
commit 700a1f8f21
3 changed files with 35 additions and 33 deletions

View File

@ -134,7 +134,42 @@ let
};
};
system.modulesTree = mkOption {
internal = true;
default = [];
description = "
Tree of kernel modules. This includes the kernel, plus modules
built outside of the kernel. Combine these into a single tree of
symlinks because modprobe only supports one directory.
";
merge = pkgs.lib.mergeListOption;
# Convert the list of path to only one path.
apply = pkgs.aggregateModules;
};
system.sbin.modprobe = mkOption {
# should be moved in module-init-tools
internal = true;
default = pkgs.writeTextFile {
name = "modprobe";
destination = "/sbin/modprobe";
executable = true;
text =
''
#! ${pkgs.stdenv.shell}
export MODULE_DIR=${config.system.modulesTree}/lib/modules
exec ${pkgs.module_init_tools}/sbin/modprobe "$@"
'';
};
description = ''
Wrapper around modprobe that sets the path to the modules
tree.
'';
};
};
in
###### implementation

View File

@ -1,3 +0,0 @@
#! @shell@
export MODULE_DIR=@modulesTree@/lib/modules
exec @module_init_tools@/sbin/modprobe "$@"

View File

@ -95,37 +95,7 @@ in
};
};
modulesTree = mkOption {
internal = true;
default = [];
description = "
Tree of kernel modules. This includes the kernel, plus modules
built outside of the kernel. Combine these into a single tree of
symlinks because modprobe only supports one directory.
";
merge = pkgs.lib.mergeListOption;
# Convert the list of path to only one path.
apply = pkgs.aggregateModules;
};
sbin = {
modprobe = mkOption {
# should be moved in module-init-tools
internal = true;
default = pkgs.substituteAll {
dir = "sbin";
src = ./modprobe;
isExecutable = true;
inherit (pkgs) module_init_tools;
inherit (config.system) modulesTree;
};
description = ''
Wrapper around modprobe that sets the path to the modules
tree.
'';
};
# !!! The mount option should not stay in /system/option.nix
mount = mkOption {
internal = true;