Skip to content

Commit

Permalink
feat(modules): helix config and node env
Browse files Browse the repository at this point in the history
  • Loading branch information
bddvlpr committed May 20, 2024
1 parent 7b846ce commit 498d84f
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/darwin/home-manager/users/bddvlpr.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{outputs, ...}: {
imports = with outputs.homeManagerModules; [
dev
fish
git
gpg
Expand Down
1 change: 1 addition & 0 deletions modules/home/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
dev = import ./dev;
firefox = import ./firefox;
fish = import ./fish;
git = import ./git;
Expand Down
3 changes: 3 additions & 0 deletions modules/home/dev/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = with pkgs; [nodejs] ++ (with nodePackages; [yarn pnpm]);
}
29 changes: 28 additions & 1 deletion modules/home/helix/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
{
{pkgs, ...} @ args: {
programs.helix = {
enable = true;

languages = import ./languages.nix args;

defaultEditor = true;
extraPackages = with pkgs;
[
buf-language-server
docker-compose-language-service
gleam
gopls
haskell-language-server
helm-ls
kotlin-language-server
lldb
marksman
netcoredbg
nil
omnisharp-roslyn
rust-analyzer
taplo
terraform-ls
texlab
yaml-language-server
zls
]
++ (with nodePackages; [
svelte-language-server
vscode-langservers-extracted
]);
};
}
58 changes: 58 additions & 0 deletions modules/home/helix/languages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
lib,
pkgs,
...
}: let
inherit (lib) getExe;
inherit (pkgs) alejandra;
inherit (pkgs.nodePackages) prettier;

mkPrettier = {
name,
parser ? name,
plugin ? null,
}: {
inherit name;
auto-format = true;
formatter = {
command = getExe prettier;
args =
[
"--parser"
parser
]
++ (
if plugin != null
then ["--plugin" plugin]
else []
);
};
};
in {
language = [
(mkPrettier {name = "html";})
(mkPrettier {name = "json";})
(mkPrettier {name = "css";})
(mkPrettier {name = "typescript";})
(mkPrettier {
name = "javascript";
parser = "typescript";
})
(mkPrettier {
name = "tsx";
parser = "typescript";
})
(mkPrettier {
name = "svelte";
parser = "typescript";
plugin = "prettier-plugin-svelte";
})
{
name = "nix";
auto-format = true;
formatter = {
command = getExe alejandra;
};
}
];
}

0 comments on commit 498d84f

Please sign in to comment.