about summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix49
1 files changed, 25 insertions, 24 deletions
diff --git a/default.nix b/default.nix
index 0df52cce6a79..dca6dea16c23 100644
--- a/default.nix
+++ b/default.nix
@@ -1,32 +1,33 @@
 { ... }:
 
 let
-  depot = import (builtins.fetchGit {
+  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 {
-    pkgs = import (builtins.fetchGit {
-      url = "https://github.com/NixOS/nixpkgs-channels";
-      ref = "nixos-20.03";
-      rev = "afa9ca61924f05aacfe495a7ad0fd84709d236cc";
-    }) {};
-    briefcase = import (builtins.path {
-      path = ./.;
-      name = "briefcase";
-    }) {};
-    depot = depot;
+    inherit depot pkgs briefcase;
   };
-in {
-  ci           = readTree ./ci;
-  nixos        = readTree ./nixos;
-  utils        = readTree ./utils;
-  emacs        = readTree ./emacs;
-  website      = readTree ./website;
-  lisp         = readTree ./lisp;
-  gopkgs       = readTree ./gopkgs;
-  third_party  = readTree ./third_party;
-  tools        = readTree ./tools;
-  buildHaskell = readTree ./buildHaskell;
-  zoo          = readTree ./zoo;
-}
+in mapAttrs
+  (name: _: readTree (./. + "/${name}"))
+  (filterAttrs
+    (name: type: type == "directory" && !hasPrefix "." name)
+    (readDir briefcasePath))