Remove pkgs argument of:

- boot.kernelPackages
- boot.extraModulePackages
- services.xserver.packageFun (should be renamed)
- fonts.extraFonts
- environment.extraPackages
- environment.nix

These options still accept the previous style.

svn path=/nixos/trunk/; revision=12551
This commit is contained in:
Nicolas Pierron 2008-08-08 18:57:07 +00:00
parent 9fc41fc64f
commit 51210b1904
4 changed files with 26 additions and 33 deletions

View File

@ -23,4 +23,4 @@
++ pkgs.lib.optional (config.fonts.enableGhostscriptFonts) "${pkgs.ghostscript}/share/ghostscript/fonts" ++ pkgs.lib.optional (config.fonts.enableGhostscriptFonts) "${pkgs.ghostscript}/share/ghostscript/fonts"
++ ((config.fonts.extraFonts) pkgs) ++ config.fonts.extraFonts

View File

@ -6,21 +6,14 @@ let
# temporary modifications. # temporary modifications.
# backward here means that expression could either be a value or a # backward here means that expression could either be a value or a
# function which expects to have a pkgs argument. Old merges are # function which expects to have a pkgs argument.
# currently used while removing pkgs arguments.
optionalPkgs = x: optionalPkgs = x:
if __isFunction x then x pkgs else x; if __isFunction x then x pkgs else x;
backwardPkgsFunListOldMerge = name: list: ignorePkgs: backwardPkgsFunListMerge = name: list:
backwardPkgsFunListNewMerge name list;
backwardPkgsFunListNewMerge = name: list:
pkgs.lib.concatMap optionalPkgs list; pkgs.lib.concatMap optionalPkgs list;
backwardPkgsFunOldMerge = name: list: ignorePkgs: backwardPkgsFunMerge = name: list:
backwardPkgsFunNewMerge name list;
backwardPkgsFunNewMerge = name: list:
if list != [] && tail list == [] if list != [] && tail list == []
then optionalPkgs (head list) then optionalPkgs (head list)
else abort "${name}: Defined at least twice."; else abort "${name}: Defined at least twice.";
@ -102,9 +95,9 @@ in
}; };
kernelPackages = mkOption { kernelPackages = mkOption {
default = pkgs: pkgs.kernelPackages; default = pkgs.kernelPackages;
example = pkgs: pkgs.kernelPackages_2_6_25; example = pkgs.kernelPackages_2_6_25;
merge = backwardPkgsFunOldMerge; merge = backwardPkgsFunMerge;
description = " description = "
This option allows you to override the Linux kernel used by This option allows you to override the Linux kernel used by
NixOS. Since things like external kernel module packages are NixOS. Since things like external kernel module packages are
@ -167,12 +160,12 @@ in
}; };
extraModulePackages = mkOption { extraModulePackages = mkOption {
default = pkgs: []; default = [];
# !!! example = pkgs: [pkgs.aufs pkgs.nvidiaDrivers]; # !!! example = [pkgs.aufs pkgs.nvidiaDrivers];
description = '' description = ''
A list of additional packages supplying kernel modules. A list of additional packages supplying kernel modules.
''; '';
merge = backwardPkgsFunListOldMerge; merge = backwardPkgsFunListMerge;
}; };
kernelModules = mkOption { kernelModules = mkOption {
@ -1407,8 +1400,8 @@ in
}; };
packageFun = mkOption { packageFun = mkOption {
default = pkgs: pkgs.xorg; default = pkgs.xorg;
merge = backwardPkgsFunOldMerge; merge = backwardPkgsFunMerge;
description = " description = "
Alternative X.org package to use. For Alternative X.org package to use. For
example, you can replace individual drivers. example, you can replace individual drivers.
@ -2701,8 +2694,8 @@ root ALL=(ALL) SETENV: ALL
}; };
extraFonts = mkOption { extraFonts = mkOption {
default = pkgs: []; default = [];
merge = backwardPkgsFunListOldMerge; merge = backwardPkgsFunListMerge;
description = " description = "
Function, returning list of additional fonts. Function, returning list of additional fonts.
"; ";
@ -2786,9 +2779,9 @@ root ALL=(ALL) SETENV: ALL
}; };
extraPackages = mkOption { extraPackages = mkOption {
default = pkgs: []; default = [];
example = pkgs: [pkgs.firefox pkgs.thunderbird]; example = [pkgs.firefox pkgs.thunderbird];
merge = backwardPkgsFunListOldMerge; merge = backwardPkgsFunListMerge;
description = " description = "
This option allows you to add additional packages to the system This option allows you to add additional packages to the system
path. These packages are automatically available to all users, path. These packages are automatically available to all users,
@ -2803,9 +2796,9 @@ root ALL=(ALL) SETENV: ALL
}; };
nix = mkOption { nix = mkOption {
default = pkgs: pkgs.nixUnstable; default = pkgs.nixUnstable;
example = pkgs: pkgs.nixCustomFun /root/nix.tar.gz; example = pkgs.nixCustomFun /root/nix.tar.gz;
merge = backwardPkgsFunOldMerge; merge = backwardPkgsFunMerge;
description = " description = "
Use non-default Nix easily. Be careful, though, not to break everything. Use non-default Nix easily. Be careful, though, not to break everything.
"; ";

View File

@ -29,9 +29,9 @@ rec {
manifests = config.installer.manifests; # exported here because nixos-rebuild uses it manifests = config.installer.manifests; # exported here because nixos-rebuild uses it
nix = config.environment.nix pkgs; nix = config.environment.nix;
kernelPackages = config.boot.kernelPackages pkgs; kernelPackages = config.boot.kernelPackages;
kernel = kernelPackages.kernel; kernel = kernelPackages.kernel;
@ -46,7 +46,7 @@ rec {
# !!! this should be declared by the xserver Upstart job. # !!! this should be declared by the xserver Upstart job.
++ pkgs.lib.optional (config.services.xserver.enable && config.services.xserver.videoDriver == "nvidia") kernelPackages.nvidiaDrivers ++ pkgs.lib.optional (config.services.xserver.enable && config.services.xserver.videoDriver == "nvidia") kernelPackages.nvidiaDrivers
++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007 ++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007
++ config.boot.extraModulePackages pkgs ++ config.boot.extraModulePackages
); );
@ -217,7 +217,7 @@ rec {
++ pkgs.lib.optional config.services.avahi.enable pkgs.avahi ++ pkgs.lib.optional config.services.avahi.enable pkgs.avahi
++ pkgs.lib.optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp ++ pkgs.lib.optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs) ++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs)
++ config.environment.extraPackages pkgs ++ config.environment.extraPackages
++ pkgs.lib.optional config.fonts.enableFontDir fontDir ++ pkgs.lib.optional config.fonts.enableFontDir fontDir
++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007 ++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007

View File

@ -10,7 +10,7 @@ let
# Abbreviations. # Abbreviations.
cfg = config.services.xserver; cfg = config.services.xserver;
xorg = cfg.packageFun pkgs; xorg = cfg.packageFun;
gnome = pkgs.gnome; gnome = pkgs.gnome;
stdenv = pkgs.stdenv; stdenv = pkgs.stdenv;