Skip to content

Commit

Permalink
Bump Go to 1.23, add NIX support
Browse files Browse the repository at this point in the history
Co-Authored-By: <[email protected]>
Co-Authored-By: <[email protected]>

commit f93c61d
Author: carl hedgren <[email protected]>
Date:   Fri Aug 23 10:37:11 2024 +0200

    chore: bump golang builder
  • Loading branch information
kimtore committed Aug 28, 2024
1 parent a2fd882 commit 4f6e47a
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22 AS builder
FROM golang:1.23 AS builder
ENV GOOS=linux
ENV CGO_ENABLED=0
WORKDIR /src
Expand Down
26 changes: 26 additions & 0 deletions flake.lock

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

45 changes: 45 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
description = "naiserator";

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

outputs = { nixpkgs, ... }:
let
goOverlay = final: prev: {
go = prev.go.overrideAttrs (old: {
version = "1.23.0";
src = prev.fetchurl {
url = "https://go.dev/dl/go1.23.0.src.tar.gz";
hash = "sha256-Qreo6A2AXaoDAi7T/eQyHUw78smQoUQWXQHu7Nb2mcY=";
};
});
};
withSystem = nixpkgs.lib.genAttrs [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
withPkgs = callback:
withSystem (system:
callback (import nixpkgs {
inherit system;
overlays = [ goOverlay ];
}));
in {
devShells = withPkgs (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
go-tools
gnumake
gofumpt
];
};
});

formatter = withPkgs (pkgs: pkgs.nixfmt-rfc-style);
};
}

0 comments on commit 4f6e47a

Please sign in to comment.