forked from mirrors/nixpkgs
* Move the `optional' function to lib.
svn path=/nixpkgs/trunk/; revision=8720
This commit is contained in:
parent
978a82c5f4
commit
14c0ae4055
|
@ -107,5 +107,11 @@ rec {
|
||||||
);
|
);
|
||||||
in src: builtins.filterSource filter src;
|
in src: builtins.filterSource filter src;
|
||||||
|
|
||||||
|
|
||||||
|
# Return a singleton list or an empty list, depending on a boolean
|
||||||
|
# value. Useful when building lists with optional elements
|
||||||
|
# (e.g. `++ optional (system == "i686-linux") flashplayer').
|
||||||
|
optional = cond: elem: if cond then [elem] else [];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,8 +166,6 @@ rec {
|
||||||
meta = (if drv ? meta then drv.meta else {}) // {priority = "10";};
|
meta = (if drv ? meta then drv.meta else {}) // {priority = "10";};
|
||||||
};
|
};
|
||||||
|
|
||||||
optional = cond: elem: if cond then [elem] else [];
|
|
||||||
|
|
||||||
|
|
||||||
### STANDARD ENVIRONMENT
|
### STANDARD ENVIRONMENT
|
||||||
|
|
||||||
|
@ -2968,10 +2966,10 @@ rec {
|
||||||
plugins = [
|
plugins = [
|
||||||
MPlayerPlugin
|
MPlayerPlugin
|
||||||
]
|
]
|
||||||
++ optional (system == "i686-linux") flashplayer
|
++ lib.optional (system == "i686-linux") flashplayer
|
||||||
# RealPlayer is disabled by default for legal reasons.
|
# RealPlayer is disabled by default for legal reasons.
|
||||||
++ optional (system != "i686-linux" && getConfig ["firefox" "enableRealPlayer"] false) RealPlayer
|
++ lib.optional (system != "i686-linux" && getConfig ["firefox" "enableRealPlayer"] false) RealPlayer
|
||||||
++ optional (supportsJDK && jrePlugin ? mozillaPlugin) jrePlugin;
|
++ lib.optional (supportsJDK && jrePlugin ? mozillaPlugin) jrePlugin;
|
||||||
};
|
};
|
||||||
|
|
||||||
xara = import ../applications/graphics/xara {
|
xara = import ../applications/graphics/xara {
|
||||||
|
|
Loading…
Reference in a new issue