Compare commits
No commits in common. "850f5b40bccceb01b578f386268e4455350fe8cd" and "ff3ef64898361148bec3df9250f7f83cfdf87403" have entirely different histories.
850f5b40bc
...
ff3ef64898
6 changed files with 36 additions and 69 deletions
1
.envrc
1
.envrc
|
@ -1,4 +1,3 @@
|
||||||
watch_file ./home
|
watch_file ./home
|
||||||
watch_file ./languages
|
watch_file ./languages
|
||||||
watch_file ./.vale/styles
|
|
||||||
use flake
|
use flake
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
.direnv
|
.direnv
|
||||||
.helix
|
.helix
|
||||||
.pre-commit-config.yaml
|
.pre-commit-config.yaml
|
||||||
.vale/.vale.ini
|
.vale/styles/config/vocabularies/General/
|
||||||
|
|
11
.vale.ini
Normal file
11
.vale.ini
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
StylesPath = .vale/styles
|
||||||
|
|
||||||
|
MinAlertLevel = suggestion
|
||||||
|
|
||||||
|
Vocab = General
|
||||||
|
|
||||||
|
# https://vale.sh/explorer
|
||||||
|
Packages = RedHat, proselint, write-good, alex
|
||||||
|
|
||||||
|
[*.{md}]
|
||||||
|
BasedOnStyles = Vale, RedHat, proselint, write-good, alex
|
|
@ -77,7 +77,6 @@
|
||||||
else
|
else
|
||||||
rValue
|
rValue
|
||||||
) rhs);
|
) rhs);
|
||||||
tomlFormatter = pkgs.formats.toml { };
|
|
||||||
pkgs = import inputs.nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
|
@ -117,7 +116,8 @@
|
||||||
acc: cfg: acc // (cfg.devshell.devshellStartup or { })
|
acc: cfg: acc // (cfg.devshell.devshellStartup or { })
|
||||||
) { } configs;
|
) { } configs;
|
||||||
};
|
};
|
||||||
helixLanguagesFile = tomlFormatter.generate "languages.toml" helixLanguages;
|
helixLanguagesFormat = pkgs.formats.toml { };
|
||||||
|
helixLanguagesFile = helixLanguagesFormat.generate "languages.toml" helixLanguages;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
_module.args.pkgs = pkgs;
|
_module.args.pkgs = pkgs;
|
||||||
|
|
|
@ -7,51 +7,13 @@ let
|
||||||
"NixOS"
|
"NixOS"
|
||||||
];
|
];
|
||||||
tomlFormatter = pkgs.formats.toml { };
|
tomlFormatter = pkgs.formats.toml { };
|
||||||
vale = {
|
valeDictionary = {
|
||||||
valeDirectory = ".vale";
|
directory = "./.vale/styles/config/vocabularies/General";
|
||||||
stylesDirectory = "styles";
|
|
||||||
dictionary = {
|
|
||||||
directory = "config/vocabularies/General";
|
|
||||||
filename = "accept.txt";
|
filename = "accept.txt";
|
||||||
content = builtins.concatStringsSep "\n" dictionary;
|
content = builtins.concatStringsSep "\n" dictionary;
|
||||||
file = pkgs.writeTextFile {
|
file = builtins.toFile valeDictionary.filename valeDictionary.content;
|
||||||
name = vale.dictionary.filename;
|
|
||||||
text = vale.dictionary.content;
|
|
||||||
};
|
};
|
||||||
};
|
typosConfig = {
|
||||||
config = {
|
|
||||||
filename = ".vale.ini";
|
|
||||||
content = ''
|
|
||||||
StylesPath = styles
|
|
||||||
|
|
||||||
MinAlertLevel = suggestion
|
|
||||||
|
|
||||||
Vocab = General
|
|
||||||
|
|
||||||
# https://vale.sh/explorer
|
|
||||||
Packages = RedHat, proselint, write-good, alex
|
|
||||||
|
|
||||||
[*.{md}]
|
|
||||||
BasedOnStyles = Vale, RedHat, proselint, write-good, alex
|
|
||||||
'';
|
|
||||||
file = pkgs.writeTextFile {
|
|
||||||
name = vale.config.filename;
|
|
||||||
text = vale.config.content;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
directory = {
|
|
||||||
base = ../.vale/styles;
|
|
||||||
full = pkgs.runCommand vale.valeDirectory { } ''
|
|
||||||
${pkgs.uutils-coreutils-noprefix}/bin/mkdir -p $out/${vale.stylesDirectory}/${vale.dictionary.directory}
|
|
||||||
${pkgs.uutils-coreutils-noprefix}/bin/cp -r ${vale.directory.base}/* $out/${vale.stylesDirectory}
|
|
||||||
${pkgs.uutils-coreutils-noprefix}/bin/ln -fs ${vale.dictionary.file} $out/${vale.stylesDirectory}/${vale.dictionary.directory}/${vale.dictionary.filename}
|
|
||||||
${pkgs.uutils-coreutils-noprefix}/bin/ln -fs ${vale.config.file} $out/${vale.config.filename};
|
|
||||||
'';
|
|
||||||
configFile = "${vale.directory.full}/${vale.config.filename}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
typos = {
|
|
||||||
content = {
|
|
||||||
default.extendWords = builtins.listToAttrs (
|
default.extendWords = builtins.listToAttrs (
|
||||||
builtins.map (x: {
|
builtins.map (x: {
|
||||||
name = x;
|
name = x;
|
||||||
|
@ -59,8 +21,7 @@ let
|
||||||
}) dictionary
|
}) dictionary
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
file = tomlFormatter.generate "typos.toml" typos.content;
|
typosConfigFile = tomlFormatter.generate "typos.toml" typosConfig;
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
helix.language-server = {
|
helix.language-server = {
|
||||||
|
@ -70,33 +31,27 @@ in
|
||||||
config.ltex.dictionary.en-US = dictionary;
|
config.ltex.dictionary.en-US = dictionary;
|
||||||
};
|
};
|
||||||
# https://vale.sh/docs/formats/code
|
# https://vale.sh/docs/formats/code
|
||||||
vale-ls = {
|
vale-ls.command = "${pkgs.vale-ls}/bin/vale-ls";
|
||||||
command = "${pkgs.vale-ls}/bin/vale-ls";
|
|
||||||
config.configPath = vale.directory.configFile;
|
|
||||||
};
|
|
||||||
# https://writewithharper.com/docs/integrations/language-server#Supported-Languages
|
# https://writewithharper.com/docs/integrations/language-server#Supported-Languages
|
||||||
harper-ls.command = "${pkgs.harper}/bin/harper-ls";
|
harper-ls.command = "${pkgs.harper}/bin/harper-ls";
|
||||||
typos = {
|
typos = {
|
||||||
command = "${pkgs.typos-lsp}/bin/typos-lsp";
|
command = "${pkgs.typos-lsp}/bin/typos-lsp";
|
||||||
config.config = typos.file.outPath;
|
config.config = typosConfigFile.outPath;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
pre-commit = {
|
pre-commit = {
|
||||||
typos = {
|
typos = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
configPath = typos.file.outPath;
|
configPath = typosConfigFile.outPath;
|
||||||
locale = "en-us";
|
locale = "en-us";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
vale = {
|
vale.enable = true;
|
||||||
enable = true;
|
|
||||||
settings.configPath = vale.directory.configFile;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
treefmt.programs.typos = {
|
treefmt.programs.typos = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configFile = typos.file.outPath;
|
configFile = typosConfigFile.outPath;
|
||||||
locale = "en-us";
|
locale = "en-us";
|
||||||
};
|
};
|
||||||
devshell = {
|
devshell = {
|
||||||
|
@ -104,13 +59,14 @@ in
|
||||||
{
|
{
|
||||||
help = "sync vale configuration";
|
help = "sync vale configuration";
|
||||||
name = "vale-sync";
|
name = "vale-sync";
|
||||||
command = "${pkgs.vale}/bin/vale sync --config ${vale.valeDirectory}/${vale.config.filename}";
|
command = "${pkgs.vale}/bin/vale sync";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
packages = [ pkgs.vale ];
|
packages = [ pkgs.vale ];
|
||||||
devshellStartup = {
|
devshellStartup = {
|
||||||
vale_config.text = ''
|
vale_config.text = ''
|
||||||
${pkgs.uutils-coreutils-noprefix}/bin/ln -fs ${vale.config.file} ${vale.valeDirectory}/${vale.config.filename}
|
mkdir -p ${valeDictionary.directory}
|
||||||
|
${pkgs.uutils-coreutils-noprefix}/bin/ln -fs ${valeDictionary.file} ${valeDictionary.directory}/${valeDictionary.filename}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,5 +36,6 @@
|
||||||
};
|
};
|
||||||
pre-commit = {
|
pre-commit = {
|
||||||
markdownlint.enable = true;
|
markdownlint.enable = true;
|
||||||
|
vale.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue