Files
nixpkgs/pkgs/by-name/hu/hugo/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

90 lines
2.1 KiB
Nix

{
stdenv,
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
buildPackages,
versionCheckHook,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "hugo";
version = "0.151.0";
src = fetchFromGitHub {
owner = "gohugoio";
repo = "hugo";
tag = "v${finalAttrs.version}";
hash = "sha256-gDbKYL1jCqV6yjCklTucTxK0oQYvy1kfEqE+4k3viXw=";
};
vendorHash = "sha256-swxlm9APcwLQzFFoz9PDT7vdxWFayKAfQx3IADhwnEs=";
checkFlags =
let
skippedTestPrefixes = [
# Workaround for "failed to load modules"
"TestCommands/mod"
# Server tests are flaky, at least in x86_64-darwin. See #368072
# We can try testing again after updating the `httpget` helper
# ref: https://github.com/gohugoio/hugo/blob/v0.140.1/main_test.go#L220-L233
"TestCommands/server"
];
in
[ "-skip=^${builtins.concatStringsSep "|^" skippedTestPrefixes}" ];
proxyVendor = true;
tags = [
"extended"
"withdeploy"
];
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)
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/hugo";
versionCheckProgramArg = "version";
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/gohugoio/hugo/releases/tag/v${finalAttrs.version}";
description = "Fast and modern static website engine";
homepage = "https://gohugo.io";
license = lib.licenses.asl20;
mainProgram = "hugo";
maintainers = with lib.maintainers; [
schneefux
Br1ght0ne
Frostman
];
};
})