diff --git a/users/guanranwang/home-manager/nixos/home.nix b/users/guanranwang/home-manager/nixos/home.nix index 6d196e0..0539a55 100644 --- a/users/guanranwang/home-manager/nixos/home.nix +++ b/users/guanranwang/home-manager/nixos/home.nix @@ -66,11 +66,6 @@ fd freshfetch hyperfine - - # lsp - nil - gopls - libclang ]) ++ (with pkgs.gnome; [ # GNOME diff --git a/users/guanranwang/home-manager/nixos/presets/desktop.nix b/users/guanranwang/home-manager/nixos/presets/desktop.nix index b90ebe8..7b3abf0 100644 --- a/users/guanranwang/home-manager/nixos/presets/desktop.nix +++ b/users/guanranwang/home-manager/nixos/presets/desktop.nix @@ -9,6 +9,8 @@ ../../resources/editor/vscode.nix ../../resources/browser/chromium.nix ../../resources/browser/librewolf.nix + ../../resources/lang/nix.nix + ../../resources/lang/go.nix ../../resources/wm/sway.nix diff --git a/users/guanranwang/home-manager/resources/editor/vscode.nix b/users/guanranwang/home-manager/resources/editor/vscode.nix index 9d271a4..e1117fa 100644 --- a/users/guanranwang/home-manager/resources/editor/vscode.nix +++ b/users/guanranwang/home-manager/resources/editor/vscode.nix @@ -29,15 +29,11 @@ "workbench.colorTheme" = "Tokyo Night"; # Extensions - ### Nix IDE - "nix.enableLanguageServer" = true; - "nix.serverPath" = "${pkgs.nil}/bin/nil"; ### GitLens "gitlens.telemetry.enabled" = false; }; extensions = with pkgs.vscode-extensions; [ ### LSP - jnoortheen.nix-ide #ms-python.python rust-lang.rust-analyzer tamasfe.even-better-toml diff --git a/users/guanranwang/home-manager/resources/lang/go.nix b/users/guanranwang/home-manager/resources/lang/go.nix new file mode 100644 index 0000000..54d5f2b --- /dev/null +++ b/users/guanranwang/home-manager/resources/lang/go.nix @@ -0,0 +1,21 @@ +{ + pkgs, + config, + ... +}: { + home.packages = with pkgs; [ + ### Compiler + go + ### LSP + gopls + ]; + + # Make Go follow XDG + # "$HOME/go"... + xdg.configFile = { + "go/env".text = '' + GOPATH=${config.xdg.cacheHome}/go + GOBIN=${config.xdg.stateHome}/go/bin + ''; + }; +} diff --git a/users/guanranwang/home-manager/resources/lang/nix.nix b/users/guanranwang/home-manager/resources/lang/nix.nix new file mode 100644 index 0000000..6305384 --- /dev/null +++ b/users/guanranwang/home-manager/resources/lang/nix.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + ### LSP + nil + ]; + + ### VSCode + programs.vscode = { + userSettings = { + ### Nix IDE + "nix.enableLanguageServer" = true; + "nix.serverPath" = "${pkgs.nil}/bin/nil"; + }; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + ]; + }; +}