Files
flakes/go/flake.nix
Martin Pander 395a70b759 Initial commit
2026-02-23 21:45:13 +01:00

55 lines
1.3 KiB
Nix

{
description = "Go Project";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.my-app = pkgs.buildGoModule {
pname = "My App";
version = "0.1.0";
src = ./.;
vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
#ldflags = [ "-s" "-w" ];
nativeBuildInputs = with pkgs; [
];
meta = with pkgs.lib; {
description = "A Go Application";
mainProgram = "main";
};
};
# Set the default package
packages.default = self'.packages.my-app;
# Development shell
devShells.default = pkgs.mkShell {
inputsFrom = [ self'.packages.my-app ];
buildInputs = with pkgs; [
go_1_25
gotools
golangci-lint
gopls
go-outline
gopkgs
go-tools
gotests
delve
];
};
};
};
}