about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-02-23T22·29+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-03-01T22·32+0000
commit9e0fdd397382da10a8486d25cfa9d889fdd17f86 (patch)
treec1d097f0ecb1a5366dd22989c2beda9c853dd482
parentfd720fbe4d284d0562ab32e7bb6a3f7171992c21 (diff)
Remove default values for Nix expression parameters
I'm not sure if this commit breaks everything in my monorepo. I think it
will.

Why am I doing this? Perhaps it's a bad idea. I don't fully understand how
readTree works. My ignorance is costing me hours of time spent debugging. In an
effort to better understand readTree, I'm removing the default values for my Nix
expression parameters, which I believe have preventing errors from surfacing.
-rw-r--r--blog/default.nix11
-rw-r--r--blog/deploy.nix6
-rw-r--r--clojure/buildClojure.nix2
-rw-r--r--default.nix15
-rw-r--r--emacs/default.nix8
-rw-r--r--fish/default.nix2
-rw-r--r--go/shell.nix2
-rw-r--r--gopkgs/kv/default.nix5
-rw-r--r--gopkgs/utils/default.nix5
-rw-r--r--lisp/f/default.nix6
-rw-r--r--lisp/prelude.nix2
-rw-r--r--mail/default.nix2
-rw-r--r--monzo_ynab/job.nix6
-rw-r--r--monzo_ynab/shell.nix6
-rw-r--r--monzo_ynab/tokens.nix6
-rw-r--r--scratch/deepmind/part_two/shell.nix2
-rw-r--r--shell.nix2
-rw-r--r--third_party/lisp/anaphora.nix2
-rw-r--r--third_party/lisp/cl-arrows.nix2
-rw-r--r--third_party/lisp/cl-colors.nix6
-rw-r--r--third_party/lisp/let-plus.nix6
-rw-r--r--third_party/lisp/linear-programming.nix2
-rw-r--r--third_party/lisp/prove.nix6
-rw-r--r--tools/rfcToKindle/default.nix4
-rw-r--r--tools/run/default.nix7
-rw-r--r--tools/run/shell.nix2
-rw-r--r--tools/simple_vim/default.nix2
-rw-r--r--tools/symlinkManager/default.nix6
28 files changed, 36 insertions, 97 deletions
diff --git a/blog/default.nix b/blog/default.nix
index aaece3366876..fd35570a322a 100644
--- a/blog/default.nix
+++ b/blog/default.nix
@@ -1,15 +1,10 @@
-{
-  nixpkgs ? import <nixpkgs> {},
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ pkgs, depot, briefcase, ... }:
 
 let
-  injections = nixpkgs.writeText "injections.lisp" ''
+  injections = pkgs.writeText "injections.lisp" ''
     (in-package #:server)
     (setq *path-to-posts* "${./posts}")
-    (setq *pandoc-bin* "${nixpkgs.pandoc}/bin/pandoc")
+    (setq *pandoc-bin* "${pkgs.pandoc}/bin/pandoc")
     (setq *html-template* "${./src/index.html}")
   '';
 in depot.nix.buildLisp.program {
diff --git a/blog/deploy.nix b/blog/deploy.nix
index 734e91e41b0b..5add7f7c6ecb 100644
--- a/blog/deploy.nix
+++ b/blog/deploy.nix
@@ -1,8 +1,4 @@
-{
-  pkgs ? import <nixpkgs> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ pkgs, briefcase, ... }:
 
 pkgs.dockerTools.buildLayeredImage {
   name = "blog";
diff --git a/clojure/buildClojure.nix b/clojure/buildClojure.nix
index 2c0275d3cf25..53188b06d861 100644
--- a/clojure/buildClojure.nix
+++ b/clojure/buildClojure.nix
@@ -1,4 +1,4 @@
-{ briefcase ? import <briefcase> {}, ... }:
+{ briefcase, ... }:
 
 briefcase.nix.buildClojure.program {
   name = "test";
diff --git a/default.nix b/default.nix
index cf7e61e4a990..8b973bd2d22d 100644
--- a/default.nix
+++ b/default.nix
@@ -9,11 +9,14 @@ let
   fix = f: let x = f x; in x;
 
   # Global configuration that all packages are called with.
-  config = pkgs: {
-    inherit pkgs;
+  config = self: {
+    inherit self;
+    pkgs = import <nixpkgs> {};
+    depot = import <depot> {};
+    briefcase = import <briefcase> {};
   };
 
-  readTree' = import ~/depot/nix/readTree {};
+  readTree' = import <depot/nix/readTree> {};
 
   # TODO: Find a better way to expose entire monorepo without introducing
   # "infinite recursion".
@@ -27,12 +30,6 @@ let
   };
 in fix(self: {
   config = config self;
-
-  # Expose readTree for downstream repo consumers.
-  readTree = {
-    __functor = x: (readTree' x.config);
-    config = self.config;
-  };
 }
 
 # Add local packages as structured by readTree
diff --git a/emacs/default.nix b/emacs/default.nix
index a61d6fb7020e..094b1c3db6a5 100644
--- a/emacs/default.nix
+++ b/emacs/default.nix
@@ -1,11 +1,7 @@
-{
-  pkgs ? import <nixpkgs> {},
-  depot ? import <depot> {},
-  ...
-}:
+{ pkgs, depot, ... }:
 
 let
-  utils = import ~/briefcase/utils;
+  utils = import <briefcase/utils>;
   # NOTE: I'm trying to keep the list of dependencies herein constrained to a
   # list of generic dependencies (i.e. not project or language specific). For
   # language-specific tooling, I'm intending to use shell.nix alongside lorri
diff --git a/fish/default.nix b/fish/default.nix
index d5ec372a5dea..f55e24af1cda 100644
--- a/fish/default.nix
+++ b/fish/default.nix
@@ -1,4 +1,4 @@
-{ pkgs ? import <nixpkgs> {} , ... }:
+{ pkgs, ... }:
 
 # TODO: Is it appropriate to put programming language dependencies here? Should
 # I have a bin dependency for every fish `abbr` and `alias` that I use? What
diff --git a/go/shell.nix b/go/shell.nix
index 836718d85f29..e98da7d0f84a 100644
--- a/go/shell.nix
+++ b/go/shell.nix
@@ -1,4 +1,4 @@
-{ pkgs ? import <nixpkgs> {}, ... }:
+{ pkgs, ... }:
 
 pkgs.mkShell {
   buildInputs = [
diff --git a/gopkgs/kv/default.nix b/gopkgs/kv/default.nix
index 1d54ecc350df..c89e002139e2 100644
--- a/gopkgs/kv/default.nix
+++ b/gopkgs/kv/default.nix
@@ -1,7 +1,4 @@
-{
-  depot ? import <depot> {},
-  ...
-}:
+{ depot, ... }:
 
 depot.buildGo.package {
   name = "kv";
diff --git a/gopkgs/utils/default.nix b/gopkgs/utils/default.nix
index d92b82ca4d03..5955fa4cfbde 100644
--- a/gopkgs/utils/default.nix
+++ b/gopkgs/utils/default.nix
@@ -1,7 +1,4 @@
-{
-  depot ? import <depot> {},
-  ...
-}:
+{ depot, ... }:
 
 depot.buildGo.package {
   name = "utils";
diff --git a/lisp/f/default.nix b/lisp/f/default.nix
index 0ca6898b6a15..f64bfcc5f0d1 100644
--- a/lisp/f/default.nix
+++ b/lisp/f/default.nix
@@ -1,8 +1,4 @@
-{
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ depot, briefcase, ... }:
 
 depot.nix.buildLisp.library {
   name = "f";
diff --git a/lisp/prelude.nix b/lisp/prelude.nix
index 9051f82394ff..5fe5d628e099 100644
--- a/lisp/prelude.nix
+++ b/lisp/prelude.nix
@@ -1,4 +1,4 @@
-{ depot ? import <depot> {}, ... }:
+{ depot, ... }:
 
 depot.nix.buildLisp.library {
   name = "prelude";
diff --git a/mail/default.nix b/mail/default.nix
index d1b67b965626..a149ed8123bc 100644
--- a/mail/default.nix
+++ b/mail/default.nix
@@ -1,4 +1,4 @@
-{ depot ? import <depot> {}, ... }:
+{ depot, ... }:
 
 let
   inherit (builtins) fetchGit;
diff --git a/monzo_ynab/job.nix b/monzo_ynab/job.nix
index f6cb78789000..1e10751012e2 100644
--- a/monzo_ynab/job.nix
+++ b/monzo_ynab/job.nix
@@ -1,8 +1,4 @@
-{
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ depot, briefcase, ... }:
 
 depot.buildGo.program {
   name = "job";
diff --git a/monzo_ynab/shell.nix b/monzo_ynab/shell.nix
index be185dd1d6d9..efdc5d3e4233 100644
--- a/monzo_ynab/shell.nix
+++ b/monzo_ynab/shell.nix
@@ -1,8 +1,4 @@
-{
-  pkgs ? import <nixpkgs> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ pkgs, briefcase, ... }:
 
 pkgs.mkShell {
   buildInputs = [
diff --git a/monzo_ynab/tokens.nix b/monzo_ynab/tokens.nix
index a00191a20782..97de09d741e9 100644
--- a/monzo_ynab/tokens.nix
+++ b/monzo_ynab/tokens.nix
@@ -1,8 +1,4 @@
-{
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ depot, briefcase, ... }:
 
 let
   auth = depot.buildGo.package {
diff --git a/scratch/deepmind/part_two/shell.nix b/scratch/deepmind/part_two/shell.nix
index 606dd7167f7c..f1b02c4d2ed5 100644
--- a/scratch/deepmind/part_two/shell.nix
+++ b/scratch/deepmind/part_two/shell.nix
@@ -1,4 +1,4 @@
-{ pkgs ? import <nixpkgs> {}, ... }:
+{ pkgs, ... }:
 
 pkgs.mkShell {
   buildInputs = with pkgs; [
diff --git a/shell.nix b/shell.nix
index ef8960b822db..f3978bd69e1b 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,4 +1,4 @@
-{ pkgs ? import <nixpkgs> {}, ... }:
+{ pkgs, ... }:
 
 pkgs.mkShell rec {
   buildInputs = [];
diff --git a/third_party/lisp/anaphora.nix b/third_party/lisp/anaphora.nix
index 04a1dd847feb..bf4bf663f4d4 100644
--- a/third_party/lisp/anaphora.nix
+++ b/third_party/lisp/anaphora.nix
@@ -1,4 +1,4 @@
-{ depot ? import <depot> {}, ... }:
+{ depot, ... }:
 
 let
   src = builtins.fetchGit {
diff --git a/third_party/lisp/cl-arrows.nix b/third_party/lisp/cl-arrows.nix
index 60cd8a375b1c..4c09d688fae7 100644
--- a/third_party/lisp/cl-arrows.nix
+++ b/third_party/lisp/cl-arrows.nix
@@ -1,4 +1,4 @@
-{ depot ? import <depot> {}, ... }:
+{ depot, ... }:
 
 let
   src = builtins.fetchGit {
diff --git a/third_party/lisp/cl-colors.nix b/third_party/lisp/cl-colors.nix
index 6d49dd7aa582..fa35b755dbbc 100644
--- a/third_party/lisp/cl-colors.nix
+++ b/third_party/lisp/cl-colors.nix
@@ -1,8 +1,4 @@
-{
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ depot, briefcase, ... }:
 
 let
   src = builtins.fetchGit {
diff --git a/third_party/lisp/let-plus.nix b/third_party/lisp/let-plus.nix
index 6e74b9622ec7..a750443fd1c8 100644
--- a/third_party/lisp/let-plus.nix
+++ b/third_party/lisp/let-plus.nix
@@ -1,8 +1,4 @@
-{
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ depot, briefcase, ... }:
 
 let
   src = builtins.fetchGit {
diff --git a/third_party/lisp/linear-programming.nix b/third_party/lisp/linear-programming.nix
index 432fedb8bcac..fc95787a1d85 100644
--- a/third_party/lisp/linear-programming.nix
+++ b/third_party/lisp/linear-programming.nix
@@ -1,4 +1,4 @@
-{ depot ? import <depot> {}, ... }:
+{ depot, ... }:
 
 let
   src = builtins.fetchGit {
diff --git a/third_party/lisp/prove.nix b/third_party/lisp/prove.nix
index 2579d0392ee6..7c5879b1fded 100644
--- a/third_party/lisp/prove.nix
+++ b/third_party/lisp/prove.nix
@@ -1,8 +1,4 @@
-{
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ depot, briefcase, ... }:
 
 let
   src = builtins.fetchGit {
diff --git a/tools/rfcToKindle/default.nix b/tools/rfcToKindle/default.nix
index 3bfa71f2896d..8fb93c3bb5b8 100644
--- a/tools/rfcToKindle/default.nix
+++ b/tools/rfcToKindle/default.nix
@@ -1,6 +1,4 @@
-{
-  depot ? import <depot> {}, ...
-}:
+{ depot, ... }:
 
 # TODO: This doesn't depend on `sendgmr` at the moment, but it should. As such,
 # it's an imcomplete packaging.
diff --git a/tools/run/default.nix b/tools/run/default.nix
index 113491536ee5..7d772c3f9079 100644
--- a/tools/run/default.nix
+++ b/tools/run/default.nix
@@ -1,9 +1,4 @@
-{
-  pkgs ? import <nixpkgs> {},
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ pkgs, depot, briefcase, ... }:
 
 depot.buildGo.program {
   name = "run";
diff --git a/tools/run/shell.nix b/tools/run/shell.nix
index 8b97f04ca446..de192ae150c7 100644
--- a/tools/run/shell.nix
+++ b/tools/run/shell.nix
@@ -1,4 +1,4 @@
-{ pkgs ? import <nixpkgs> {}, ... }:
+{ pkgs, ... }:
 
 pkgs.mkShell {
   buildInputs = with pkgs; [
diff --git a/tools/simple_vim/default.nix b/tools/simple_vim/default.nix
index 7ea0b5ebc8a1..7132a649232d 100644
--- a/tools/simple_vim/default.nix
+++ b/tools/simple_vim/default.nix
@@ -1,4 +1,4 @@
-{ pkgs ? import <nixpkgs> {}, ... }:
+{ pkgs, ... }:
 
 let
   script = pkgs.writeShellScriptBin "simple_vim" ''
diff --git a/tools/symlinkManager/default.nix b/tools/symlinkManager/default.nix
index 6500991babb9..16bb26bb3c2e 100644
--- a/tools/symlinkManager/default.nix
+++ b/tools/symlinkManager/default.nix
@@ -1,8 +1,4 @@
-{
-  depot ? import <depot> {},
-  briefcase ? import <briefcase> {},
-  ...
-}:
+{ depot, briefcase, ... }:
 
 depot.buildGo.program {
   name = "symlink-mgr";