From baf942ec75b17c77f02413a96ad61426a896e18a Mon Sep 17 00:00:00 2001 From: Sander Date: Sun, 19 Jan 2025 17:29:31 +0400 Subject: [PATCH] hooks: add examples --- modules/hooks.nix | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/modules/hooks.nix b/modules/hooks.nix index 039aab2a..acc348c8 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -174,9 +174,16 @@ in mkOption { type = types.nullOr (types.oneOf [ types.str types.path ]); description = '' - `biome` binary path. For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`. + `biome` binary path. + For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`. ''; default = null; + defaultText = lib.literalExpression '' + "''${tools.biome}/bin/biome" + ''; + example = lib.literalExpression '' + "./node_modules/.bin/biome" + ''; }; write = @@ -468,10 +475,16 @@ in mkOption { type = types.nullOr (types.oneOf [ types.str types.path ]); description = '' - `eslint` binary path. For example, if you want to use the `eslint` binary from `node_modules`, use `"./node_modules/.bin/eslint"`. + `eslint` binary path. + For example, if you want to use the `eslint` binary from `node_modules`, use `"./node_modules/.bin/eslint"`. ''; default = null; - defaultText = lib.literalExpression "\${tools.eslint}/bin/eslint"; + defaultText = lib.literalExpression '' + "''${tools.eslint}/bin/eslint" + ''; + example = lib.literalExpression '' + "./node_modules/.bin/eslint" + ''; }; extensions = @@ -492,7 +505,7 @@ in binPath = mkOption { type = types.nullOr types.str; - description = "flake8 binary path. Should be used to specify flake8 binary from your Nix-managed Python environment."; + description = "flake8 binary path. Should be used to specify flake8 binary from your Python environment."; default = null; defaultText = lib.literalExpression '' "''${tools.flake8}/bin/flake8" @@ -826,7 +839,7 @@ in binPath = mkOption { type = types.nullOr (types.oneOf [ types.str types.path ]); - description = "mkdocs-linkcheck binary path. Should be used to specify the mkdocs-linkcheck binary from your Nix-managed Python environment."; + description = "mkdocs-linkcheck binary path. Should be used to specify the mkdocs-linkcheck binary from your Python environment."; default = null; defaultText = lib.literalExpression '' "''${tools.mkdocs-linkcheck}/bin/mkdocs-linkcheck" @@ -1050,13 +1063,17 @@ in binPath = mkOption { description = '' - `prettier` binary path. For example, if you want to use the `prettier` binary from `node_modules`, use `"./node_modules/.bin/prettier"`. + `prettier` binary path. + For example, if you want to use the `prettier` binary from `node_modules`, use `"./node_modules/.bin/prettier"`. ''; type = types.nullOr (types.oneOf [ types.str types.path ]); default = null; defaultText = lib.literalExpression '' "''${tools.prettier}/bin/prettier" ''; + example = lib.literalExpression '' + "./node_modules/.bin/prettier" + ''; }; allow-parens = mkOption { @@ -1311,7 +1328,7 @@ in binPath = mkOption { type = types.nullOr types.str; - description = "Pylint binary path. Should be used to specify Pylint binary from your Nix-managed Python environment."; + description = "Pylint binary path. Should be used to specify Pylint binary from your Python environment."; default = null; defaultText = lib.literalExpression '' "''${tools.pylint}/bin/pylint" @@ -1357,7 +1374,7 @@ in binPath = mkOption { type = types.nullOr types.str; - description = "pyupgrade binary path. Should be used to specify the pyupgrade binary from your Nix-managed Python environment."; + description = "pyupgrade binary path. Should be used to specify the pyupgrade binary from your Python environment."; default = null; defaultText = lib.literalExpression '' "''${tools.pyupgrade}/bin/pyupgrade" @@ -1420,10 +1437,16 @@ in mkOption { type = types.nullOr (types.oneOf [ types.str types.path ]); description = '' - `biome` binary path. For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`. + `rome` binary path. + For example, if you want to use the `rome` binary from `node_modules`, use `"./node_modules/.bin/rome"`. ''; default = null; - defaultText = "\${tools.biome}/bin/biome"; + defaultText = lib.literalExpression '' + "''${tools.rome}/bin/rome + ''; + example = lib.literalExpression '' + "./node_modules/.bin/rome" + ''; }; write =