Skip to content

Commit 8ee6fcf

Browse files
authored
Rename pkg-def-overlays to pkg-def-extras (#79)
* Rename pkg-def-overlays to pkg-def-extras Fixes #75
1 parent 696f22d commit 8ee6fcf

File tree

13 files changed

+37
-37
lines changed

13 files changed

+37
-37
lines changed

default.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ let
5555
# and Nix expressions representing cabal packages (cabal-to-nix).
5656
mkPkgSet =
5757
{ pkg-def # Base package set. Either from stackage (via stack-to-nix) or from a cabal projects plan file (via plan-to-nix)
58-
, pkg-def-overlays ? [] # Additional packages to augment the Base package set `pkg-def` with.
58+
, pkg-def-extras ? [] # Additional packages to augment the Base package set `pkg-def` with.
5959
, modules ? []
6060
}@args:
6161

@@ -67,35 +67,35 @@ let
6767
# Create a Haskell package set based on a Stack configuration.
6868
mkStackPkgSet =
6969
{ stack-pkgs # Path to the output of stack-to-nix
70-
, pkg-def-overlays ? []
70+
, pkg-def-extras ? []
7171
, modules ? []
7272
}@args:
7373

7474
let
7575
# The Stackage release referenced in the stack config
7676
pkg-def = stackage.${stack-pkgs.resolver};
7777
# The compiler referenced in the stack config
78-
compiler = (stack-pkgs.overlay hackage).compiler or (pkg-def hackage).compiler;
78+
compiler = (stack-pkgs.extras hackage).compiler or (pkg-def hackage).compiler;
7979
in self.mkPkgSet {
8080
inherit pkg-def;
81-
pkg-def-overlays = [ stack-pkgs.overlay ] ++ pkg-def-overlays;
81+
pkg-def-extras = [ stack-pkgs.extras ] ++ pkg-def-extras;
8282
modules = [ ghcHackagePatches.${compiler.nix-name} ] ++ modules;
8383
};
8484

8585
# Create a Haskell package set based on a Cabal configuration.
8686
mkCabalProjectPkgSet =
8787
{ plan-pkgs # Path to the output of plan-to-nix
88-
, pkg-def-overlays ? []
88+
, pkg-def-extras ? []
8989
, modules ? []
9090
}@args:
9191

9292
let
9393
pkg-def = plan-pkgs.pkgs;
9494
# The compiler referenced in the stack config
95-
compiler = (plan-pkgs.overlay hackage).compiler or (pkg-def hackage).compiler;
95+
compiler = (plan-pkgs.extras hackage).compiler or (pkg-def hackage).compiler;
9696
in self.mkPkgSet {
9797
inherit pkg-def;
98-
pkg-def-overlays = [ plan-pkgs.overlay ] ++ pkg-def-overlays;
98+
pkg-def-extras = [ plan-pkgs.extras ] ++ pkg-def-extras;
9999
modules = [ ghcHackagePatches.${compiler.nix-name} ] ++ modules;
100100
};
101101

docs/iohk-nix.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ iohk-nix.json
4141
nix/pkgs.nix
4242
```
4343
{ pkgs ? import <nixpkgs> {}
44-
, iohk-overlay ? {}
44+
, iohk-extras ? {}
4545
, iohk-module ? {}
4646
, haskell
4747
, hackage
@@ -67,16 +67,16 @@ let
6767
# packages.cbors.patches = [ ./one.patch ];
6868
# packages.cbors.flags.optimize-gmp = false;
6969
#
70-
compiler = (stack-pkgs.overlay hackage).compiler.nix-name;
70+
compiler = (stack-pkgs.extras hackage).compiler.nix-name;
7171
pkgSet = haskell.mkNewPkgSet {
7272
inherit pkgs;
7373
pkg-def = stackage.${stack-pkgs.resolver};
74-
# The overlay allows extension or restriction of the set of
75-
# packages we are interested in. By using the stack-pkgs.overlay
74+
# These extras allow extension or restriction of the set of
75+
# packages we are interested in. By using the stack-pkgs.extras
7676
# we restrict our package set to the ones provided in stack.yaml.
77-
pkg-def-overlays = [
78-
stack-pkgs.overlay
79-
iohk-overlay.${compiler}
77+
pkg-def-extras = [
78+
stack-pkgs.extras
79+
iohk-extras.${compiler}
8080
];
8181
# package customizations
8282
modules = [

docs/user-guide-cabal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ file as follows:
5050
```nix
5151
let plan = import ./plan.nix; in
5252
{ pkg-def = plan;
53-
overlay =
53+
extras =
5454
{ local-package-a = ./local-package-a.nix;
5555
local-package-b = ./local-package-b.nix;
5656
source-import-a = ./source-import-a.nix;

docs/user-guide-stack.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This will produce a `nix/pkgs.nix` file that looks like the following:
1717
```nix
1818
{
1919
resolver = "lts-12.17";
20-
overlay = hackage:
20+
extras = hackage:
2121
{
2222
packages = {
2323
"o-clock" = hackage.o-clock."0.1.1".revisions.default;
@@ -30,9 +30,9 @@ This will produce a `nix/pkgs.nix` file that looks like the following:
3030
}
3131
```
3232

33-
This file contains the stackage resolver, as well as an overlay of
34-
packages. The overlay specifies which `extra-deps` (here: o-clock-0.1.1)
35-
we wanted to overlay over the stackage snapshot, and what local
33+
This file contains the stackage resolver, as well as set of extra
34+
packages. The extras specifies which `extra-deps` (here: o-clock-0.1.1)
35+
we wanted to add over the stackage snapshot, and what local
3636
packages we want (here: my-package).
3737

3838
*If you came here from the [User Guide](/user-guide), go back and

docs/user-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ let
8686
# Cabal projects use mkPkgSet
8787
pkgSet = haskell.mkPkgSet {
8888
pkg-def = my-pkgs.pkg-def;
89-
pkg-def-overlays = [
90-
# this overlay will provide additional packages
89+
pkg-def-extras = [
90+
# these extras will provide additional packages
9191
# ontop of the package set. E.g. extra-deps
9292
# for stack packages. or local packages for
9393
# cabal.projects
94-
my-pkgs.overlay
94+
my-pkgs.extras
9595
];
9696
modules = [
9797
# specific package overrides would go here

package-set.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
let f = { hackage, pkgs, pkg-def, pkg-def-overlays ? [], modules ? [] }: let
2-
buildModules = f { inherit hackage pkg-def pkg-def-overlays modules; pkgs = pkgs.buildPackages; };
1+
let f = { hackage, pkgs, pkg-def, pkg-def-extras ? [], modules ? [] }: let
2+
buildModules = f { inherit hackage pkg-def pkg-def-extras modules; pkgs = pkgs.buildPackages; };
33
in pkgs.lib.evalModules {
44
modules = modules ++ [
55
({ lib, ... }: {
@@ -33,7 +33,7 @@ in pkgs.lib.evalModules {
3333
# or
3434
# { y = ./foo.nix; }
3535
# As such the desugarer desugars this short hand syntax.
36-
let desugar = overlay:
36+
let desugar = extras:
3737
let
3838
isPath = x: builtins.typeOf x == "path";
3939
# rewrite
@@ -51,19 +51,19 @@ in pkgs.lib.evalModules {
5151
# into
5252
# x.revision = import ./some/path;
5353
expand-paths = pkg: if !(isPath pkg.revision) then pkg else { revision = import pkg.revision; };
54-
# apply injection and expansion to the "packages" in overlay.
54+
# apply injection and expansion to the "packages" in extras.
5555
in lib.mapAttrs (k: v: if k != "packages"
5656
then v
5757
else lib.mapAttrs (_: pkg: (expand-paths (inject-revision pkg))) v)
58-
(inject-packages overlay);
59-
# fold any potential `pkg-def-overlays`
58+
(inject-packages extras);
59+
# fold any potential `pkg-def-extras`
6060
# onto the `pkg-def`.
6161
#
6262
# This means you can have a base definition (e.g. stackage)
6363
# and augment it with custom packages to your liking.
6464
in foldl' lib.recursiveUpdate
6565
(pkg-def hackage)
66-
(map (p: desugar (if builtins.isFunction p then p hackage else p)) pkg-def-overlays)
66+
(map (p: desugar (if builtins.isFunction p then p hackage else p)) pkg-def-extras)
6767
;
6868

6969
})

test/builder-haddock/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let
99
# plan-to-nix dist-newstyle/cache/plan.json > plan.nix
1010
# cabal-to-nix test-haddock.cabal > test-haddock.nix
1111
pkg-def = import ./plan.nix;
12-
pkg-def-overlays = [
12+
pkg-def-extras = [
1313
{ test-haddock = ./test-haddock.nix; }
1414
];
1515
modules = [

test/cabal-22/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ with stdenv.lib;
55
let
66
pkgSet = mkPkgSet {
77
pkg-def = import ./plan.nix;
8-
pkg-def-overlays = [
8+
pkg-def-extras = [
99
{ project = ./project.nix; }
1010
];
1111
modules = [ ];

test/cabal-simple/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let
1010
# 3. plan-to-nix ./dist-newstyle/cache/plan.json > plan.nix
1111
pkgSet = mkPkgSet {
1212
pkg-def = import ./plan.nix;
13-
pkg-def-overlays = [
13+
pkg-def-extras = [
1414
{ cabal-simple = ./cabal-simple.nix;
1515
}
1616
];

test/cabal-sublib/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let
1010
# 3. plan-to-nix ./dist-newstyle/cache/plan.json > plan.nix
1111
pkgSet = mkPkgSet {
1212
pkg-def = import ./plan.nix;
13-
pkg-def-overlays = [
13+
pkg-def-extras = [
1414
{ cabal-sublib = ./cabal-sublib.nix;
1515
}
1616
];

0 commit comments

Comments
 (0)