diff --git a/index.html b/index.html index 1653662..4c02670 100644 --- a/index.html +++ b/index.html @@ -5568,7 +5568,7 @@ Hello from your flake! diff --git a/source/recipes/devshell/nix-non-flake/tempwork/flake.lock b/source/recipes/build/nix-non-flake/tempwork/flake.lock similarity index 100% rename from source/recipes/devshell/nix-non-flake/tempwork/flake.lock rename to source/recipes/build/nix-non-flake/tempwork/flake.lock diff --git a/source/recipes/build/nix-non-flake/tempwork/flake.nix b/source/recipes/build/nix-non-flake/tempwork/flake.nix new file mode 100644 index 0000000..3d6f9a9 --- /dev/null +++ b/source/recipes/build/nix-non-flake/tempwork/flake.nix @@ -0,0 +1,51 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + hello-nix = { + url = "git+https://codeberg.org/mhwombat/hello-nix"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, flake-utils, hello-nix }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + helloNix = import hello-nix { inherit pkgs; }; + in + { + packages = rec { + hello = pkgs.stdenv.mkDerivation rec { + name = "hello-again"; + + src = ./.; + + unpackPhase = "true"; + + buildPhase = ":"; + + installPhase = + '' + mkdir -p $out/bin + 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; + }; + + apps = rec { + hello = flake-utils.lib.mkApp { drv = self.packages.${system}.hello; }; + default = hello; + }; + } + ); +} diff --git a/source/recipes/build/nix-non-flake/tempwork/hello-again b/source/recipes/build/nix-non-flake/tempwork/hello-again new file mode 100755 index 0000000..5315da4 --- /dev/null +++ b/source/recipes/build/nix-non-flake/tempwork/hello-again @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +echo "I'm a flake, but I'm running a command defined in a non-flake package." +hello-nix diff --git a/source/recipes/devshell/nix-non-flake/tempwork/flake.nix b/source/recipes/devshell/nix-non-flake/tempwork/flake.nix deleted file mode 100644 index b4b97a6..0000000 --- a/source/recipes/devshell/nix-non-flake/tempwork/flake.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - hello-nix = { - url = "git+https://codeberg.org/mhwombat/hello-nix"; - flake = false; - }; - }; - - outputs = { self, nixpkgs, flake-utils, hello-nix }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - }; - helloNix = import hello-nix { inherit pkgs; }; - in - { - devShells = rec { - default = pkgs.mkShell { - packages = [ helloNix ]; - }; - }; - } - ); -}