nix: update nix and use go 1.23

Updates #12912

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2024-08-29 14:49:24 +02:00 committed by Kristoffer Dalby
parent b48c8db69c
commit e93c160a39
2 changed files with 40 additions and 34 deletions

View File

@ -21,11 +21,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1710146030,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1707619277, "lastModified": 1724748588,
"narHash": "sha256-vKnYD5GMQbNQyyQm4wRlqi+5n0/F1hnvqSQgaBy4BqY=", "narHash": "sha256-NlpGA4+AIf1dKNq76ps90rxowlFXUsV9x7vK/mN37JM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f3a93440fbfff8a74350f4791332a19282cc6dc8", "rev": "a6292e34000dc93d43bccf78338770c1c5ec8a99",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -40,7 +40,12 @@
}; };
}; };
outputs = { self, nixpkgs, flake-utils, flake-compat }: let outputs = {
self,
nixpkgs,
flake-utils,
flake-compat,
}: let
# tailscaleRev is the git commit at which this flake was imported, # tailscaleRev is the git commit at which this flake was imported,
# or the empty string when building from a local checkout of the # or the empty string when building from a local checkout of the
# tailscale repo. # tailscale repo.
@ -62,15 +67,16 @@
# So really, this flake is for tailscale devs to dogfood with, if # 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 # you're an end user you should be prepared for this flake to not
# build periodically. # build periodically.
tailscale = pkgs: pkgs.buildGo122Module rec { tailscale = pkgs:
pkgs.buildGo123Module rec {
name = "tailscale"; name = "tailscale";
src = ./.; src = ./.;
vendorHash = pkgs.lib.fileContents ./go.mod.sri; vendorHash = pkgs.lib.fileContents ./go.mod.sri;
nativeBuildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.makeWrapper ]; nativeBuildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [pkgs.makeWrapper];
ldflags = ["-X tailscale.com/version.gitCommitStamp=${tailscaleRev}"]; ldflags = ["-X tailscale.com/version.gitCommitStamp=${tailscaleRev}"];
CGO_ENABLED = 0; CGO_ENABLED = 0;
subPackages = [ "cmd/tailscale" "cmd/tailscaled" ]; subPackages = ["cmd/tailscale" "cmd/tailscaled"];
doCheck = false; doCheck = false;
# NOTE: We strip the ${PORT} and $FLAGS because they are unset in the # NOTE: We strip the ${PORT} and $FLAGS because they are unset in the
@ -79,8 +85,8 @@
# things, but for now, we hardcode the default of port 41641 (taken from # things, but for now, we hardcode the default of port 41641 (taken from
# ./cmd/tailscaled/tailscaled.defaults). # ./cmd/tailscaled/tailscaled.defaults).
postInstall = pkgs.lib.optionalString pkgs.stdenv.isLinux '' postInstall = pkgs.lib.optionalString pkgs.stdenv.isLinux ''
wrapProgram $out/bin/tailscaled --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.iproute2 pkgs.iptables pkgs.getent pkgs.shadow ]} wrapProgram $out/bin/tailscaled --prefix PATH : ${pkgs.lib.makeBinPath [pkgs.iproute2 pkgs.iptables pkgs.getent pkgs.shadow]}
wrapProgram $out/bin/tailscale --suffix PATH : ${pkgs.lib.makeBinPath [ pkgs.procps ]} wrapProgram $out/bin/tailscale --suffix PATH : ${pkgs.lib.makeBinPath [pkgs.procps]}
sed -i \ sed -i \
-e "s#/usr/sbin#$out/bin#" \ -e "s#/usr/sbin#$out/bin#" \
@ -112,7 +118,7 @@
gotools gotools
graphviz graphviz
perl perl
go_1_22 go_1_23
yarn yarn
]; ];
}; };