diff options
author | makefu <github@syntax-fehler.de> | 2017-07-23 10:09:28 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2017-07-23 10:09:28 +0200 |
commit | 20d5077ba6f67ea0b73345248f048eafda6548e4 (patch) | |
tree | eeea3f4e06e017efbba2045fd41b8a4db83fcc42 /makefu | |
parent | 899b16848aade46804f70ea4ffec1e80c5bf6031 (diff) |
ma: refactor module loading of 5pkgs
Diffstat (limited to 'makefu')
-rw-r--r-- | makefu/5pkgs/default.nix | 40 | ||||
-rw-r--r-- | makefu/default.nix | 4 |
2 files changed, 22 insertions, 22 deletions
diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index d1b8fcc42..99f8cf864 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -1,25 +1,21 @@ -{ pkgs, ... }: - with import <stockholm/lib>; -{ - nixpkgs.config.packageOverrides = oldpkgs: let +self: super: let - # This callPackage will try to detect obsolete overrides. - callPackage = path: args: let - override = pkgs.callPackage path args; - upstream = optionalAttrs (override ? "name") - (oldpkgs.${(parseDrvName override.name).name} or {}); - in if upstream ? "name" && - override ? "name" && - compareVersions upstream.name override.name != -1 - then trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override - else override; + # This callPackage will try to detect obsolete overrides. + callPackage = path: args: let + override = super.callPackage path args; + upstream = optionalAttrs (override ? "name") + (super.${(parseDrvName override.name).name} or {}); + in if upstream ? "name" && + override ? "name" && + compareVersions upstream.name override.name != -1 + then + trace + "Upstream `${upstream.name}' gets overridden by `${override.name}'." + override + else override; - in {} - // mapAttrs (_: flip callPackage {}) - (filterAttrs (_: dir: pathExists (dir + "/default.nix")) - (subdirsOf ./.)) - // { +in { alsa-hdspconf = callPackage ./alsa-tools { alsaToolTarget="hdspconf";}; alsa-hdspmixer = callPackage ./alsa-tools { alsaToolTarget="hdspmixer";}; alsa-hdsploader = callPackage ./alsa-tools { alsaToolTarget="hdsploader";}; @@ -31,5 +27,9 @@ with import <stockholm/lib>; sha256 = "18ddzyh11bywrhzdkzvrl7nvgp5gdb4k1s0zxbz2bkhd14vi72bb"; }; }; - }; + } + +// mapAttrs (_: flip callPackage {}) + (filterAttrs (_: dir: pathExists (dir + "/default.nix")) + (subdirsOf ./.)) diff --git a/makefu/default.nix b/makefu/default.nix index b1c7c1be8..d077cc09f 100644 --- a/makefu/default.nix +++ b/makefu/default.nix @@ -1,9 +1,9 @@ -_: +{ pkgs, ... }: { imports = [ ../krebs ./2configs ./3modules - ./5pkgs ]; + nixpkgs.config.packageOverrides = import ./5pkgs pkgs; } |