lib: conditionally add flake subset

This commit is contained in:
Gabriel Arazas 2024-08-02 11:55:45 +08:00
parent 6987a2215f
commit dc80f95e2b
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -6,10 +6,12 @@
# If you have to add those functions, you'll have to add them in configUtils. # If you have to add those functions, you'll have to add them in configUtils.
{ pkgs }: { pkgs }:
let
inherit (pkgs) lib;
in
pkgs.lib.makeExtensible pkgs.lib.makeExtensible
(self: (self:
let let
inherit (pkgs) lib;
callLib = file: import file { inherit pkgs lib self; }; callLib = file: import file { inherit pkgs lib self; };
in { in {
builders = callLib ./builders.nix; builders = callLib ./builders.nix;
@ -19,4 +21,8 @@ pkgs.lib.makeExtensible
inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration; inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration;
inherit (self.trivial) countAttrs; inherit (self.trivial) countAttrs;
inherit (self.data) importYAML renderTeraTemplate; inherit (self.data) importYAML renderTeraTemplate;
} // lib.optionalAttrs (builtins ? fetchTree) {
flake = callLib ./flake.nix;
inherit (self.flake) importFlakeMetadata fetchTree fetchInput;
}) })