Skip to content

Commit

Permalink
go: add GOPATH option
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfangAukang committed Feb 26, 2024
1 parent 83cb93d commit 22b17b4
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions extra/language/go.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,26 @@ with lib;
example = literalExpression "pkgs.go";
description = "Which go package to use";
};

GOPATH = mkOption {
type = types.nullOr types.path;
default = "$HOME/go";
example = literalExpression "/home/user/go";
description = "Path to your go directory";
};
};

config = {
env = [{
name = "GO111MODULE";
value = cfg.GO111MODULE;
}];
env = [
{
name = "GO111MODULE";
value = cfg.GO111MODULE;
}
{
name = "GOPATH";
eval = cfg.GOPATH;
}
];

devshell.packages = [ cfg.package ];
};
Expand Down

0 comments on commit 22b17b4

Please sign in to comment.