Created
May 14, 2019 11:21
-
-
Save Jomik/947f4fa855b28e249dbb240ca46e796a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
listDirectory = with builtins; action: dir: | |
let | |
list = readDir dir; | |
in listToAttrs (map | |
(name: { | |
name = replaceStrings [".nix"] [""] name; | |
value = action (dir + ("/" + name)); | |
}) | |
(attrNames list)); | |
pkgs' = pkgs.lib.makeScope pkgs.newScope (self: let | |
inherit (self) callPackage; | |
in { | |
npm-buildpackage = callPackage (callPackage ({ fetchFromGitHub }: { | |
owner = "serokell"; | |
repo = "nix-npm-buildpackage"; | |
rev = "fc42625d30aadb3cefef19184baeba6524631b70"; | |
sha256 = "15dq93x460wzyw1irw3i50rrpi16zilgv3r4bswywgfy02rnx3r8"; | |
}) {}) {}; | |
} // (listDirectory (p: callPackage p {}) ./pkgs)); | |
in pkgs' // { | |
pkgs = pkgs'; | |
home-modules = listDirectory (x: x) ./home-modules; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment