tvl-depot/default.nix
William Carroll 2715591c97 Call readTree on all top-level, visible directories in briefcase
Instead of manually maintaining the list of directories that I expose to
readTree, I'm using `builtins.readDir` to get a list of all non-hidden top-level
directories.
2020-08-28 18:14:22 +01:00

33 lines
787 B
Nix

{ ... }:
let
inherit (builtins) fetchGit readDir path;
inherit (pkgs.lib) filterAttrs mapAttrs;
inherit (pkgs.lib.strings) hasPrefix;
briefcasePath = path {
path = ./.;
name = "briefcase";
};
depot = import (fetchGit {
url = "https://cl.tvl.fyi/depot";
rev = "a2e86152401c7c531801c79347c3f15e1806aabc";
}) {};
pkgs = import (fetchGit {
url = "https://github.com/NixOS/nixpkgs-channels";
ref = "nixos-20.03";
rev = "afa9ca61924f05aacfe495a7ad0fd84709d236cc";
}) {};
briefcase = import briefcasePath {};
readTree = depot.nix.readTree {
inherit depot pkgs briefcase;
};
in mapAttrs
(name: _: readTree (./. + "/${name}"))
(filterAttrs
(name: type: type == "directory" && !hasPrefix "." name)
(readDir briefcasePath))