diff --git a/index.html b/index.html index a6dc620..4195c95 100644 --- a/index.html +++ b/index.html @@ -5424,10 +5424,10 @@ hello-nix flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; - helloNix = import hello-nix { inherit pkgs; }; - in - { - packages = rec { + helloNix = import hello-nix { inherit pkgs; }; + in + { + packages = rec { hello = pkgs.stdenv.mkDerivation rec { name = "hello-again"; @@ -5443,16 +5443,16 @@ hello-nix cp $src/hello-again $out/bin chmod +x $out/bin/hello-again - # modify the hello-again script so it can find hello-nix - HELLO=$(type -p hello-nix) - sed "s_hello-nix_"$HELLO"_" --in-place $out/bin/hello-again - ''; - - - buildInputs = [ helloNix ]; - }; - default = hello; - }; + # modify the hello-again script so it can find hello-nix + HELLO=$(type -p hello-nix) + sed "s_hello-nix_"$HELLO"_" --in-place $out/bin/hello-again + ''; + + + buildInputs = [ helloNix ]; + }; + default = hello; + }; apps = rec { hello = flake-utils.lib.mkApp { drv = self.packages.${system}.hello; }; @@ -5499,9 +5499,6 @@ In that case, adding the dependency to buildInputs is sufficient.
$ nix run
-this derivation will be built:
-  /nix/store/jdh3r0w60rddfk1k0wfp6dcxj9ld0xhi-hello-again.drv
-building '/nix/store/jdh3r0w60rddfk1k0wfp6dcxj9ld0xhi-hello-again.drv'...
 I'm a flake, but I'm running a command defined in a non-flake package.
 Hello from your nix package!
@@ -5567,7 +5564,7 @@ Hello from your flake! diff --git a/source/recipes/build/nix-non-flake/main.adoc0 b/source/recipes/build/nix-non-flake/main.adoc0 index cb4ac2f..092b222 100644 --- a/source/recipes/build/nix-non-flake/main.adoc0 +++ b/source/recipes/build/nix-non-flake/main.adoc0 @@ -30,8 +30,8 @@ $# cat hello-again $# cat flake.nix .... -Lines 5-8 and 17 were explained in <<#devshell-nix-non-flake>>. -As expected, we need to add `helloNix` as a build input, which we do in line 36. +Lines 5-8 and 15 were explained in <<#devshell-nix-non-flake>>. +As expected, we need to add `helloNix` as a build input, which we do in line 40. That does make it available at build and runtime, but it doesn't put it on the path, so our `hello-again` script won't be able to find it.