nixpkgs/pkgs/applications/misc/hugo/default.nix
2023-06-06 06:10:41 +02:00

44 lines
1.2 KiB
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, buildPackages }:
buildGoModule rec {
pname = "hugo";
version = "0.113.0";
src = fetchFromGitHub {
owner = "gohugoio";
repo = pname;
rev = "v${version}";
hash = "sha256-oKGRbgr4jaau6wfo6Q/yhYgambGa+wb3ENtk6wrb0J0=";
};
vendorHash = "sha256-+eVaV6iGsubMt6cq0lKP0i69BlYW8jwx6lT6rwhZAoA=";
doCheck = false;
proxyVendor = true;
tags = [ "extended" ];
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles ];
ldflags = [ "-s" "-w" "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=nixpkgs" ];
postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
${emulator} $out/bin/hugo gen man
installManPage man/*
installShellCompletion --cmd hugo \
--bash <(${emulator} $out/bin/hugo completion bash) \
--fish <(${emulator} $out/bin/hugo completion fish) \
--zsh <(${emulator} $out/bin/hugo completion zsh)
'';
meta = with lib; {
description = "A fast and modern static website engine";
homepage = "https://gohugo.io";
license = licenses.asl20;
maintainers = with maintainers; [ schneefux Br1ght0ne Frostman ];
};
}