nix-direnv/shell.nix
Bryan Bennett c59b60e747 Switch to bats over pytest
This removes python entirely from the stack.
Yet to run the tests on macOS, but they're buildable by way of nix
wrapping. Worst case scenario, you cannot run them from the devshell
but `nix run .#test-runner-<latest||stable>` should work okay.
2025-08-19 08:44:42 -04:00

30 lines
742 B
Nix

{
pkgs ? import <nixpkgs> { },
treefmt ? null,
nix-direnv ? (pkgs.callPackage ./default.nix { }),
test_pkgs ? (pkgs.lib.callPackagesWith pkgs ./tests { inherit nix-direnv; }),
}:
let
inherit (pkgs) lib;
in
pkgs.mkShell {
DIRENV_STDLIB = "${test_pkgs.direnv-stdlib}";
DIRENVRC = "${nix-direnv}/share/nix-direnv/direnvrc";
BATS_LIB_PATH = lib.strings.makeSearchPath "" (
with test_pkgs;
[
bats-support
bats-assert
]
);
packages =
(builtins.attrValues {
inherit (pkgs)
bats
direnv
shellcheck
;
})
++ (builtins.attrValues (lib.attrsets.filterAttrs (name: _val: name != "direnv-stdlib") test_pkgs))
++ lib.optionals (treefmt != null) [ treefmt ];
}