flake-template-hell/templates/go/flake.nix
2024-12-04 17:35:06 +00:00

38 lines
765 B
Nix

{
description = "Go flake template";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
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;};
});
};
}