Skip to content

Commit b92df8f

Browse files
committed
alias lib-core to lib, lib-contrib to lib.contrib
As promised on 2.0.0 release notes. This is marked as breaking change, although people migrating from older than 2.0 version might have some trouble (as lib was previously a function and is now a regular attrset).
1 parent 4ccd57b commit b92df8f

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ want to check out our opinionated contrib functions.
187187
Our core functions do not require nixpkgs. Nix all the way down (at least until
188188
you get to nix-the-package-manager code) baby!
189189

190-
All of these are exposed at `nix-colors.lib-core`.
190+
All of these are exposed at `nix-colors.lib`.
191191

192192
### `schemeFromYAML`
193193

@@ -199,7 +199,7 @@ Just grab (or create yours) a `.yaml` file, read it into a string (with
199199
```nix
200200
{ nix-colors, ... }:
201201
{
202-
colorScheme = nix-colors.lib-core.schemeFromYAML "cool-scheme" (builtins.readFile ./cool-scheme.yaml);
202+
colorScheme = nix-colors.lib.schemeFromYAML "cool-scheme" (builtins.readFile ./cool-scheme.yaml);
203203
}
204204
```
205205

@@ -221,7 +221,7 @@ with nix-repl:
221221
```bash
222222
$ nix repl
223223
nix-repl> :lf .
224-
nix-repl> bultins.toFile "pasque.yaml" (inputs.nix-colors.lib-core.schemeToYAML inputs.nix-colors.colorSchemes.pasque)
224+
nix-repl> bultins.toFile "pasque.yaml" (inputs.nix-colors.lib.schemeToYAML inputs.nix-colors.colorSchemes.pasque)
225225
```
226226

227227
### More soon(TM)
@@ -237,15 +237,15 @@ the idea.
237237

238238
These nifty pals are listed (and documented) at
239239
[`lib/contrib/default.nix`](lib/contrib/default.nix). They are exposed at
240-
`nix-colors.lib-contrib`.
240+
`nix-colors.lib.contrib`.
241241

242242
Do note these require `nixpkgs`, however. You should pass your `pkgs` instance
243-
to `nix-colors.lib-contrib` to use them. For example:
243+
to `nix-colors.lib.contrib` to use them. For example:
244244
```nix
245245
{ pkgs, nix-colors, ... }:
246246
247247
let
248-
nix-colors-lib = nix-colors.lib-contrib { inherit pkgs; };
248+
nix-colors-lib = nix-colors.lib.contrib { inherit pkgs; };
249249
in {
250250
colorScheme = nix-colors-lib.colorSchemeFromPicture {
251251
path = ./wallpapers/example.png;

default.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ in
1414
, base16-schemes ? fromFlake "base16-schemes"
1515
, ...
1616
}: rec {
17-
lib = import ./lib;
1817
lib-contrib = import ./lib/contrib;
1918
lib-core = import ./lib/core { inherit nixpkgs-lib; };
19+
lib = lib-core // { contrib = lib-contrib; };
20+
2021
tests = import ./lib/core/tests { inherit nixpkgs-lib; };
2122

22-
colorSchemes = import ./schemes.nix { inherit lib-core base16-schemes; };
23+
colorSchemes = import ./schemes.nix { inherit lib base16-schemes; };
2324
# Alias
2425
colorschemes = colorSchemes;
2526

lib/default.nix

Lines changed: 0 additions & 10 deletions
This file was deleted.

schemes.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{ lib-core, base16-schemes, ... }:
1+
{ lib, base16-schemes, ... }:
22
let
33
inherit (builtins)
44
readFile readDir attrNames listToAttrs stringLength substring baseNameOf
55
filter;
6-
inherit (lib-core) schemeFromYAML;
6+
inherit (lib) schemeFromYAML;
77

88
# Borrowed from nixpkgs
99
removeSuffix = suffix: str:

0 commit comments

Comments
 (0)