From 60ef58ba65419b72df2fbb2ff967a30e494fd1a7 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 24 Jul 2024 09:26:00 -0400 Subject: [PATCH] home: add helix config --- homeManagerModules/apps/default.nix | 1 + homeManagerModules/apps/helix/default.nix | 99 +++++++++++++++++++++++ homeManagerModules/options.nix | 1 + homes/aly/default.nix | 1 + 4 files changed, 102 insertions(+) create mode 100644 homeManagerModules/apps/helix/default.nix diff --git a/homeManagerModules/apps/default.nix b/homeManagerModules/apps/default.nix index 2d601032..4d840a9a 100644 --- a/homeManagerModules/apps/default.nix +++ b/homeManagerModules/apps/default.nix @@ -8,6 +8,7 @@ ./fastfetch ./firefox ./fuzzel + ./helix ./kitty ./keepassxc ./librewolf diff --git a/homeManagerModules/apps/helix/default.nix b/homeManagerModules/apps/helix/default.nix new file mode 100644 index 00000000..0bf13694 --- /dev/null +++ b/homeManagerModules/apps/helix/default.nix @@ -0,0 +1,99 @@ +{ + config, + lib, + pkgs, + ... +}: { + config = lib.mkIf config.ar.home.apps.helix.enable { + programs.helix = { + enable = true; + + languages = { + language-server = { + rust-analyzer.config = { + checkOnSave.command = "clippy"; + cargo.features = "all"; + cargo.unsetTest = []; + }; + + pyright = { + command = "${pkgs.pyright}/bin/pyright-langserver"; + args = ["--stdio"]; + config = {}; + }; + + nil.command = "${pkgs.nil}/bin/nil"; + + bash-language-server = { + command = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server"; + args = ["start"]; + }; + + haskell = { + command = "${pkgs.haskell-language-server}/bin/haskell-language-server-wrapper"; + args = ["lsp"]; + }; + }; + + language = [ + { + name = "python"; + auto-format = true; + language-servers = [{name = "pyright";}]; + formatter = { + command = "/bin/sh"; + args = ["-c" "${pkgs.isort}/bin/isort - | ${pkgs.black}/bin/black -q -l 120 -C -"]; + }; + } + { + name = "nix"; + auto-format = true; + language-servers = [{name = "nil";}]; + formatter.command = "${pkgs.alejandra}/bin/alejandra"; + } + { + name = "bash"; + auto-format = true; + } + { + name = "haskell"; + auto-format = true; + language-servers = [{name = "haskell";}]; + formatter = { + command = "${pkgs.ormolu}/bin/ormolu"; + args = ["--no-cabal"]; + }; + } + ]; + }; + + settings = { + theme = "adwaita-dark"; + editor = { + color-modes = true; + cursorline = true; + + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + + indent-guides.render = true; + + lsp = { + display-inlay-hints = true; + display-messages = true; + }; + + statusline.center = ["position-percentage"]; + true-color = true; + whitespace.characters = { + newline = "↴"; + tab = "⇥"; + }; + }; + }; + }; + }; +} diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index 7f203072..573d079f 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -38,6 +38,7 @@ in { fastfetch.enable = lib.mkEnableOption "Fastfetch."; firefox.enable = lib.mkEnableOption "Firefox web browser."; fuzzel.enable = lib.mkEnableOption "Fuzzel app launcher."; + helix.enable = lib.mkEnableOption "Helix text editor."; keepassxc = { enable = lib.mkEnableOption "KeePassXC password manager."; diff --git a/homes/aly/default.nix b/homes/aly/default.nix index 90225a73..bc2252e0 100644 --- a/homes/aly/default.nix +++ b/homes/aly/default.nix @@ -91,6 +91,7 @@ in { chromium.enable = true; fastfetch.enable = true; firefox.enable = true; + helix.enable = true; keepassxc.enable = true; kitty.enable = true; tmux.enable = true;