From a9627da325248fdb57f35a976723148e6a6098ef Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 1 Mar 2024 00:26:52 -0600 Subject: [PATCH] evaluate lib then inherit from it --- lib/default.nix | 10 +++++----- lib/extended.nix | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 84a39d9..64924fc 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -3,17 +3,17 @@ self, }: let inherit (inputs) nixpkgs; - inherit (builtins) concatLists attrValues mapAttrs elemAt match readDir filter listToAttrs; - inherit (nixpkgs.lib) hasSuffix nixosSystem genAttrs; - inherit (nixpkgs.lib.filesystem) listFilesRecursive; - lib = nixpkgs.lib.extend (import ./extended.nix); + + inherit (builtins) concatLists attrValues mapAttrs elemAt match readDir filter listToAttrs; + inherit (lib) hasSuffix nixosSystem genAttrs isNixFile; + inherit (lib.filesystem) listFilesRecursive; + #supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; supportedSystems = ["x86_64-linux"]; in rec { forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system}); - isNixFile = path: hasSuffix ".nix" path; buildOizys = _: forAllSystems ( pkgs: let diff --git a/lib/extended.nix b/lib/extended.nix index 33b1f51..c74014d 100644 --- a/lib/extended.nix +++ b/lib/extended.nix @@ -1,6 +1,9 @@ final: prev: let + inherit (final) hasSuffix; runes = import ../modules/runes; in { + + isNixFile = path: hasSuffix ".nix" path; mkIfIn = name: list: prev.mkIf (builtins.elem name list); mkRune = { rune,