Skip to content

Commit

Permalink
nix: update nixpkgs flake, override go_1_20 for tailscale_go (tailsca…
Browse files Browse the repository at this point in the history
…le#7139)

Bleeding edge Tailscale Nix flake broke after updating to go1.20rc3.

Go 1.20 moved to Go 1.17 as a bootstarp toolchain. Fortunately nixpkgs
nixos-unstable already had a 1.20.nix with bootstrap117.nix.

```
❯ ./result/bin/tailscale version
1.37.0-dev
  track: unstable (dev); frequent updates and bugs are likely
  go version: go1.20rc3-ts6a17f14c05
```

Signed-off-by: Shayne Sweeney <[email protected]>
  • Loading branch information
shayne authored Feb 1, 2023
1 parent f8fc3db commit 30e0156
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# nixpkgs style imports and flake semantics, unless upstream
# nixpkgs exposes the buildGoModule constructor func explicitly.
pkgsWithTailscaleGo = pkgs: pkgs.extend (final: prev: rec {
tailscale_go = prev.lib.overrideDerivation prev.go_1_19 (attrs: rec {
tailscale_go = prev.lib.overrideDerivation prev.go_1_20 (attrs: rec {
name = "tailscale-go-${version}";
version = tailscale-go-rev;
src = pkgs.fetchFromGitHub {
Expand All @@ -82,9 +82,9 @@
checkPhase = "";
TAILSCALE_TOOLCHAIN_REV = tailscale-go-rev;
});
# Override go_1_19 so that buildGo119Module below uses
# Override go_1_20 so that buildGo120Module below uses
# tailscale's toolchain as well.
go_1_19 = tailscale_go;
go_1_20 = tailscale_go;
});

# tailscaleRev is the git commit at which this flake was imported,
Expand All @@ -108,7 +108,7 @@
# So really, this flake is for tailscale devs to dogfood with, if
# you're an end user you should be prepared for this flake to not
# build periodically.
tailscale = pkgs: pkgs.buildGo119Module rec {
tailscale = pkgs: pkgs.buildGo120Module rec {
name = "tailscale";

src = ./.;
Expand Down

0 comments on commit 30e0156

Please sign in to comment.