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..7963ede --- /dev/null +++ b/source/recipes/build/nix-non-flake/tempwork/flake.nix @@ -0,0 +1,63 @@ +{ + 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; }; +# helloNix = pkgs.stdenv.mkDerivation { +# name = "hello-nix"; +# src = hello-nix; +# installPhase = +# '' +# mkdir -p $out/bin +# cp $src/hello-nix $out/bin/hello-nix +# chmod +x $out/bin/hello-nix +# ''; +# }; + 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/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 ]; - }; - }; - } - ); -}