Add configuration options for languages
This commit is contained in:
parent
461763d132
commit
e159b135ff
10 changed files with 296 additions and 270 deletions
|
@ -1,35 +1,33 @@
|
||||||
{ flake-parts-lib, lib, ... }:
|
{ flake-parts-lib, lib, ... }:
|
||||||
let
|
|
||||||
inherit (lib) mkOption types;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [ ../base ];
|
imports = [ ../base ];
|
||||||
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
options.helix = {
|
options.editors.helix = {
|
||||||
|
enable = lib.mkEnableOption "Helix";
|
||||||
# https://github.com/helix-editor/helix/blob/master/languages.toml
|
# https://github.com/helix-editor/helix/blob/master/languages.toml
|
||||||
# https://helix-editor.vercel.app/reference/formatters
|
# https://helix-editor.vercel.app/reference/formatters
|
||||||
# https://docs.helix-editor.com/lang-support.html
|
# https://docs.helix-editor.com/lang-support.html
|
||||||
languages = mkOption {
|
languages = lib.mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
Configuration for Helix `languages.toml`.
|
Configuration for Helix `languages.toml`.
|
||||||
'';
|
'';
|
||||||
# type = types.attrs;
|
# type = types.attrs;
|
||||||
type = types.submodule {
|
type = lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
language = mkOption {
|
language = lib.mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
`language` in `languages.toml`.
|
`language` in `languages.toml`.
|
||||||
'';
|
'';
|
||||||
type = types.listOf types.attrs;
|
type = lib.types.listOf lib.types.attrs;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
language-server = mkOption {
|
language-server = lib.mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
`language-server` in `languages.toml`.
|
`language-server` in `languages.toml`.
|
||||||
'';
|
'';
|
||||||
type = types.attrs;
|
type = lib.types.attrs;
|
||||||
default = { };
|
default = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -37,13 +35,13 @@ in
|
||||||
default = { };
|
default = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config.devshells.default =
|
config.devshells.default = lib.mkIf config.editors.helix.enable (
|
||||||
let
|
let
|
||||||
tomlFormatter = pkgs.formats.toml { };
|
tomlFormatter = pkgs.formats.toml { };
|
||||||
helix = {
|
helix = {
|
||||||
languages = {
|
languages = {
|
||||||
name = "languages.toml";
|
name = "languages.toml";
|
||||||
text = config.helix.languages;
|
text = config.editors.helix.languages;
|
||||||
path = tomlFormatter.generate "languages.toml" helix.languages.text;
|
path = tomlFormatter.generate "languages.toml" helix.languages.text;
|
||||||
};
|
};
|
||||||
directory = {
|
directory = {
|
||||||
|
@ -72,7 +70,8 @@ in
|
||||||
${pkgs.uutils-coreutils-noprefix}/bin/rm -rf ./${helix.directory.name}
|
${pkgs.uutils-coreutils-noprefix}/bin/rm -rf ./${helix.directory.name}
|
||||||
${pkgs.uutils-coreutils-noprefix}/bin/ln -fsn ${helix.directory.path} ./${helix.directory.name}
|
${pkgs.uutils-coreutils-noprefix}/bin/ln -fsn ${helix.directory.path} ./${helix.directory.name}
|
||||||
'';
|
'';
|
||||||
};
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
let
|
let
|
||||||
entries = builtins.attrNames (builtins.readDir ./.);
|
entries = builtins.attrNames (builtins.readDir ./.);
|
||||||
configs = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/default.nix")) entries;
|
modules = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/default.nix")) entries;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = builtins.map (name: (./. + "/${name}")) modules;
|
||||||
../base
|
|
||||||
../helix
|
|
||||||
] ++ builtins.map (name: (./. + "/${name}")) configs;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ ... }:
|
{ flake-parts-lib, lib, ... }:
|
||||||
let
|
let
|
||||||
dictionary = [
|
dictionary = [
|
||||||
"Asahi"
|
"Asahi"
|
||||||
|
@ -14,8 +14,13 @@ let
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
perSystem =
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
options.languages.en-us = {
|
||||||
|
enable = lib.mkEnableOption "en_US";
|
||||||
|
};
|
||||||
|
config =
|
||||||
let
|
let
|
||||||
tomlFormatter = pkgs.formats.toml { };
|
tomlFormatter = pkgs.formats.toml { };
|
||||||
vale = {
|
vale = {
|
||||||
|
@ -88,7 +93,7 @@ in
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
helix.languages.language-server = {
|
editors.helix.languages.language-server = {
|
||||||
# https://ltex-plus.github.io/ltex-plus/supported-languages.html
|
# https://ltex-plus.github.io/ltex-plus/supported-languages.html
|
||||||
ltex-ls-plus = {
|
ltex-ls-plus = {
|
||||||
command = "${pkgs.ltex-ls-plus}/bin/ltex-ls-plus";
|
command = "${pkgs.ltex-ls-plus}/bin/ltex-ls-plus";
|
||||||
|
@ -149,3 +154,5 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
{ ... }:
|
{ flake-parts-lib, lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../en-us ];
|
imports = [ ../en-us ];
|
||||||
perSystem =
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
helix.languages = {
|
options.languages.markdown.enable = lib.mkEnableOption "Markdown";
|
||||||
|
config = {
|
||||||
|
editors.helix.languages = {
|
||||||
language = [
|
language = [
|
||||||
{
|
{
|
||||||
name = "markdown";
|
name = "markdown";
|
||||||
|
@ -41,3 +43,5 @@
|
||||||
pre-commit.settings.hooks.markdownlint.enable = true;
|
pre-commit.settings.hooks.markdownlint.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
{ ... }:
|
{ flake-parts-lib, lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../en-us ];
|
imports = [ ../en-us ];
|
||||||
perSystem =
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
helix.languages = {
|
options.languages.nix.enable = lib.mkEnableOption "Nix";
|
||||||
|
config = lib.mkIf config.languages.nix.enable {
|
||||||
|
editors.helix.languages = {
|
||||||
language = [
|
language = [
|
||||||
{
|
{
|
||||||
name = "nix";
|
name = "nix";
|
||||||
|
@ -32,3 +34,5 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
{ ... }:
|
{ flake-parts-lib, lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../en-us ];
|
imports = [ ../en-us ];
|
||||||
perSystem =
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
helix.languages = {
|
options.languages.toml.enable = lib.mkEnableOption "TOML";
|
||||||
|
config = {
|
||||||
|
editors.helix.languages = {
|
||||||
language = [
|
language = [
|
||||||
{
|
{
|
||||||
name = "toml";
|
name = "toml";
|
||||||
|
@ -30,3 +32,5 @@
|
||||||
pre-commit.settings.hooks.check-toml.enable = true;
|
pre-commit.settings.hooks.check-toml.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
{ ... }:
|
{ flake-parts-lib, lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../en-us ];
|
imports = [ ../en-us ];
|
||||||
perSystem =
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
helix.languages = {
|
options.languages.yaml.enable = lib.mkEnableOption "YAML";
|
||||||
|
config = {
|
||||||
|
editors.helix.languages = {
|
||||||
language = [
|
language = [
|
||||||
{
|
{
|
||||||
name = "yaml";
|
name = "yaml";
|
||||||
|
@ -42,3 +44,5 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -47,6 +47,14 @@
|
||||||
perSystem =
|
perSystem =
|
||||||
{ pkgs, system, ... }:
|
{ pkgs, system, ... }:
|
||||||
{
|
{
|
||||||
|
editors.helix.enable = true;
|
||||||
|
languages = {
|
||||||
|
en-us.enable = true;
|
||||||
|
markdown.enable = true;
|
||||||
|
nix.enable = true;
|
||||||
|
toml.enable = true;
|
||||||
|
yaml.enable = true;
|
||||||
|
};
|
||||||
# https://flake.parts/options/devshell.html
|
# https://flake.parts/options/devshell.html
|
||||||
devshells.default = {
|
devshells.default = {
|
||||||
packages = [ pkgs.forgejo-cli ];
|
packages = [ pkgs.forgejo-cli ];
|
||||||
|
|
|
@ -567,7 +567,7 @@ in
|
||||||
"en-US"
|
"en-US"
|
||||||
"en"
|
"en"
|
||||||
];
|
];
|
||||||
vencord = ./vencord.nix; # TODO: Fix this
|
vencord = ./vencord.nix; # TODO: Make this a home-manager module
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
floorp = {
|
floorp = {
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
disableMinSize = false;
|
disableMinSize = false;
|
||||||
eagerPatches = false;
|
eagerPatches = false;
|
||||||
enableReactDevtools = false;
|
enableReactDevtools = false;
|
||||||
enabledThemes = [ ];
|
|
||||||
frameless = false;
|
frameless = false;
|
||||||
macosTranslucency = false;
|
macosTranslucency = false;
|
||||||
notifications = {
|
notifications = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue