From 4ac279ac50b2a842b08d39a875c7c1b89998fd13 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 14 Nov 2026 03:45:10 +0000 Subject: krops: take nixpkgs' lib from the caller krops' lib imported , 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: , builtins, and krops' own lib, merged. The derivations stay the same. --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'README.md') 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.`, 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 ``, into +nixpkgs' lib and builtins: ```nix { @@ -83,9 +85,9 @@ described below as `lib.`, 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.`, and its `lib` directory provides } ``` -krops evaluates ``, 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) -- cgit v1.3.1