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.
This commit is contained in:
parent
3e51bf600a
commit
6eb239dcce
1 changed files with 8 additions and 2 deletions
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue