54 lines
1.3 KiB
Nix
54 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.default = 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.default ];
|
|
|
|
packages = with pkgs; [
|
|
go_1_25
|
|
gotools
|
|
golangci-lint
|
|
gopls
|
|
go-outline
|
|
gopkgs
|
|
go-tools
|
|
gotests
|
|
delve
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|