diff --git a/flake.lock b/flake.lock index d145cb1..6a3c342 100644 --- a/flake.lock +++ b/flake.lock @@ -130,9 +130,7 @@ "inputs": { "crane": "crane", "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ], + "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" }, "locked": { @@ -262,7 +260,7 @@ }, "hyprlang_2": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1704230242, @@ -281,7 +279,7 @@ "hyprpaper": { "inputs": { "hyprlang": "hyprlang_2", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1704406943, @@ -359,7 +357,7 @@ "nix-gaming": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1706477838, @@ -377,15 +375,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702645756, - "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=", + "lastModified": 1706191920, + "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0", + "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -425,6 +423,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1702645756, + "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1703637592, "narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=", @@ -440,7 +454,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1706173671, "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", @@ -456,7 +470,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1706191920, "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", @@ -485,7 +499,7 @@ "nh": "nh", "nix-colors": "nix-colors", "nix-gaming": "nix-gaming", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" } }, "rust-overlay": { diff --git a/flake.nix b/flake.nix index faad970..2bcf647 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,6 @@ helix = { url = "github:helix-editor/helix"; - inputs.nixpkgs.follows = "nixpkgs"; }; nh = { diff --git a/home/modules/console/editor/helix/default.nix b/home/modules/console/editor/helix/default.nix index ef9b247..6842331 100644 --- a/home/modules/console/editor/helix/default.nix +++ b/home/modules/console/editor/helix/default.nix @@ -5,35 +5,23 @@ let in { - imports = [ - ./languages.nix - ]; + # imports = [ + # ./languages.nix + # ]; - config = { - programs.helix = lib.mkIf cfg.enable { + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + marksman + clang-tools + nil + nodePackages.bash-language-server + nodePackages.vscode-css-languageserver-bin + nodePackages.vscode-langservers-extracted + shellcheck + ]; + programs.helix = { enable = true; defaultEditor = lib.mkIf cfg.default true; - package = - inputs.helix.packages.${pkgs.system}.default.overrideAttrs (self: { - makeWrapperArgs = with pkgs; - self.makeWrapperArgs - or [] - ++ [ - "--suffix" - "PATH" - ":" - (lib.makeBinPath [ - clang-tools - marksman - nil - nodePackages.bash-language-server - nodePackages.vscode-css-languageserver-bin - nodePackages.vscode-langservers-extracted - shellcheck - ]) - ]; - }); - settings = { theme = colorscheme.slug; editor = { diff --git a/home/modules/console/editor/helix/languages.nix b/home/modules/console/editor/helix/languages.nix index 23efb87..0000407 100644 --- a/home/modules/console/editor/helix/languages.nix +++ b/home/modules/console/editor/helix/languages.nix @@ -1,106 +1,107 @@ -{ pkgs, lib, config, ... }: - -let - cfg = config.homeModules.console.editor.helix; -in - { - config = lib.mkIf cfg.enable { - programs.helix.languages = { - language = let - deno = lang: { - command = "${pkgs.deno}/bin/deno"; - args = ["fmt" "-" "--ext" lang]; - }; + pkgs, + lib, + ... +}: { + programs.helix.languages = { + language = let + deno = lang: { + command = "${pkgs.deno}/bin/deno"; + args = ["fmt" "-" "--ext" lang]; + }; - prettier = lang: { - command = "${pkgs.nodePackages.prettier}/bin/prettier"; - args = ["--parser" lang]; - }; - prettierLangs = map (e: { - name = e; - formatter = prettier e; - }); - langs = ["css" "scss" "html"]; - in - [ - { - name = "bash"; - auto-format = true; - formatter = { - command = "${pkgs.shfmt}/bin/shfmt"; - args = ["-i" "2"]; - }; - } - { - name = "clojure"; - injection-regex = "(clojure|clj|edn|boot|yuck)"; - file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"]; - } - { - name = "javascript"; - auto-format = true; - language-servers = ["deno-lsp"]; - } - { - name = "json"; - formatter = deno "json"; - } - { - name = "markdown"; - auto-format = true; - formatter = deno "md"; - } - ] - ++ prettierLangs langs; + prettier = lang: { + command = "${pkgs.nodePackages.prettier}/bin/prettier"; + args = ["--parser" lang]; + }; + prettierLangs = map (e: { + name = e; + formatter = prettier e; + }); + langs = ["css" "scss" "html"]; + in + [ + { + name = "bash"; + auto-format = true; + formatter = { + command = "${pkgs.shfmt}/bin/shfmt"; + args = ["-i" "2"]; + }; + } + { + name = "clojure"; + injection-regex = "(clojure|clj|edn|boot|yuck)"; + file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"]; + } + { + name = "javascript"; + auto-format = true; + language-servers = ["deno-lsp"]; + } + { + name = "json"; + formatter = deno "json"; + } + { + name = "markdown"; + auto-format = true; + formatter = deno "md"; + } + { + name = "typescript"; + auto-format = true; + language-servers = ["deno-lsp"]; + } + ] + ++ prettierLangs langs; - language-server = { - bash-language-server = { - command = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server"; - args = ["start"]; - }; + language-server = { + bash-language-server = { + command = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server"; + args = ["start"]; + }; - clangd = { - command = "${pkgs.clang-tools}/bin/clangd"; - clangd.fallbackFlags = ["-std=c++2b"]; - }; + clangd = { + command = "${pkgs.clang-tools}/bin/clangd"; + clangd.fallbackFlags = ["-std=c++2b"]; + }; - deno-lsp = { - command = "${pkgs.deno}/bin/deno"; - args = ["lsp"]; - environment.NO_COLOR = "1"; - config.deno = { - enable = true; - lint = true; - unstable = true; - suggest = { - completeFunctionCalls = false; - imports = {hosts."https://deno.land" = true;}; - }; - inlayHints = { - enumMemberValues.enabled = true; - functionLikeReturnTypes.enabled = true; - parameterNames.enabled = "all"; - parameterTypes.enabled = true; - propertyDeclarationTypes.enabled = true; - variableTypes.enabled = true; - }; + deno-lsp = { + command = "${pkgs.deno}/bin/deno"; + args = ["lsp"]; + environment.NO_COLOR = "1"; + config.deno = { + enable = true; + lint = true; + unstable = true; + suggest = { + completeFunctionCalls = false; + imports = {hosts."https://deno.land" = true;}; + }; + inlayHints = { + enumMemberValues.enabled = true; + functionLikeReturnTypes.enabled = true; + parameterNames.enabled = "all"; + parameterTypes.enabled = true; + propertyDeclarationTypes.enabled = true; + variableTypes.enabled = true; }; }; + }; - nil = { - command = lib.getExe pkgs.nil; - config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"]; - }; + nil = { + command = lib.getExe pkgs.nil; + config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"]; + }; - vscode-css-language-server = { - command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver"; - args = ["--stdio"]; - config = { - provideFormatter = true; - css.validate.enable = true; - scss.validate.enable = true; - }; + vscode-css-language-server = { + command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver"; + args = ["--stdio"]; + config = { + provideFormatter = true; + css.validate.enable = true; + scss.validate.enable = true; }; }; };