Skip to content

Instantly share code, notes, and snippets.

@Jomik
Created May 14, 2019 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jomik/947f4fa855b28e249dbb240ca46e796a to your computer and use it in GitHub Desktop.
Save Jomik/947f4fa855b28e249dbb240ca46e796a to your computer and use it in GitHub Desktop.
{ 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