From 6eb239dcce6b4cba879acdc9f592eef38de7101e Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sun, 1 Mar 2020 22:32:43 +0000 Subject: Manually require dependencies for , When I build socrates using `sudo nixos-rebuild [...] switch`, my `nixos-config` (i.e. ) is a simple Nix anonymous function. Typically readTree populates my pkgs, briefcase, depot function parameters with , , , 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. --- nixos/socrates/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'nixos/socrates/default.nix') 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 {}; + briefcase = import {}; + trimNewline = x: pkgs.lib.removeSuffix "\n" x; readSecret = x: trimNewline (builtins.readFile ("/etc/secrets/" + x)); in pkgs.lib.fix(self: { -- cgit 1.4.1