diff --git a/default.nix b/default.nix index a3c7f04..4dde1cf 100644 --- a/default.nix +++ b/default.nix @@ -1,15 +1,19 @@ { stdenv, lib, - shellcheck-minimal, + git, + gnused, + bash, bats, + shellcheck-minimal, gitMinimal, + resholve, }: let fs = lib.fileset; in -stdenv.mkDerivation { +resholve.mkDerivation { pname = "git-check-assertions"; version = "0.0.1"; @@ -32,6 +36,7 @@ stdenv.mkDerivation { ]; checkPhase = '' + runHook preCheck shellcheck git-check-assertions test.bats git init git config user.email test @@ -39,15 +44,32 @@ stdenv.mkDerivation { git checkout -b main git commit --allow-empty -m "initial" ./test.bats + runHook postCheck ''; doCheck = true; installPhase = '' + runHook preInstall mkdir -p $out/bin cp $src/git-check-assertions $out/bin/git-check-assertions - chmod +x $out/bin/git-check-assertions + runHook postInstall ''; + solutions.default = { + scripts = [ "bin/git-check-assertions" ]; + interpreter = lib.getExe bash; + inputs = [ + gitMinimal + gnused + bash + ]; + execer = [ + # Not true at all, but ¯\_(ツ)_/¯ + "cannot:${lib.getExe bash}" + "cannot:${lib.getExe gitMinimal}" + ]; + }; + meta.mainProgram = "git-check-assertions"; }