Initial commit
This commit is contained in:
54
go/flake.nix
Normal file
54
go/flake.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
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
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user