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, ... }:
|
{ flake-parts-lib, lib, ... }:
|
||||||
let
|
|
||||||
dictionary = [
|
|
||||||
"Asahi"
|
|
||||||
"Catppuccin"
|
|
||||||
"Devshell"
|
|
||||||
"LanguageTool"
|
|
||||||
"LLMs"
|
|
||||||
"LTeX"
|
|
||||||
"NixOS"
|
|
||||||
"Nushell"
|
|
||||||
"SOPS"
|
|
||||||
"Stylix"
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
{ pkgs, ... }:
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
options.languages.en-us = {
|
options.languages.en-us = {
|
||||||
enable = lib.mkEnableOption "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 =
|
config =
|
||||||
let
|
let
|
||||||
|
@ -34,7 +27,7 @@ in
|
||||||
name = "config/vocabularies/General";
|
name = "config/vocabularies/General";
|
||||||
};
|
};
|
||||||
name = "accept.txt";
|
name = "accept.txt";
|
||||||
text = builtins.concatStringsSep "\n" dictionary;
|
text = builtins.concatStringsSep "\n" config.languages.en-us.dictionary;
|
||||||
path = pkgs.writeTextFile {
|
path = pkgs.writeTextFile {
|
||||||
name = vale.styles.dictionary.name;
|
name = vale.styles.dictionary.name;
|
||||||
text = vale.styles.dictionary.text;
|
text = vale.styles.dictionary.text;
|
||||||
|
@ -86,7 +79,7 @@ in
|
||||||
builtins.map (x: {
|
builtins.map (x: {
|
||||||
name = x;
|
name = x;
|
||||||
value = x;
|
value = x;
|
||||||
}) dictionary
|
}) config.languages.en-us.dictionary
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
file = tomlFormatter.generate "typos.toml" typos.content;
|
file = tomlFormatter.generate "typos.toml" typos.content;
|
||||||
|
@ -98,7 +91,7 @@ in
|
||||||
ltex-ls-plus = {
|
ltex-ls-plus = {
|
||||||
command = "${pkgs.ltex-ls-plus}/bin/ltex-ls-plus";
|
command = "${pkgs.ltex-ls-plus}/bin/ltex-ls-plus";
|
||||||
config.ltex = {
|
config.ltex = {
|
||||||
dictionary.en-US = dictionary;
|
dictionary.en-US = config.languages.en-us.dictionary;
|
||||||
additionalRules.enablePickyRules = true;
|
additionalRules.enablePickyRules = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
16
flake.nix
16
flake.nix
|
@ -49,7 +49,21 @@
|
||||||
{
|
{
|
||||||
editors.helix.enable = true;
|
editors.helix.enable = true;
|
||||||
languages = {
|
languages = {
|
||||||
en-us.enable = true;
|
en-us = {
|
||||||
|
enable = true;
|
||||||
|
dictionary = [
|
||||||
|
"Asahi"
|
||||||
|
"Catppuccin"
|
||||||
|
"Devshell"
|
||||||
|
"LanguageTool"
|
||||||
|
"LLMs"
|
||||||
|
"LTeX"
|
||||||
|
"NixOS"
|
||||||
|
"Nushell"
|
||||||
|
"SOPS"
|
||||||
|
"Stylix"
|
||||||
|
];
|
||||||
|
};
|
||||||
markdown.enable = true;
|
markdown.enable = true;
|
||||||
nix.enable = true;
|
nix.enable = true;
|
||||||
toml.enable = true;
|
toml.enable = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue