diff --git a/modules/hooks.nix b/modules/hooks.nix index a20e0528..46c20776 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -1099,10 +1099,10 @@ in description = lib.mdDoc "When to use generate output."; default = "auto"; }; - config = + configuration = mkOption { type = types.str; - description = lib.mdDoc "Multiline-string configuration passed as config file. If set, config set in `typos.settings.configPath` gets ignored."; + description = lib.mdDoc "Multiline-string configuration passed as configuration file. If set, configuration file set in `typos.settings.configPath` gets ignored."; default = ""; example = '' [files] @@ -1201,10 +1201,10 @@ in }; }; vale = { - config = + configuration = mkOption { type = types.str; - description = lib.mdDoc "Multiline-string configuration passed as config file."; + description = lib.mdDoc "Multiline-string configuration passed as configuration file."; default = ""; example = '' MinAlertLevel = suggestion @@ -1215,7 +1215,7 @@ in configPath = mkOption { type = types.str; - description = lib.mdDoc "Path to the config file."; + description = lib.mdDoc "Path to a configuration file."; default = ""; }; flags = @@ -2496,15 +2496,15 @@ in entry = let # Concatenate config in config file with section for ignoring words generated from list of words to ignore - config = "${settings.typos.config}" + lib.strings.optionalString (settings.typos.ignored-words != [ ]) "\n\[default.extend-words\]" + lib.strings.concatMapStrings (x: "\n${x} = \"${x}\"") settings.typos.ignored-words; - configFile = builtins.toFile "typos-config.toml" config; + configuration = "${settings.typos.configuration}" + lib.strings.optionalString (settings.typos.ignored-words != [ ]) "\n\[default.extend-words\]" + lib.strings.concatMapStrings (x: "\n${x} = \"${x}\"") settings.typos.ignored-words; + configFile = builtins.toFile "typos-config.toml" configuration; cmdArgs = mkCmdArgs (with settings.typos; [ [ binary "--binary" ] [ (color != "auto") "--color ${color}" ] - [ (config != "") "--config ${configFile}" ] - [ (configPath != "" && config == "") "--config ${configPath}" ] + [ (configuration != "") "--config ${configFile}" ] + [ (configPath != "" && configuration == "") "--config ${configPath}" ] [ diff "--diff" ] [ (exclude != "") "--exclude ${exclude} --force-exclude" ] [ (format != "long") "--format ${format}" ] @@ -2532,12 +2532,12 @@ in description = "A markup-aware linter for prose built with speed and extensibility in mind."; entry = let - configFile = builtins.toFile ".vale.ini" "${settings.vale.config}"; + configFile = builtins.toFile ".vale.ini" "${settings.vale.configuration}"; cmdArgs = mkCmdArgs (with settings.vale; [ [ (configPath != "") " --config ${configPath}" ] - [ (config != "" && configPath == "") " --config ${configFile}" ] + [ (configuration != "" && configPath == "") " --config ${configFile}" ] ]); in "${pkgs.vale}/bin/vale${cmdArgs} ${settings.vale.flags}";