feat: first commit

This commit is contained in:
2026-02-12 16:09:17 +01:00
commit 9448277a69
9 changed files with 237 additions and 0 deletions

47
flake.nix Normal file
View File

@@ -0,0 +1,47 @@
{
description = "A Nix-flake-based Go development environment";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs
outputs =
{ self, ... }@inputs:
let
goVersion = 24; # Change this to update the whole stack
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.self.overlays.default ];
};
}
);
in
{
overlays.default = final: prev: {
go = final."go_1_${toString goVersion}";
};
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShellNoCC {
packages = with pkgs; [
# go (version is specified by overlay)
go
];
};
}
);
};
}