From 11f91f83e6da7a71994e45b1d478d4c9defd0290 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 20 Jan 2023 13:45:12 +0100 Subject: [PATCH] add option `nix-bitcoin.pkgOverlays` This simplifies extending `nix-bitcoin.pkgs` and is required for extension flakes. For now, mark this as `internal`. --- modules/nix-bitcoin.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index 3263ffe..ef8f7a2 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, options, pkgs, lib, ... }: with lib; { @@ -8,6 +8,18 @@ with lib; type = types.attrs; default = (import ../pkgs { inherit pkgs; }).modulesPkgs; defaultText = "nix-bitcoin/pkgs.modulesPkgs"; + apply = base: + let + final = foldl (prev: overlay: + prev // (overlay prev final) + ) base options.nix-bitcoin.pkgOverlays.definitions; + in + final; + }; + + pkgOverlays = mkOption { + internal = true; + type = with types; functionTo attrs; }; lib = mkOption {