Skip to content

Commit

Permalink
Add more fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDesforges committed Sep 20, 2023
1 parent b9ab1b9 commit de11f79
Show file tree
Hide file tree
Showing 9 changed files with 220 additions and 0 deletions.
61 changes: 61 additions & 0 deletions tests/fixtures/flake-direct-nativeBuildInput/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions tests/fixtures/flake-direct-nativeBuildInput/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

pkg1 = pkgs.stdenv.mkDerivation {
name = "pkg1";
src = ./pkg1;
buildInputs = [ pkgs.bash ];
installPhase = ''
mkdir -p $out/bin
cp $src/* $out/bin
'';
};

pkg2 = pkgs.stdenv.mkDerivation {
name = "pkg2";
src = ./pkg2;
nativeBuildInputs = [ pkgs.bash pkg1 ];
buildPhase = ''
pkg1
'';
installPhase = ''
mkdir -p $out/bin
cp $src/* $out/bin
'';
};

in
{
packages.default = pkg2;
}
);
}
2 changes: 2 additions & 0 deletions tests/fixtures/flake-direct-nativeBuildInput/pkg1/pkg1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo "pkg1"
2 changes: 2 additions & 0 deletions tests/fixtures/flake-direct-nativeBuildInput/pkg2/pkg2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo "pkg2"
61 changes: 61 additions & 0 deletions tests/fixtures/flake-three-levels/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions tests/fixtures/flake-three-levels/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

pkg1 = pkgs.stdenv.mkDerivation {
name = "pkg1";
src = ./pkg1;
buildInputs = [ pkgs.bash ];
installPhase = ''
mkdir -p $out/bin
cp $src/* $out/bin
'';
};

pkg2 = pkgs.stdenv.mkDerivation {
name = "pkg2";
src = ./pkg2;
buildInputs = [ pkgs.bash pkg1 ];
buildPhase = ''
pkg1
'';
installPhase = ''
mkdir -p $out/bin
cp $src/* $out/bin
'';
};

pkg3 = pkgs.stdenv.mkDerivation {
name = "pkg3";
src = ./pkg3;
buildInputs = [ pkgs.bash pkg2 ];
buildPhase = ''
pkg2
'';
installPhase = ''
mkdir -p $out/bin
cp $src/* $out/bin
'';
};
in
{
packages.default = pkg3;
}
);
}
2 changes: 2 additions & 0 deletions tests/fixtures/flake-three-levels/pkg1/pkg1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo "pkg1"
2 changes: 2 additions & 0 deletions tests/fixtures/flake-three-levels/pkg2/pkg2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo "pkg2"
2 changes: 2 additions & 0 deletions tests/fixtures/flake-three-levels/pkg3/pkg3
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo "pkg3"

0 comments on commit de11f79

Please sign in to comment.