init
This commit is contained in:
commit
aae151cee6
33 changed files with 1351 additions and 0 deletions
29
modules/home-manager/editors/default.nix
Executable file
29
modules/home-manager/editors/default.nix
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.custom.editors;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./helix.nix
|
||||
];
|
||||
|
||||
options.custom.editors = {
|
||||
defaultEditor = lib.mkOption {
|
||||
type = lib.types.enum [ "helix" ];
|
||||
default = null;
|
||||
description = "Which editor to use as the default one. If set to null the default editor won't be set explicitly.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.defaultEditor != null) {
|
||||
assertions = [
|
||||
{ assertion = (config.custom.editors.${cfg.defaultEditor}.enable);
|
||||
message = "Can't set an editor as the default if it is disabled.";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
97
modules/home-manager/editors/helix.nix
Executable file
97
modules/home-manager/editors/helix.nix
Executable file
|
|
@ -0,0 +1,97 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.custom.editors.helix;
|
||||
in
|
||||
{
|
||||
options.custom.editors.helix = {
|
||||
enable = lib.mkEnableOption "Whether to enable the Helix editor.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
defaultEditor = (config.custom.editors.defaultEditor == "helix");
|
||||
|
||||
settings = {
|
||||
theme = "term16_dark";
|
||||
|
||||
editor = {
|
||||
line-number = "relative";
|
||||
};
|
||||
};
|
||||
|
||||
languages = {
|
||||
language-server = {
|
||||
nixd = {
|
||||
command = "nixd";
|
||||
args = [ "--semantic-tokens=true" ];
|
||||
config.nixd = let
|
||||
host = "evergarden";
|
||||
flake = "(builtins.getFlake (toString ${inputs.self.outPath}))";
|
||||
nixosOptions = "${flake}.nixosConfigurations.${host}.options";
|
||||
homeManagerOptions = "${nixosOptions}.home-manager.users.type.getSubOptions []";
|
||||
in {
|
||||
nixpkgs.expr = "import ${flake}.inputs.nixpkgs { }";
|
||||
options = {
|
||||
nixos.expr = nixosOptions;
|
||||
home-manager.expr = homeManagerOptions;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rust = {
|
||||
command = "rust-analyzer";
|
||||
};
|
||||
|
||||
qml = {
|
||||
command = "qmlls";
|
||||
args = [ ];
|
||||
};
|
||||
|
||||
dockerfile = {
|
||||
command = "docker-language-server";
|
||||
};
|
||||
};
|
||||
|
||||
language = [
|
||||
{
|
||||
name = "css";
|
||||
auto-format = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
nixd
|
||||
|
||||
kdePackages.qtdeclarative
|
||||
|
||||
just-lsp
|
||||
yaml-language-server
|
||||
tombi
|
||||
docker-compose-language-service
|
||||
docker-language-server
|
||||
|
||||
rust-analyzer
|
||||
clang-tools
|
||||
ruff
|
||||
|
||||
intelephense
|
||||
vscode-langservers-extracted
|
||||
typescript-language-server
|
||||
|
||||
kotlin-language-server
|
||||
jdt-language-server
|
||||
|
||||
marksman
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue