Move dictionary to flake-parts configuration
This commit is contained in:
parent
2fdb8cdaa7
commit
93f0d8c30d
2 changed files with 26 additions and 19 deletions
|
@ -1,24 +1,17 @@
|
|||
{ flake-parts-lib, lib, ... }:
|
||||
let
|
||||
dictionary = [
|
||||
"Asahi"
|
||||
"Catppuccin"
|
||||
"Devshell"
|
||||
"LanguageTool"
|
||||
"LLMs"
|
||||
"LTeX"
|
||||
"NixOS"
|
||||
"Nushell"
|
||||
"SOPS"
|
||||
"Stylix"
|
||||
];
|
||||
in
|
||||
{
|
||||
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
options.languages.en-us = {
|
||||
enable = lib.mkEnableOption "en_US";
|
||||
dictionary = lib.mkOption {
|
||||
description = ''
|
||||
Words to add to dictionary.
|
||||
'';
|
||||
type = lib.types.listOf lib.types.string;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
|
@ -34,7 +27,7 @@ in
|
|||
name = "config/vocabularies/General";
|
||||
};
|
||||
name = "accept.txt";
|
||||
text = builtins.concatStringsSep "\n" dictionary;
|
||||
text = builtins.concatStringsSep "\n" config.languages.en-us.dictionary;
|
||||
path = pkgs.writeTextFile {
|
||||
name = vale.styles.dictionary.name;
|
||||
text = vale.styles.dictionary.text;
|
||||
|
@ -86,7 +79,7 @@ in
|
|||
builtins.map (x: {
|
||||
name = x;
|
||||
value = x;
|
||||
}) dictionary
|
||||
}) config.languages.en-us.dictionary
|
||||
);
|
||||
};
|
||||
file = tomlFormatter.generate "typos.toml" typos.content;
|
||||
|
@ -98,7 +91,7 @@ in
|
|||
ltex-ls-plus = {
|
||||
command = "${pkgs.ltex-ls-plus}/bin/ltex-ls-plus";
|
||||
config.ltex = {
|
||||
dictionary.en-US = dictionary;
|
||||
dictionary.en-US = config.languages.en-us.dictionary;
|
||||
additionalRules.enablePickyRules = true;
|
||||
};
|
||||
};
|
||||
|
|
16
flake.nix
16
flake.nix
|
@ -49,7 +49,21 @@
|
|||
{
|
||||
editors.helix.enable = true;
|
||||
languages = {
|
||||
en-us.enable = true;
|
||||
en-us = {
|
||||
enable = true;
|
||||
dictionary = [
|
||||
"Asahi"
|
||||
"Catppuccin"
|
||||
"Devshell"
|
||||
"LanguageTool"
|
||||
"LLMs"
|
||||
"LTeX"
|
||||
"NixOS"
|
||||
"Nushell"
|
||||
"SOPS"
|
||||
"Stylix"
|
||||
];
|
||||
};
|
||||
markdown.enable = true;
|
||||
nix.enable = true;
|
||||
toml.enable = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue