nixpkgs/pkgs/applications/misc/hugo/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, buildPackages
, testers
, hugo
}:
2016-06-17 15:38:40 +00:00
buildGoModule rec {
pname = "hugo";
version = "0.121.1";
2016-06-17 15:38:40 +00:00
src = fetchFromGitHub {
2019-12-03 18:16:13 +00:00
owner = "gohugoio";
repo = pname;
2023-08-01 09:57:17 +00:00
rev = "refs/tags/v${version}";
hash = "sha256-XNOp0k2t5Tv4HKKz3ZqL/sAdiYedOACaZ/1T7t7/Q1A=";
2016-06-17 15:38:40 +00:00
};
vendorHash = "sha256-J/me67pC+YWjGIQP6q1c+vsSXFxXoLZV7AyDv3+606k=";
doCheck = false;
2022-01-01 05:05:03 +00:00
proxyVendor = true;
2016-10-09 16:44:25 +00:00
2021-08-05 21:52:29 +00:00
tags = [ "extended" ];
2018-08-02 18:49:19 +00:00
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles ];
2022-08-30 13:18:00 +00:00
ldflags = [ "-s" "-w" "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=nixpkgs" ];
2022-09-20 15:11:36 +00:00
postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
${emulator} $out/bin/hugo gen man
installManPage man/*
installShellCompletion --cmd hugo \
2022-09-20 15:11:36 +00:00
--bash <(${emulator} $out/bin/hugo completion bash) \
--fish <(${emulator} $out/bin/hugo completion fish) \
--zsh <(${emulator} $out/bin/hugo completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = hugo;
command = "hugo version";
version = "v${version}";
};
meta = with lib; {
description = "A fast and modern static website engine";
2019-12-03 18:16:13 +00:00
homepage = "https://gohugo.io";
2018-02-21 14:08:58 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ schneefux Br1ght0ne Frostman ];
2016-10-09 16:44:25 +00:00
};
2016-06-17 15:38:40 +00:00
}