fix: don't run tests in consumers of the lib

This commit is contained in:
eric
2026-03-06 17:37:27 +01:00
parent 1399862dec
commit 4d2579ae1e
3 changed files with 24 additions and 4 deletions

View File

@@ -33,6 +33,7 @@ Create your shell from `mkDevShell`:
```nix ```nix
env = devshell-lib.lib.mkDevShell { env = devshell-lib.lib.mkDevShell {
inherit system; inherit system;
src = ./.;
extraPackages = [ ]; extraPackages = [ ];
tools = [ ]; tools = [ ];
additionalHooks = { }; additionalHooks = { };

View File

@@ -32,6 +32,7 @@
mkDevShell = mkDevShell =
{ {
system, system,
src ? ./.,
extraPackages ? [ ], extraPackages ? [ ],
extraShellHook ? "", extraShellHook ? "",
additionalHooks ? { }, additionalHooks ? { },
@@ -78,7 +79,7 @@
}; };
pre-commit-check = git-hooks.lib.${system}.run { pre-commit-check = git-hooks.lib.${system}.run {
src = ./.; inherit src;
hooks = { hooks = {
treefmt = { treefmt = {
enable = true; enable = true;

View File

@@ -80,7 +80,13 @@
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
config = mkDevShellConfig pkgs; config = mkDevShellConfig pkgs;
env = devshell-lib.lib.mkDevShell ( env = devshell-lib.lib.mkDevShell (
({ inherit system; } // config) (
{
inherit system;
src = ./.;
}
// config
)
// { // {
extraPackages = config.extraPackages ++ [ self.packages.${system}.release ]; extraPackages = config.extraPackages ++ [ self.packages.${system}.release ];
} }
@@ -102,7 +108,13 @@
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
config = mkDevShellConfig pkgs; config = mkDevShellConfig pkgs;
env = devshell-lib.lib.mkDevShell ({ inherit system; } // config); env = devshell-lib.lib.mkDevShell (
{
inherit system;
src = ./.;
}
// config
);
in in
{ {
inherit (env) pre-commit-check; inherit (env) pre-commit-check;
@@ -115,7 +127,13 @@
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
config = mkDevShellConfig pkgs; config = mkDevShellConfig pkgs;
in in
(devshell-lib.lib.mkDevShell ({ inherit system; } // config)).formatter (devshell-lib.lib.mkDevShell (
{
inherit system;
src = ./.;
}
// config
)).formatter
); );
# Release command (`release`) # Release command (`release`)