Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Forked from infinisil/default.nix
Created October 13, 2017 17:09
Show Gist options
  • Save dustinlacewell-wk/19c08ef6924f6ee1aed5a6b0d86707a7 to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/19c08ef6924f6ee1aed5a6b0d86707a7 to your computer and use it in GitHub Desktop.
with (import <nixpkgs> {}).lib;
with builtins;
let
items = readDir ./.;
dirs = filterAttrs (item: type: type == "directory") items;
paths = map (dir: toPath ./. + "/${dir}") (attrNames dirs);
modules = filter (path: pathExists (toPath "${path}/default.nix")) paths;
defaults = map (module: import module) modules;
in
defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment