Skip to content

Commit 4e9fce4

Browse files
authored
Merge pull request #581 from jmmaloney4/nbstripout
Add `nbstripout` hook
2 parents ff879b2 + c3b6489 commit 4e9fce4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

modules/hooks.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,12 @@ in
932932
};
933933
};
934934
};
935+
nbstripout = mkOption {
936+
description = "nbstripout hook";
937+
type = types.submodule {
938+
imports = [ hookModule ];
939+
};
940+
};
935941
nixfmt = mkOption {
936942
description = "Deprecated nixfmt hook. Use nixfmt-classic or nixfmt-rfc-style instead.";
937943
visible = false;
@@ -3283,6 +3289,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
32833289
entry = "${hooks.name-tests-test.package}/bin/tests_should_end_in_test.py";
32843290
files = "(^|/)tests/\.+\\.py$";
32853291
};
3292+
nbstripout =
3293+
{
3294+
name = "nbstripout";
3295+
description = "Strip output from Jupyter notebooks";
3296+
package = tools.nbstripout;
3297+
entry = "${hooks.nbstripout.package}/bin/nbstripout";
3298+
files = "\\.ipynb$";
3299+
};
32863300
nil =
32873301
{
32883302
name = "nil";

nix/tools.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
, mdformat
4848
, mdl
4949
, mdsh
50+
, nbstripout
5051
, nil
5152
, nixfmt
5253
, nixfmt-classic ? null
@@ -148,6 +149,7 @@ in
148149
mdformat
149150
mdl
150151
mdsh
152+
nbstripout
151153
nil
152154
nixpkgs-fmt
153155
opentofu

0 commit comments

Comments
 (0)