Skip to content

Instantly share code, notes, and snippets.

@savannidgerinel
Last active March 10, 2024 21:31
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save savannidgerinel/a58c9d014cdc91af2cd367e7707d0d17 to your computer and use it in GitHub Desktop.
Save savannidgerinel/a58c9d014cdc91af2cd367e7707d0d17 to your computer and use it in GitHub Desktop.
Nix setup for a Golang dev environment
[go-shell] savanni@lapis:~/src/golang $ ls -l
total 81928
drwxr-xr-x 5 savanni staff 160 Dec 17 2018 bin
drwxr-xr-x 4 savanni staff 128 Jun 11 2018 pkg
-rw-r--r-- 1 savanni staff 923 Jun 11 2018 shell.nix
drwxr-xr-x 9 savanni staff 288 Jun 10 2018 src
{ pkgs ? import <nixpkgs> {}
, golang ? pkgs.go
, godep ? pkgs.dep }:
pkgs.stdenv.mkDerivation {
name = "go-shell";
buildInputs = [ golang
godep
];
shellHook = ''
export GOPATH=`pwd`
export PATH=$GOPATH/bin:$PATH
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment