Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Nov 5, 2022
1 parent aa013d6 commit 1ee64b8
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 85 deletions.
16 changes: 10 additions & 6 deletions flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ in
options = {
pre-commit = {
check.enable = mkOption {
description = ''
Whether to add a derivation to the flake <literal>checks</literal>.
description = lib.mdDoc ''
Whether to add a derivation to the flake `checks`.
It will perform the pre-commit checks in `nix flake check`.
You can disable this if one of your hooks does not run properly in
You can disable this if one of your hooks do not run properly in
the Nix sandbox; for example because it needs network access.
'';
type = types.bool;
default = true;
};
pkgs = mkOption {
type = types.uniq (types.lazyAttrsOf (types.raw or types.unspecified));
description = ''
Nixpkgs to use for pre-commit checking.
description = lib.mdDoc ''
Nixpkgs to use in the pre-commit [`settings`](#opt-perSystem.pre-commit.settings).
'';
default = pkgs;
defaultText = lib.literalDocBook "<literal>pkgs</literal> (module argument)";
Expand All @@ -43,10 +44,13 @@ in
specialArgs = { inherit (cfg) pkgs; };
};
default = { };
description = lib.mdDoc ''
The pre-commit-hooks.nix configuration.
'';
};
installationScript = mkOption {
type = types.str;
description = "A bash fragment that sets up pre-commit.";
description = lib.mdDoc "A bash fragment that sets up [pre-commit](https://pre-commit.com/).";
default = cfg.settings.installationScript;
defaultText = lib.literalDocBook "bash statements";
readOnly = true;
Expand Down
Loading

0 comments on commit 1ee64b8

Please sign in to comment.