Files
2026-03-20 11:24:31 +01:00

66 lines
1.7 KiB
Nix

{
description = "A Nix-flake-based Go 1.26 development environment";
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2511";
nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgs-unstable, nur }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ nur.overlays.default ];
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
"goreleaser-pro"
];
};
pkgs-unstable = import nixpkgs-unstable {
inherit system;
};
in
f { pkgs = pkgs; pkgs-unstable = pkgs-unstable; system = system; }
);
in
{
devShells = forEachSupportedSystem ({ pkgs, pkgs-unstable, system }:
let
stablePackages = with pkgs; [
antlr
ginkgo
go_1_26
goperf
gotools
just
];
unstablePackages = with pkgs-unstable; [
golangci-lint
];
otherPackages = [
pkgs.nur.repos.goreleaser.goreleaser-pro
];
in
{
default = pkgs.mkShell {
packages = stablePackages ++ unstablePackages ++ otherPackages;
};
}
);
};
}