1# package descriptions in hackage will look like:
2# { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs }:
3# { flags = { flag1 = false; flags2 = true; ... };
4# package = { specVersion = "X.Y"; identifier = { name = "..."; version = "a.b.c.d"; };
5# license = "..."; copyright = "..."; maintainer = "..."; author = "...";
6# homepage = "..."; url = "..."; synopsis = "..."; description = "...";
7# buildType = "Simple"; # or Custom, Autoconf, ...
10# "..." = { depends = [ (hsPkgs.base) ... ]; };
11# exes = { "..." = { depends = ... };
12# "..." = { depends = ... }; };
13# tests = { "..." = { depends = ... }; ... };
16{ lib, config, pkgs, ... }:
22 # This is just like listOf, except that it filters out all null elements.
23 listOfFilteringNulls = elemType: listOf elemType // {
24 # Mostly copied from nixpkgs/lib/types.nix
26 map (x: x.value) (filter (x: x ? value && x.value != null) (concatLists (imap1 (n: def:
27 if isList def.value then
30 (loc ++ ["[definition ${toString n}-entry ${toString m}]"])
32 [{ inherit (def) file; value = def'; }]
36 throw "The option value `${showOption loc}` in `${def.file}` is not a list.") defs)));
39 # This is how the Nix expressions generated by *-to-nix receive
40 # their flags argument.
41 config._module.args.flags = config.flags;
44 # TODO: Add descriptions to everything.
50 specVersion = mkOption {
54 identifier.name = mkOption {
58 identifier.version = mkOption {
66 copyright = mkOption {
70 maintainer = mkOption {
90 description = mkOption {
94 buildType = mkOption {
100 componentType = submodule {
103 type = listOfFilteringNulls unspecified;
107 type = listOfFilteringNulls (nullOr package);
110 frameworks = mkOption {
111 type = listOfFilteringNulls package;
114 pkgconfig = mkOption {
115 type = listOfFilteringNulls package;
118 build-tools = mkOption {
119 type = listOfFilteringNulls unspecified;
122 configureFlags = mkOption {
123 type = listOfFilteringNulls str;
130 type = componentType;
133 type = attrsOf componentType;
136 foreignlibs = mkOption {
137 type = attrsOf componentType;
141 type = attrsOf componentType;
145 type = attrsOf componentType;
148 benchmarks = mkOption {
149 type = attrsOf componentType;
156 default = "${config.package.identifier.name}-${config.package.identifier.version}";
157 defaultText = "\${config.package.identifier.name}-\${config.package.identifier.version}";
164 type = either path package;
165 default = pkgs.fetchurl { url = "mirror://hackage/${config.name}.tar.gz"; inherit (config) sha256; };
166 defaultText = "pkgs.fetchurl { url = \"mirror://hackage/\${config.name}.tar.gz\"; inherit (config) sha256; };";
168 revision = mkOption {
172 revisionSha256 = mkOption {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list