diff --git a/flake.nix b/flake.nix index 0067601698..3b1314b015 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; - lib = pkgs.lib.extend (import ./lib); + inherit (pkgs) lib; treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in { diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index bb8c9b9809..0000000000 --- a/lib/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -final: _prev: { - by-name = pkgs: path: - let - entries = builtins.readDir path; - filenames = builtins.attrNames entries; - callPackage = final.callPackageWith (pkgs // self); - maybeNameValuePair = filename: - if entries.${filename} == "directory" - then [ - { - name = filename; - value = callPackage (path + "/${filename}/package.nix") { }; - } - ] - else [ ]; - nameValuePairs = builtins.concatMap maybeNameValuePair filenames; - self = builtins.listToAttrs nameValuePairs; - in - self; -} diff --git a/packages/default.nix b/packages/default.nix index e8bfade638..6512b67a5b 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,10 +1,12 @@ { lib, pkgs }: - let pkgs' = pkgs // self; callPackages = lib.callPackagesWith pkgs'; - self = lib.by-name pkgs' ./by-name // { + self = (lib.packagesFromDirectoryRecursive { + callPackage = lib.callPackageWith pkgs'; + directory = ./by-name; + }) // { containers = callPackages ./containers.nix { pkgs = pkgs'; }; scripts = callPackages ./scripts.nix { pkgs = pkgs'; }; genpolicy-msft = pkgs.pkgsStatic.callPackage ./by-name/genpolicy-msft/package.nix { };