diff --git a/modules/hooks.nix b/modules/hooks.nix index c102706e..b4a2a159 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -913,6 +913,12 @@ in }; }; }; + nbstripout = mkOption { + description = "nbstripout hook"; + type = types.submodule { + imports = [ hookModule ]; + }; + }; nixfmt = mkOption { description = "Deprecated nixfmt hook. Use nixfmt-classic or nixfmt-rfc-style instead."; visible = false; @@ -3234,6 +3240,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm entry = "${hooks.name-tests-test.package}/bin/tests_should_end_in_test.py"; files = "(^|/)tests/\.+\\.py$"; }; + nbstripout = + { + name = "nbstripout"; + description = "Strip output from Jupyter notebooks"; + package = tools.nbstripout; + entry = "${hooks.nbstripout.package}/bin/nbstripout"; + files = "\\.ipynb$"; + }; nil = { name = "nil"; diff --git a/nix/tools.nix b/nix/tools.nix index 2ef42b80..d36d06cc 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -47,6 +47,7 @@ , mdformat , mdl , mdsh +, nbstripout , nil , nixfmt , nixfmt-classic ? null @@ -145,6 +146,7 @@ in mdformat mdl mdsh + nbstripout nil nixpkgs-fmt opentofu