feat(go): add go as a template

add go as a template when i need to
This commit is contained in:
Artur Manuel 2024-08-11 22:44:19 +01:00
commit cd612f03ad
Failed to generate hash of commit
8 changed files with 224 additions and 1 deletions

29
templates/go/flake.nix Normal file
View file

@ -0,0 +1,29 @@
{
description = "Go flake template";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-24.05";
};
outputs = { self, nixpkgs }:
let
allSystems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
pkgs = import nixpkgs { inherit system; };
inherit system;
});
in
{
packages = forAllSystems ({ pkgs, system }: {
default = pkgs.callPackage ./nix/package.nix { };
go-app = self.packages.${system}.default;
});
devShells = forAllSystems ({ pkgs, system }: {
default = pkgs.callPackage ./nix/shell.nix { inherit (self.packages.${system}) go-app; };
});
};
}