tmpls/template/flake.nix

38 lines
875 B
Nix

{
description = "{{description}}";
inputs.nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
{{if pname}}
packages.${system}.default = pkgs.buildGoModule {
pname = "{{pname}}";
version = "{{version}}";
src = ./.;
vendorHash = "";
meta = with pkgs.lib; {
description = "{{description}}";
homepage = "{{url}}";
maintainers = with maintainers; [jolheiser];
mainProgram = "{{pname}}";
};
};
{{end}}
{{if packages}}
devShells.${system}.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
{{- range $pkg := (splitList "\n" packages)}}
{{trim $pkg}}
{{- end}}
];
};
{{end}}
};
}