File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{ config , pkgs , ... } :
22
3+ with pkgs . lib ;
4+
5+ let
6+ isConfig = x :
7+ builtins . isAttrs x || builtins . isFunction x ;
8+
9+ optCall = f : x :
10+ if builtins . isFunction f
11+ then f x
12+ else f ;
13+
14+ mergeConfig = lhs : rhs :
15+ lhs // rhs //
16+ optionalAttrs ( lhs ? packageOverrides ) {
17+ packageOverrides = pkgs :
18+ optCall lhs . packageOverrides pkgs //
19+ optCall ( attrByPath [ "packageOverrides" ] ( { } ) rhs ) pkgs ;
20+ } ;
21+
22+ configType = mkOptionType {
23+ name = "nixpkgs config" ;
24+ check = traceValIfNot isConfig ;
25+ merge = fold mergeConfig { } ;
26+ } ;
27+
28+ in
29+
330{
431 options = {
532
835 example = {
936 firefox . enableGeckoMediaPlayer = true ;
1037 } ;
38+ type = configType ;
1139 description = ''
12- The configuration of the Nix Packages collection.
40+ The configuration of the Nix Packages collection. This expression
41+ defines default value of attributes and allow packages to be
42+ overriden globally via the `packageOverrides'.
43+
44+ the `packageOverrides' configuration option must be a set of new or
45+ overriden packages. Any occurence of `pkgs' inside this attribute
46+ set refers to the *original* (un-overriden) set of packages,
47+ allowing packageOverrides attributes to refer to the original
48+ attributes (e.g. "packageOverrides.foo = ... pkgs.foo ...").
1349 '' ;
1450 } ;
1551
You can’t perform that action at this time.
0 commit comments