about summary refs log tree commit diff
path: root/nixos/socrates
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-03-01T22·32+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-03-01T22·44+0000
commit6eb239dcce6b4cba879acdc9f592eef38de7101e (patch)
tree697321f93bf8644c91a541e7deea31da935a2af9 /nixos/socrates
parent3e51bf600a13a0a4edb12400504a8d07cb2e04c6 (diff)
Manually require dependencies for <nixpkgs>, <briefcase>
When I build socrates using `sudo nixos-rebuild [...] switch`, my
`nixos-config` (i.e. <briefcase/nixos/socrates/default.nix>) is a simple Nix
anonymous function. Typically readTree populates my pkgs, briefcase, depot
function parameters with <nixpkgs>, <briefcase>, <depot>, but `nixos-rebuild` is
unaware of `readTree`.

For now I'm manually importing these dependencies, and I'm leaving a TODO to
reconsider switching to the `{ pkgs, briefcase, ... }` style when I better
understand NixOS.
Diffstat (limited to 'nixos/socrates')
-rw-r--r--nixos/socrates/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/socrates/default.nix b/nixos/socrates/default.nix
index 1692ac356ec2..76654944b3d2 100644
--- a/nixos/socrates/default.nix
+++ b/nixos/socrates/default.nix
@@ -1,6 +1,12 @@
-{ pkgs, briefcase, ... }:
-
 let
+  # TODO(wpcarro): Instead of importing these dependencies as parameters that
+  # readTree will expose I need to import these dependencies manually because
+  # I'm building this using `nixos-rebuild`. When I better understand how to
+  # build socrates using readTree, prefer defining this as an anonymous
+  # function.
+  pkgs = import <nixpkgs> {};
+  briefcase = import <briefcase> {};
+
   trimNewline = x: pkgs.lib.removeSuffix "\n" x;
   readSecret = x: trimNewline (builtins.readFile ("/etc/secrets/" + x));
 in pkgs.lib.fix(self: {