aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-14 03:45:10 +0000
committertv <tv@krebsco.de>2026-11-14 04:58:40 +0100
commit4ac279ac50b2a842b08d39a875c7c1b89998fd13 (patch)
tree6a614a9b9b9dc47ace1292100ca01c87e9f97098 /README.md
parent3e2116f153077186556c01ae1fc89923abfea265 (diff)
krops: take nixpkgs' lib from the caller
krops' lib imported <nixpkgs/lib>, which pure evaluation doesn't allow, and so did pkgs.krops and pkgs.populate, through it, also in krops' flake. lib/with.nix is krops' own lib, a function taking nixpkgs' lib, without merging it in. pkgs.krops and pkgs.populate use it with the lib callPackage gives them, nixpkgs.lib in krops' flake, and lib/default.nix is what it was: <nixpkgs/lib>, builtins, and krops' own lib, merged. The derivations stay the same.
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/README.md b/README.md
index 92dab4a..d71a6d0 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,9 @@ machine that uses them.
krops' flake provides `populate`, `writeDeploy`, and the other functions
described below as `lib.<system>`, and its `lib` directory provides
-`evalSource` and `mkTarget`:
+`evalSource` and `mkTarget`. `lib/with.nix` is a function taking nixpkgs'
+lib, as below; `lib/default.nix` merges it, with `<nixpkgs/lib>`, into
+nixpkgs' lib and builtins:
```nix
{
@@ -83,9 +85,9 @@ described below as `lib.<system>`, and its `lib` directory provides
inputs.krops.url = "git+https://cgit.krebsco.de/krops";
inputs.krops.inputs.nixpkgs.follows = "nixpkgs";
- outputs = { self, krops, ... }: let
+ outputs = { self, krops, nixpkgs, ... }: let
system = "x86_64-linux";
- lib = import "${krops}/lib";
+ lib = import "${krops}/lib/with.nix" { inherit (nixpkgs) lib; };
in {
apps.${system}.deploy = {
type = "app";
@@ -101,8 +103,8 @@ described below as `lib.<system>`, and its `lib` directory provides
}
```
-krops evaluates `<nixpkgs/lib>`, environment variables, and `/etc/hostname`,
-which pure evaluation doesn't allow, so deploy with `nix run --impure .#deploy`.
+krops evaluates environment variables and `/etc/hostname`, which pure
+evaluation doesn't allow, so deploy with `nix run --impure .#deploy`.
`pkgs.krops` provides the following functions.
@@ -150,7 +152,7 @@ pkgs.krops.writeDeploy "deploy" {
}
```
For more details about the `target` attribute, please check the `mkTarget`
-function in [lib/default.nix](lib/default.nix).
+function in [lib/with.nix](lib/with.nix).
### `allocateTTY` (optional, defaults to false)