Skip to content

Commit be57485

Browse files
ci/treefmt: add markdown-code-runner (#427460)
2 parents c5739c7 + a7b3b25 commit be57485

File tree

6 files changed

+28
-40
lines changed

6 files changed

+28
-40
lines changed

ci/default.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ let
7575
includes = [ "*" ];
7676
priority = 1;
7777
};
78+
79+
# TODO: Upstream this into treefmt-nix eventually:
80+
# https://github.com/numtide/treefmt-nix/issues/387
81+
settings.formatter.markdown-code-runner = {
82+
command = pkgs.lib.getExe pkgs.markdown-code-runner;
83+
options =
84+
let
85+
config = pkgs.writers.writeTOML "markdown-code-runner-config" {
86+
presets.nixfmt = {
87+
language = "nix";
88+
command = [ (pkgs.lib.getExe pkgs.nixfmt) ];
89+
};
90+
};
91+
in
92+
[ "--config=${config}" ];
93+
includes = [ "*.md" ];
94+
};
7895
};
7996
fs = pkgs.lib.fileset;
8097
nixFilesSrc = fs.toSource {

doc/doc-support/package.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ stdenvNoCC.mkDerivation (
137137

138138
tests = {
139139
manpage-urls = callPackage ../tests/manpage-urls.nix { };
140-
check-nix-code-blocks = callPackage ../tests/check-nix-code-blocks.nix { };
141140
};
142141
};
143142
}

doc/tests/check-nix-code-blocks.nix

Lines changed: 0 additions & 32 deletions
This file was deleted.

doc/tests/mdcr-config.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

nixos/doc/manual/development/modular-services.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@ So note that the default value of `system.services.<name>` is not a complete ser
4545
It is possible to write service modules that are portable. This is done by either avoiding the `systemd` option tree, or by defining process-manager-specific definitions in an optional way:
4646

4747
```nix
48-
{ config, options, lib, ... }: {
48+
{
49+
config,
50+
options,
51+
lib,
52+
...
53+
}:
54+
{
4955
_class = "service";
5056
config = {
5157
process.argv = [ (lib.getExe config.foo.program) ];
52-
} // lib.optionalAttrs (options?systemd) {
58+
}
59+
// lib.optionalAttrs (options ? systemd) {
5360
# ... systemd-specific definitions ...
5461
};
5562
}

nixos/modules/services/mail/mailman.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ For a basic configuration with Postfix as the MTA, the following settings are su
1919
local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ];
2020
relay_domains = [ "hash:/var/lib/mailman/data/postfix_domains" ];
2121
smtpd_tls_chain_files = [
22-
config.security.acme.certs."lists.example.org".directory + "/full.pem"
23-
config.security.acme.certs."lists.example.org".directory + "/key.pem"
22+
(config.security.acme.certs."lists.example.org".directory + "/full.pem")
23+
(config.security.acme.certs."lists.example.org".directory + "/key.pem")
2424
];
2525
};
2626
};

0 commit comments

Comments
 (0)