2009-08-26 09:52:38 -07:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2011-09-05 02:19:59 -07:00
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
isConfig = x:
|
|
|
|
builtins.isAttrs x || builtins.isFunction x;
|
|
|
|
|
|
|
|
optCall = f: x:
|
|
|
|
if builtins.isFunction f
|
|
|
|
then f x
|
|
|
|
else f;
|
|
|
|
|
|
|
|
mergeConfig = lhs: rhs:
|
|
|
|
lhs // rhs //
|
|
|
|
optionalAttrs (lhs ? packageOverrides) {
|
|
|
|
packageOverrides = pkgs:
|
|
|
|
optCall lhs.packageOverrides pkgs //
|
|
|
|
optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
configType = mkOptionType {
|
|
|
|
name = "nixpkgs config";
|
|
|
|
check = traceValIfNot isConfig;
|
|
|
|
merge = fold mergeConfig {};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-08-26 09:52:38 -07:00
|
|
|
{
|
|
|
|
options = {
|
|
|
|
|
|
|
|
nixpkgs.config = pkgs.lib.mkOption {
|
|
|
|
default = {};
|
|
|
|
example = {
|
|
|
|
firefox.enableGeckoMediaPlayer = true;
|
|
|
|
};
|
2011-09-05 02:19:59 -07:00
|
|
|
type = configType;
|
2009-08-26 09:52:38 -07:00
|
|
|
description = ''
|
2011-09-05 02:19:59 -07:00
|
|
|
The configuration of the Nix Packages collection. This expression
|
|
|
|
defines default value of attributes and allow packages to be
|
|
|
|
overriden globally via the `packageOverrides'.
|
|
|
|
|
|
|
|
the `packageOverrides' configuration option must be a set of new or
|
|
|
|
overriden packages. Any occurence of `pkgs' inside this attribute
|
|
|
|
set refers to the *original* (un-overriden) set of packages,
|
|
|
|
allowing packageOverrides attributes to refer to the original
|
|
|
|
attributes (e.g. "packageOverrides.foo = ... pkgs.foo ...").
|
2009-08-26 09:52:38 -07:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2010-11-23 08:07:00 -08:00
|
|
|
nixpkgs.system = pkgs.lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
Specifies the Nix platform type for which NixOS should be built.
|
|
|
|
If unset, it defaults to the platform type of your host system
|
|
|
|
(<literal>${builtins.currentSystem}</literal>).
|
|
|
|
Specifying this option is useful when doing distributed
|
|
|
|
multi-platform deployment, or when building virtual machines.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-08-26 09:52:38 -07:00
|
|
|
};
|
2010-02-27 10:37:12 -08:00
|
|
|
}
|