query
On this page

packagesFromDirectory

pkgs.haskell.lib.packagesFromDirectory

Docs pulled from | This Revision | 13 minutes ago


packagesFromDirectory : { directory : Directory, ... } -> HaskellPackageOverrideSet


Noogle detected

Implementation

The following is the current implementation of this function.

packagesFromDirectory =
    { directory, ... }:

    self: super:
    let
      haskellPaths = lib.filter (lib.hasSuffix ".nix") (builtins.attrNames (builtins.readDir directory));

      toKeyVal = file: {
        name = builtins.replaceStrings [ ".nix" ] [ "" ] file;

        value = self.callPackage (directory + "/${file}") { };
      };

    in
    builtins.listToAttrs (map toKeyVal haskellPaths);