Modularize the library

The flake utilities are too specific. Not going to contribute further
crap in the world. ;p
This commit is contained in:
Gabriel Arazas 2021-12-08 12:20:18 +08:00
parent cd15eada5a
commit 09f8a1f763
3 changed files with 10 additions and 9 deletions

View File

@ -33,11 +33,16 @@
]; ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
libExtended = nixpkgs.lib.extend (final: prev: libExtended = nixpkgs.lib.extend (final: prev:
(import ./lib { (import ./lib {
inherit inputs;
lib = final; lib = final;
})); }) // {
flakeUtils = (import ./lib/flake-utils.nix {
inherit inputs;
lib = final;
});
});
# The default configuration for our NixOS systems. # The default configuration for our NixOS systems.
hostDefaultConfig = { hostDefaultConfig = {

View File

@ -1,10 +1,6 @@
{ lib, inputs, ... }: { lib, ... }:
let
flakeUtils = import ./flake-utils.nix { inherit lib inputs; };
in rec {
inherit flakeUtils;
rec {
/* Create an attribute set that represents the structure of the modules /* Create an attribute set that represents the structure of the modules
inside of a directory. While it can recurse into directories, it will inside of a directory. While it can recurse into directories, it will
stop once it detects `default.nix` inside. stop once it detects `default.nix` inside.

View File

@ -76,6 +76,6 @@ in rec {
configuration = import file; configuration = import file;
homeDirectory = "/home/${username}"; homeDirectory = "/home/${username}";
extraModules = hmModules ++ extraModules ++ [ (lib.filterAttrs (n: _: !lib.elem n hmConfigFunctionArgs) attrs) ]; extraModules = hmModules ++ extraModules ++ [ (lib.filterAttrs (n: _: !lib.elem n hmConfigFunctionArgs) attrs) ];
extraSpecialArgs = { inherit system; }; extraSpecialArgs = { inherit lib system; };
}; };
} }