2024-10-29 11:11:06 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
|
|
buildPackages,
|
|
|
|
testers,
|
|
|
|
nix-update-script,
|
|
|
|
hugo,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "hugo";
|
2024-10-29 11:11:06 +00:00
|
|
|
version = "0.136.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gohugoio";
|
2024-01-02 11:29:13 +00:00
|
|
|
repo = "hugo";
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-29 11:11:06 +00:00
|
|
|
hash = "sha256-wCv0lZqvJNOwL/naFuGb6k0Xyk58NpgH1mkhoNnkSno=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
vendorHash = "sha256-KqDsa7MlSONyn7AYOepQ95q1CEM83AhWk23iYSQ4twU=";
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
proxyVendor = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-06 21:57:35 +00:00
|
|
|
tags = [ "extended" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/gohugoio/hugo/common/hugo.vendorInfo=nixpkgs"
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
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)
|
|
|
|
'';
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = hugo;
|
|
|
|
command = "hugo version";
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/gohugoio/hugo/releases/tag/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Fast and modern static website engine";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://gohugo.io";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
mainProgram = "hugo";
|
2024-10-29 11:11:06 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
schneefux
|
|
|
|
Br1ght0ne
|
|
|
|
Frostman
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|