depot/third_party/nixpkgs/pkgs/top-level/config.nix
Default email e811e7b8dc Project import generated by Copybara.
GitOrigin-RevId: 689b76bcf36055afdeb2e9852f5ecdd2bf483f87
2022-01-23 03:10:13 +01:00

55 lines
1.2 KiB
Nix

# This file defines the structure of the `config` nixpkgs option.
{ lib, ... }:
with lib;
let
mkMassRebuild = args: mkOption (builtins.removeAttrs args [ "feature" ] // {
type = args.type or (types.uniq types.bool);
default = args.default or false;
description = (args.description or ''
Whether to ${args.feature} while building nixpkgs packages.
'') + ''
Changing the default may cause a mass rebuild.
'';
});
options = {
/* Internal stuff */
warnings = mkOption {
type = types.listOf types.str;
default = [];
internal = true;
};
/* Config options */
doCheckByDefault = mkMassRebuild {
feature = "run <literal>checkPhase</literal> by default";
};
path = mkOption {
type = types.path;
default = ../..;
defaultText = lib.literalDocBook "a path expression";
internal = true;
description = ''
A reference to Nixpkgs' own sources.
This is overridable in order to avoid copying sources unnecessarily,
as a path expression that references a store path will not short-circuit
to the store path itself, but copy the store path instead.
'';
};
};
in {
inherit options;
}