-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (49 loc) · 1.61 KB
/
flake.nix
File metadata and controls
60 lines (49 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
description = "meshStack Terraform Provider";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs {
inherit system;
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
"terraform"
];
};
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
# go 1.25 (pinned)
go_1_25
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
# https://github.com/hashicorp/terraform-plugin-docs
terraform-plugin-docs
# https://github.com/hashicorp/terraform
terraform
# https://taskfile.dev
go-task
];
shellHook = ''
# Explicitly set GOROOT to Nix-installed Go
export GOROOT="${pkgs.go_1_25}/share/go"
# Isolate Go environment from system
export GOPATH="$PWD/.nix-go"
export GOCACHE="$PWD/.nix-go/cache"
export GOMODCACHE="$PWD/.nix-go/mod"
export GOBIN="$PWD/.nix-go/bin"
export PATH="$GOBIN:$PATH"
mkdir -p "$GOPATH" "$GOCACHE" "$GOMODCACHE" "$GOBIN"
'';
};
});
};
}