Skip to content

Commit

Permalink
Make the docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Nov 5, 2022
1 parent 59b6499 commit 68079e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ in
Nixpkgs to use for pre-commit checking.
'';
default = pkgs;
defaultText = "pkgs # module argument";
defaultText = lib.literalDocBook "<literal>pkgs</literal> (module argument)";
};
settings = mkOption {
type = types.submoduleWith {
Expand All @@ -38,6 +38,7 @@ in
type = types.str;
description = "A bash fragment that sets up pre-commit.";
default = cfg.settings.installationScript;
defaultText = lib.literalDocBook "bash statements";
readOnly = true;
};
};
Expand Down
4 changes: 4 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ in
description =
"Prettier binary path. E.g. if you want to use the prettier in node_modules, use ./node_modules/.bin/prettier";
default = "${tools.prettier}/bin/prettier";
defaultText = lib.literalExpression ''
"''${tools.prettier}/bin/prettier"
'';
};
};
eslint =
Expand All @@ -122,6 +125,7 @@ in
description =
"Eslint binary path. E.g. if you want to use the eslint in node_modules, use ./node_modules/.bin/eslint";
default = "${tools.eslint}/bin/eslint";
defaultText = lib.literalExpression "\${tools.eslint}/bin/eslint";
};

extensions =
Expand Down
9 changes: 5 additions & 4 deletions modules/pre-commit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let
mkOption {
type = types.str;
default = name;
defaultText = literalExample "internal name, same as id";
defaultText = lib.literalDocBook or literalExample "internal name, same as id";
description =
''
The name of the hook - shown during hook execution.
Expand Down Expand Up @@ -202,7 +202,7 @@ in
The pre-commit package to use.
'';
defaultText =
literalExample ''
lib.literalExpression or literalExample ''
pkgs.pre-commit
'';
};
Expand All @@ -217,7 +217,7 @@ in
nix-pre-commit comes with its own set of packages for this purpose.
'';
defaultText =
literalExample ''pre-commit-hooks.nix-pkgs.callPackage tools-dot-nix { inherit (pkgs) system; }'';
lib.literalExpression or literalExample ''pre-commit-hooks.nix-pkgs.callPackage tools-dot-nix { inherit (pkgs) system; }'';
};

hooks =
Expand All @@ -240,6 +240,7 @@ in
'';
readOnly = true;
default = run;
defaultText = "<derivation>";
};

installationScript =
Expand Down Expand Up @@ -270,7 +271,7 @@ in
This is used in the derivation that performs the check.
'';
defaultText = literalExample ''gitignoreSource config.src'';
defaultText = lib.literalExpression or literalExample ''gitignoreSource config.src'';
};

excludes =
Expand Down

0 comments on commit 68079e4

Please sign in to comment.