Remove duplication in linuxPackagesFor

It's silly to pass in self when we can do let self = whatever; in self.
This commit is contained in:
Shea Levy 2013-03-02 09:10:01 -05:00
parent 0a7d8a5175
commit 5d952411c6

View File

@ -6008,8 +6008,11 @@ let
for a specific kernel. This function can then be called for
whatever kernel you're using. */
linuxPackagesFor = kernel: self: let callPackage = newScope self; in rec {
linuxPackagesFor = kernel:
let
callPackage = newScope self;
self = {
inherit kernel;
acpi_call = callPackage ../os-specific/linux/acpi-call {};
@ -6019,16 +6022,16 @@ let
ati_drivers_x11 = callPackage ../os-specific/linux/ati-drivers { };
aufs =
if kernel.features ? aufs2 then
if self.kernel.features ? aufs2 then
callPackage ../os-specific/linux/aufs/2.nix { }
else if kernel.features ? aufs3 then
else if self.kernel.features ? aufs3 then
callPackage ../os-specific/linux/aufs/3.nix { }
else null;
aufs_util =
if kernel.features ? aufs2 then
if self.kernel.features ? aufs2 then
callPackage ../os-specific/linux/aufs-util/2.nix { }
else if kernel.features ? aufs3 then
else if self.kernel.features ? aufs3 then
callPackage ../os-specific/linux/aufs-util/3.nix { }
else null;
@ -6047,8 +6050,8 @@ let
iwlwifi = callPackage ../os-specific/linux/iwlwifi { };
iwlwifi4965ucode =
(if (builtins.compareVersions kernel.version "2.6.27" == 0)
|| (builtins.compareVersions kernel.version "2.6.27" == 1)
(if (builtins.compareVersions self.kernel.version "2.6.27" == 0)
|| (builtins.compareVersions self.kernel.version "2.6.27" == 1)
then iwlwifi4965ucodeV2
else iwlwifi4965ucodeV1);
@ -6076,9 +6079,9 @@ let
linuxHeaders = glibc.kernelHeaders;
};
splashutils = let hasFbConDecor = if kernel ? features
then kernel.features ? fbConDecor
else kernel.config.isEnabled "FB_CON_DECOR";
splashutils = let hasFbConDecor = if self.kernel ? features
then self.kernel.features ? fbConDecor
else self.kernel.config.isEnabled "FB_CON_DECOR";
in if hasFbConDecor then pkgs.splashutils else null;
/* compiles but has to be integrated into the kernel somehow
@ -6095,7 +6098,7 @@ let
};
systemtap = callPackage ../development/tools/profiling/systemtap {
linux = kernel;
linux = self.kernel;
inherit (gnome) libglademm;
};
@ -6112,16 +6115,17 @@ let
zfs = callPackage ../os-specific/linux/zfs/default.nix { };
};
in self;
# Build the kernel modules for the some of the kernels.
linuxPackages_2_6_32 = recurseIntoAttrs (linuxPackagesFor linux_2_6_32 pkgs.linuxPackages_2_6_32);
linuxPackages_2_6_35 = recurseIntoAttrs (linuxPackagesFor linux_2_6_35 pkgs.linuxPackages_2_6_35);
linuxPackages_3_0 = recurseIntoAttrs (linuxPackagesFor linux_3_0 pkgs.linuxPackages_3_0);
linuxPackages_3_2 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2 pkgs.linuxPackages_3_2);
linuxPackages_3_2_xen = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2_xen pkgs.linuxPackages_3_2_xen);
linuxPackages_3_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_4 pkgs.linuxPackages_3_4);
linuxPackages_3_7 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_7 pkgs.linuxPackages_3_7);
linuxPackages_3_8 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_8 pkgs.linuxPackages_3_8);
linuxPackages_2_6_32 = recurseIntoAttrs (linuxPackagesFor linux_2_6_32);
linuxPackages_2_6_35 = recurseIntoAttrs (linuxPackagesFor linux_2_6_35);
linuxPackages_3_0 = recurseIntoAttrs (linuxPackagesFor linux_3_0);
linuxPackages_3_2 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2);
linuxPackages_3_2_xen = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2_xen);
linuxPackages_3_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_4);
linuxPackages_3_7 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_7);
linuxPackages_3_8 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_8);
# The current default kernel / kernel modules.
linux = linuxPackages.kernel;