Last active
May 2, 2022 18:17
-
-
Save rossabaker/ee12a3b9ffe2464a1c3555f24130e3ee to your computer and use it in GitHub Desktop.
Input From Derivation hijinks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
let | |
# In the real world, this is an org tangle. | |
hello = pkgs.writeText "hello" '' | |
{ pkgs, ... }: { | |
home.packages = [ pkgs.hello ]; | |
} | |
''; | |
# This is the import-from-derivation | |
helloModule = (import hello); | |
in { | |
# $ home-manager -I home-manager=https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz build -f default.nix && ./result/home-path/bin/hello | |
# error: infinite recursion encountered | |
# | |
# at /nix/store/rhbx7pmfz3c5ha887rjl4rzcwhhxp747-nixpkgs-22.05pre339569.7dcb25726b3/nixpkgs/lib/modules.nix:385:28: | |
# 384| builtins.addErrorContext (context name) | |
# 385| (args.${name} or config._module.args.${name}) | |
# | ^ | |
# 386| ) (lib.functionArgs f); | |
imports = [ helloModule ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muskoverse thread