about summary refs log tree commit diff
path: root/default.nix
blob: dca6dea16c23c86ad950dc4520e9be83ccf6656b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ ... }:

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))