nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, zig, testers, findup }:
2
3stdenv.mkDerivation rec {
4 pname = "findup";
5 version = "1.1";
6
7 src = fetchFromGitHub {
8 owner = "hiljusti";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-fafMBC/ibCHgC3JwCNEh74Qw/yZ+KQF//z1e+OpeGus=";
12 };
13
14 nativeBuildInputs = [ zig ];
15
16 # Builds and installs (at the same time) with Zig.
17 dontConfigure = true;
18 dontBuild = true;
19
20 # Give Zig a directory for intermediate work.
21 preInstall = ''
22 export HOME=$TMPDIR
23 '';
24
25 installPhase = ''
26 runHook preInstall
27 zig build -Drelease-safe -Dcpu=baseline --prefix $out
28 runHook postInstall
29 '';
30
31 passthru.tests.version = testers.testVersion { package = findup; };
32
33 meta = with lib; {
34 homepage = "https://github.com/hiljusti/findup";
35 description = "Search parent directories for sentinel files";
36 license = licenses.mit;
37 maintainers = with maintainers; [ hiljusti ];
38 };
39}