feat(go): add go as a template
add go as a template when i need to
This commit is contained in:
parent
edcf6f758e
commit
cd612f03ad
8 changed files with 224 additions and 1 deletions
29
templates/go/flake.nix
Normal file
29
templates/go/flake.nix
Normal 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; };
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue