mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-01-26 16:37:12 +08:00
temp
This commit is contained in:
parent
5dd1d42a13
commit
dda3f7db65
3 changed files with 63 additions and 27 deletions
63
source/recipes/build/nix-non-flake/tempwork/flake.nix
Normal file
63
source/recipes/build/nix-non-flake/tempwork/flake.nix
Normal file
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue