Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (54 loc) · 1.42 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (54 loc) · 1.42 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
{
description = "A shell with Go";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
stdenv = pkgs.gccStdenv;
glibcStatic = pkgs.glibc.static;
in
{
devShells.default = pkgs.mkShell {
hardeningDisable = [ "fortify" ];
buildInputs = with pkgs; [
stdenv
glibc.static
delve
gcc
cue
go
gotools
gopls
go-outline
gopkgs
gocode-gomod
godef
golint
nodejs_24
python3Packages.mkdocs
opencode
];
packages = with pkgs; [
protobuf_32
];
shellHook = ''
export PATH="$PATH:$(go env GOPATH)/bin"
npm set prefix ~/.npm-global
export PATH=$PATH:$HOME/.npm-global/bin
'';
GOROOT="${pkgs.go}/share/go";
GOPROXY="https://proxy.golang.org";
CGO_CFLAGS="-O2 -g -Wno-error";
CFLAGS="-I${pkgs.glibc.dev}/include";
LDFLAGS="-L${glibcStatic}/lib";
CGO_ENABLED=0;
DISABLE_TELEMETRY = "1";
};
});
}