This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
forked from tailscale/tailscale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
49 lines (48 loc) · 1.81 KB
/
shell.nix
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
# This is a shell.nix file used to describe the environment that tailscale needs
# for development. This includes a lot of the basic tools that you need in order
# to get started. We hope this file will be useful for users of Nix on macOS or
# Linux.
#
# For more information about this and why this file is useful, see here:
# https://nixos.org/guides/nix-pills/developing-with-nix-shell.html
#
# Also look into direnv: https://direnv.net/, this can make it so that you can
# automatically get your environment set up when you change folders into the
# project.
{
pkgs ? import <nixpkgs> {},
tailscale-go-rev ? "710a0d861098c07540ad073bb73a42ce81bf54a8",
tailscale-go-sha ? "sha256-hnyddxiyqMFHGwV3I4wkBcYNd56schYFi0SL5/0PnMI=",
}:
let
tailscale-go = pkgs.lib.overrideDerivation pkgs.go_1_18 (attrs: rec {
name = "tailscale-go-${version}";
version = tailscale-go-rev;
src = pkgs.fetchFromGitHub {
owner = "tailscale";
repo = "go";
rev = tailscale-go-rev;
sha256 = tailscale-go-sha;
};
nativeBuildInputs = attrs.nativeBuildInputs ++ [ pkgs.git ];
# Remove dependency on xcbuild as that causes iOS/macOS builds to fail.
propagatedBuildInputs = [];
checkPhase = "";
# Our forked tailscale reads this env var to embed the git hash
# into the Go build version.
TAILSCALE_TOOLCHAIN_REV = tailscale-go-rev;
});
in
pkgs.mkShell {
# This specifies the tools that are needed for people to get started with
# development. These tools include:
# - The Go compiler toolchain (and all additional tooling with it)
# - gotools for goimports, a robust formatting tool for Go source code
# - gopls, the language server for Go to increase editor integration
# - git, the version control program (used in some scripts)
buildInputs = [
pkgs.git
pkgs.gotools pkgs.gopls
tailscale-go
];
}