Skip to content

Commit baf942e

Browse files
committed
hooks: add examples
1 parent bad3586 commit baf942e

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

modules/hooks.nix

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,16 @@ in
174174
mkOption {
175175
type = types.nullOr (types.oneOf [ types.str types.path ]);
176176
description = ''
177-
`biome` binary path. For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`.
177+
`biome` binary path.
178+
For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`.
178179
'';
179180
default = null;
181+
defaultText = lib.literalExpression ''
182+
"''${tools.biome}/bin/biome"
183+
'';
184+
example = lib.literalExpression ''
185+
"./node_modules/.bin/biome"
186+
'';
180187
};
181188

182189
write =
@@ -468,10 +475,16 @@ in
468475
mkOption {
469476
type = types.nullOr (types.oneOf [ types.str types.path ]);
470477
description = ''
471-
`eslint` binary path. For example, if you want to use the `eslint` binary from `node_modules`, use `"./node_modules/.bin/eslint"`.
478+
`eslint` binary path.
479+
For example, if you want to use the `eslint` binary from `node_modules`, use `"./node_modules/.bin/eslint"`.
472480
'';
473481
default = null;
474-
defaultText = lib.literalExpression "\${tools.eslint}/bin/eslint";
482+
defaultText = lib.literalExpression ''
483+
"''${tools.eslint}/bin/eslint"
484+
'';
485+
example = lib.literalExpression ''
486+
"./node_modules/.bin/eslint"
487+
'';
475488
};
476489

477490
extensions =
@@ -492,7 +505,7 @@ in
492505
binPath =
493506
mkOption {
494507
type = types.nullOr types.str;
495-
description = "flake8 binary path. Should be used to specify flake8 binary from your Nix-managed Python environment.";
508+
description = "flake8 binary path. Should be used to specify flake8 binary from your Python environment.";
496509
default = null;
497510
defaultText = lib.literalExpression ''
498511
"''${tools.flake8}/bin/flake8"
@@ -826,7 +839,7 @@ in
826839
binPath =
827840
mkOption {
828841
type = types.nullOr (types.oneOf [ types.str types.path ]);
829-
description = "mkdocs-linkcheck binary path. Should be used to specify the mkdocs-linkcheck binary from your Nix-managed Python environment.";
842+
description = "mkdocs-linkcheck binary path. Should be used to specify the mkdocs-linkcheck binary from your Python environment.";
830843
default = null;
831844
defaultText = lib.literalExpression ''
832845
"''${tools.mkdocs-linkcheck}/bin/mkdocs-linkcheck"
@@ -1050,13 +1063,17 @@ in
10501063
binPath =
10511064
mkOption {
10521065
description = ''
1053-
`prettier` binary path. For example, if you want to use the `prettier` binary from `node_modules`, use `"./node_modules/.bin/prettier"`.
1066+
`prettier` binary path.
1067+
For example, if you want to use the `prettier` binary from `node_modules`, use `"./node_modules/.bin/prettier"`.
10541068
'';
10551069
type = types.nullOr (types.oneOf [ types.str types.path ]);
10561070
default = null;
10571071
defaultText = lib.literalExpression ''
10581072
"''${tools.prettier}/bin/prettier"
10591073
'';
1074+
example = lib.literalExpression ''
1075+
"./node_modules/.bin/prettier"
1076+
'';
10601077
};
10611078
allow-parens =
10621079
mkOption {
@@ -1311,7 +1328,7 @@ in
13111328
binPath =
13121329
mkOption {
13131330
type = types.nullOr types.str;
1314-
description = "Pylint binary path. Should be used to specify Pylint binary from your Nix-managed Python environment.";
1331+
description = "Pylint binary path. Should be used to specify Pylint binary from your Python environment.";
13151332
default = null;
13161333
defaultText = lib.literalExpression ''
13171334
"''${tools.pylint}/bin/pylint"
@@ -1357,7 +1374,7 @@ in
13571374
binPath =
13581375
mkOption {
13591376
type = types.nullOr types.str;
1360-
description = "pyupgrade binary path. Should be used to specify the pyupgrade binary from your Nix-managed Python environment.";
1377+
description = "pyupgrade binary path. Should be used to specify the pyupgrade binary from your Python environment.";
13611378
default = null;
13621379
defaultText = lib.literalExpression ''
13631380
"''${tools.pyupgrade}/bin/pyupgrade"
@@ -1420,10 +1437,16 @@ in
14201437
mkOption {
14211438
type = types.nullOr (types.oneOf [ types.str types.path ]);
14221439
description = ''
1423-
`biome` binary path. For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`.
1440+
`rome` binary path.
1441+
For example, if you want to use the `rome` binary from `node_modules`, use `"./node_modules/.bin/rome"`.
14241442
'';
14251443
default = null;
1426-
defaultText = "\${tools.biome}/bin/biome";
1444+
defaultText = lib.literalExpression ''
1445+
"''${tools.rome}/bin/rome
1446+
'';
1447+
example = lib.literalExpression ''
1448+
"./node_modules/.bin/rome"
1449+
'';
14271450
};
14281451

14291452
write =

0 commit comments

Comments
 (0)