NixOS/home/programs/go.nix

46 lines
1 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, unstable, ... }:
2024-06-12 18:09:56 +07:00
let
cfg = config.profile.go;
impl = pkgs.buildGoModule rec {
pname = "impl";
version = "1.4.0";
src = pkgs.fetchFromGitHub {
owner = "josharian";
repo = "impl";
rev = "v${version}";
sha256 = "sha256-0TSyg7YEPur+h0tkDxI3twr2PzT7tmo3shKgmSSJ6qk=";
};
vendorHash = "sha256-vTqDoM/LK5SHkayLKYig+tCrXLelOoILmQGCxlTWHog=";
};
2024-06-12 18:09:56 +07:00
in
{
config = lib.mkIf cfg.enable {
programs.go = {
enable = true;
goPrivate = [
"gitlab.bareksa.com"
];
package = unstable.go_1_23;
2024-06-12 18:09:56 +07:00
};
2024-08-12 19:20:24 +07:00
home.packages = with pkgs; [
gotools
###### Golang development tools ######
gomodifytags
gotests
iferr
unstable.gopls
gofumpt
impl
2024-08-14 08:38:19 +07:00
golangci-lint
2024-08-12 19:20:24 +07:00
];
# Some toolings will lookup for $GOROOT env.
home.sessionVariables = {
2024-08-28 10:11:10 +07:00
GOROOT = "${config.programs.go.package}/share/go";
GOPATH = "${config.home.homeDirectory}/go";
2024-08-27 15:24:09 +07:00
GOEXPERIMENT = "rangefunc";
};
2024-06-12 18:09:56 +07:00
};
}