diff --git a/ci/default.nix b/ci/default.nix index eaa1879c34b4..727e591a90b8 100644 --- a/ci/default.nix +++ b/ci/default.nix @@ -75,6 +75,23 @@ let includes = [ "*" ]; priority = 1; }; + + # TODO: Upstream this into treefmt-nix eventually: + # https://github.com/numtide/treefmt-nix/issues/387 + settings.formatter.markdown-code-runner = { + command = pkgs.lib.getExe pkgs.markdown-code-runner; + options = + let + config = pkgs.writers.writeTOML "markdown-code-runner-config" { + presets.nixfmt = { + language = "nix"; + command = [ (pkgs.lib.getExe pkgs.nixfmt) ]; + }; + }; + in + [ "--config=${config}" ]; + includes = [ "*.md" ]; + }; }; fs = pkgs.lib.fileset; nixFilesSrc = fs.toSource { diff --git a/doc/doc-support/package.nix b/doc/doc-support/package.nix index aefc301ec81c..8ed6865a1c90 100644 --- a/doc/doc-support/package.nix +++ b/doc/doc-support/package.nix @@ -137,7 +137,6 @@ stdenvNoCC.mkDerivation ( tests = { manpage-urls = callPackage ../tests/manpage-urls.nix { }; - check-nix-code-blocks = callPackage ../tests/check-nix-code-blocks.nix { }; }; }; } diff --git a/doc/tests/check-nix-code-blocks.nix b/doc/tests/check-nix-code-blocks.nix deleted file mode 100644 index 5ec934f6bba8..000000000000 --- a/doc/tests/check-nix-code-blocks.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - runCommand, - markdown-code-runner, - nixfmt-rfc-style, -}: - -runCommand "manual_check-nix-code-blocks" - { - nativeBuildInputs = [ - markdown-code-runner - nixfmt-rfc-style - ]; - } - '' - set +e - - mdcr --check --config ${./mdcr-config.toml} ${./..} - - if [ $? -ne 0 ]; then - cat <