Skip to content

Commit 9d3551d

Browse files
Bump go version
Jesus christ what is up with the go people? Lets pin patch versions of our toolchain. I can't even
1 parent 4683582 commit 9d3551d

File tree

2 files changed

+58
-60
lines changed

2 files changed

+58
-60
lines changed

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+55-57
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,61 @@
33

44
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
55

6-
outputs = {
7-
self,
8-
nixpkgs,
9-
}: let
10-
version = builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101");
11-
# goOverlay = final: prev: {
12-
# go = prev.go.overrideAttrs (old: {
13-
# version = "1.23.2";
14-
# src = prev.fetchurl {
15-
# url = "https://go.dev/dl/go1.23.2.src.tar.gz";
16-
# hash = "sha256-NpMBYqk99BfZC9IsbhTa/0cFuqwrAkGO3aZxzfqc0H8=";
17-
# };
18-
# });
19-
# };
20-
withSystem = nixpkgs.lib.genAttrs [
21-
"x86_64-linux"
22-
"x86_64-darwin"
23-
"aarch64-linux"
24-
"aarch64-darwin"
25-
];
26-
withPkgs = callback:
27-
withSystem (
28-
system:
29-
callback (
30-
import nixpkgs {
31-
inherit system;
32-
# overlays = [goOverlay];
33-
}
34-
)
35-
);
36-
in {
37-
packages = withPkgs (pkgs: rec {
38-
nais = pkgs.buildGoModule {
39-
pname = "nais-cli";
40-
inherit version;
41-
src = ./.;
42-
vendorHash = "sha256-WE5WSOOAUBEfxF/NAaVjTFBZeMRA3APmOJGbBueKObo=";
43-
postInstall = ''
44-
mv $out/bin/cli $out/bin/nais
45-
'';
46-
};
47-
default = nais;
48-
});
6+
outputs = { self, nixpkgs, }:
7+
let
8+
version = builtins.substring 0 8
9+
(self.lastModifiedDate or self.lastModified or "19700101");
10+
withSystem = nixpkgs.lib.genAttrs [
11+
"x86_64-linux"
12+
"x86_64-darwin"
13+
"aarch64-linux"
14+
"aarch64-darwin"
15+
];
16+
withPkgs = callback:
17+
withSystem (system:
18+
callback (import nixpkgs {
19+
inherit system;
20+
overlays = [
21+
(final: prev: {
22+
go = (prev.go.overrideAttrs {
23+
version = "1.23.6";
24+
src = prev.fetchurl {
25+
url = "https://go.dev/dl/go1.23.6.src.tar.gz";
26+
hash =
27+
"sha256-A5xbBOZSedrO7opvcecL0Fz1uAF4K293xuGeLtBREiI=";
28+
};
29+
});
30+
})
31+
];
32+
}));
33+
in {
34+
packages = withPkgs (pkgs: rec {
35+
nais = pkgs.buildGoModule.override { go = pkgs.go; } {
36+
pname = "nais-cli";
37+
inherit version;
38+
src = ./.;
39+
vendorHash = "sha256-kr9VARylPRphfrBEf8KgY1mCV+a1lwQpT/lpur1T3tQ=";
4940

50-
devShells = withPkgs (pkgs: {
51-
default = pkgs.mkShell {
52-
buildInputs = with pkgs; [
53-
go
54-
gopls
55-
gotools
56-
go-tools
57-
nodejs_20
58-
nodePackages.prettier
59-
];
60-
};
61-
});
41+
postInstall = ''
42+
mv $out/bin/cli $out/bin/nais
43+
'';
44+
};
45+
default = nais;
46+
});
6247

63-
formatter = withPkgs (pkgs: pkgs.nixfmt-rfc-style);
64-
};
48+
devShells = withPkgs (pkgs: {
49+
default = pkgs.mkShell {
50+
buildInputs = with pkgs; [
51+
go
52+
gopls
53+
gotools
54+
go-tools
55+
nodejs_20
56+
nodePackages.prettier
57+
];
58+
};
59+
});
60+
61+
formatter = withPkgs (pkgs: pkgs.nixfmt-rfc-style);
62+
};
6563
}

0 commit comments

Comments
 (0)