add flake support

This change is fully backwards compatible.

We continue to use the standard non-flake evaluation mode in our
examples and internal tooling until the flakes design has stabilized.

'clightning-plugins = pkgs.recurseIntoAttrs' in pkgs/default.nix is
needed by flake-utils.lib.flattenTree in flake.nix.
It transforms the packages in `clightning-plugins` to top-level packages
named like `clightning-plugins/summary`. (The flake attr `packages`
must be a non-nested attrset of derivations.)
This commit is contained in:
Erik Arvstedt 2021-08-16 10:42:07 +02:00
parent de77281cba
commit f7c2133250
No known key found for this signature in database
GPG key ID: 33312B944DD97846
7 changed files with 246 additions and 13 deletions

View file

@ -14,7 +14,7 @@ let self = {
krops = import ./krops { };
netns-exec = pkgs.callPackage ./netns-exec { };
extra-container = pkgs.callPackage ./extra-container { };
clightning-plugins = import ./clightning-plugins pkgs self.nbPython3Packages;
clightning-plugins = pkgs.recurseIntoAttrs (import ./clightning-plugins pkgs self.nbPython3Packages);
clboss = pkgs.callPackage ./clboss { };
secp256k1 = pkgs.callPackage ./secp256k1 { };

View file

@ -1,19 +1,20 @@
let
fetch = { rev, sha256 }:
fetchNixpkgs = { rev, sha256 }:
builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
inherit sha256;
};
fetch = input: let
inherit (input) locked;
in fetchNixpkgs {
inherit (locked) rev;
sha256 = locked.narHash;
};
lockedInputs = (builtins.fromJSON (builtins.readFile ../flake.lock)).nodes;
in
{
# To update, run ../helper/fetch-channel REV
nixpkgs = fetch {
# nixos-21.05 (2021-08-14)
rev = "a445f5829889959d65ad65e5c961d5c67e1cd677";
sha256 = "0zl930jjacdphplw1wv5nlhjk15zvflzzwp53zbh0l8qq01wh7bl";
};
nixpkgs-unstable = fetch {
rev = "4138cbd913fad85073e59007710e3f083d0eb7c6";
sha256 = "0l7vaa6mnnmxfxzi9i5gd4c4j3cpfh7gjsjsfk6nnj1r05pazf0j";
};
nixpkgs = fetch lockedInputs.nixpkgs;
nixpkgs-unstable = fetch lockedInputs.nixpkgsUnstable;
}