NixOS/home/programs/go.nix

48 lines
973 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
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" ];
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
2024-10-22 15:36:45 +07:00
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
};
}