diff --git a/flake.nix b/flake.nix index fb9bbe89..5973f150 100644 --- a/flake.nix +++ b/flake.nix @@ -33,11 +33,16 @@ ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); + libExtended = nixpkgs.lib.extend (final: prev: (import ./lib { - inherit inputs; lib = final; - })); + }) // { + flakeUtils = (import ./lib/flake-utils.nix { + inherit inputs; + lib = final; + }); + }); # The default configuration for our NixOS systems. hostDefaultConfig = { diff --git a/lib/default.nix b/lib/default.nix index ed0c26a2..bff242e2 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,10 +1,6 @@ -{ lib, inputs, ... }: - -let - flakeUtils = import ./flake-utils.nix { inherit lib inputs; }; -in rec { - inherit flakeUtils; +{ lib, ... }: +rec { /* Create an attribute set that represents the structure of the modules inside of a directory. While it can recurse into directories, it will stop once it detects `default.nix` inside. diff --git a/lib/flake-utils.nix b/lib/flake-utils.nix index ee981b27..d3bb7de9 100644 --- a/lib/flake-utils.nix +++ b/lib/flake-utils.nix @@ -76,6 +76,6 @@ in rec { configuration = import file; homeDirectory = "/home/${username}"; extraModules = hmModules ++ extraModules ++ [ (lib.filterAttrs (n: _: !lib.elem n hmConfigFunctionArgs) attrs) ]; - extraSpecialArgs = { inherit system; }; + extraSpecialArgs = { inherit lib system; }; }; }