1# Borrowed from https://github.com/cachix/ghcide-nix/pull/4/files#diff-70bfff902f4dec33e545cac10ee5844d
2# Tweaked to use builtins.mapAttrs instead of needing the one from nixpkgs lib
5 dimension: name -> attrs -> function -> attrs
7 function: keyText -> value -> attrsOf package
9 WARNING: Attribute names must not contain periods (".").
10 See https://github.com/NixOS/nix/issues/3088
12 NOTE: The dimension name will be picked up by agent and web ui soon.
14 Specifies a dimension of the build matrix. For example
18 withoutP = { p = false; }
19 } (key: # either "withP" or "withoutP"
20 { p }: # either p = true or p = false
27 withP = myProject true;
28 withoutP = myProject false;
31 Use nested calls for multiple dimensions.
40 dimension "Nixpkgs release" (
42 "nixpkgs-19_03".nixpkgs = someSource
43 } // optionalAttrs (system != "...") {
44 "nixpkgs-unstable".nixpkgs = someOtherSource
48 myProject system nixpkgs
56 x86_64-linux.nixpkgs-19_03 = myProject "x86_64-linux" someSource;
57 x86_64-linux.nixpkgs-unstable = myProject "x86_64-linux" someOtherSource;
61 If you need to make references across attributes, you can do so by binding
62 the result. Wherever you write
64 dimension "My dimension" {} (key: value: f1 key value)
69 myDimension = dimension "My dimension" {} (key: value: f2 key value myDimension)
73 This example builds a single test runner to reuse across releases:
77 testRunnerPkgs: self: super: {
82 pkgs ? import nixpkgs { overlays = [ overlay ]; },
88 latest = "nixpkgs-19_03";
90 dimension "Nixpkgs release"
92 nixpkgs-18_09.nixpkgs = someSource
93 nixpkgs-19_03.nixpkgs = someOtherSource
99 testRunnerPkgs = releases."${latest}";
106 dimension = name: attrs: f:
110 in o // { recurseForDerivations = o.recurseForDerivations or true; }
113 // { meta.dimension.name = name; };
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