Skip to content

Instantly share code, notes, and snippets.

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