nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 rustPlatform,
6 pkg-config,
7 oniguruma,
8 installShellFiles,
9 zola,
10 testers,
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "zola";
15 version = "0.21.0";
16
17 src = fetchFromGitHub {
18 owner = "getzola";
19 repo = "zola";
20 rev = "v${version}";
21 hash = "sha256-+/0MhKKDSbOEa5btAZyaS3bQPeGJuski/07I4Q9v9cg=";
22 };
23
24 cargoHash = "sha256-K2wdq61FVVG9wJF+UcRZyZ2YSEw3iavboAGkzCcTGkU=";
25
26 nativeBuildInputs = [
27 pkg-config
28 installShellFiles
29 ];
30
31 buildInputs = [
32 oniguruma
33 ];
34
35 RUSTONIG_SYSTEM_LIBONIG = true;
36
37 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
38 installShellCompletion --cmd zola \
39 --bash <($out/bin/zola completion bash) \
40 --fish <($out/bin/zola completion fish) \
41 --zsh <($out/bin/zola completion zsh)
42 '';
43
44 passthru.tests.version = testers.testVersion { package = zola; };
45
46 meta = {
47 description = "Fast static site generator with everything built-in";
48 mainProgram = "zola";
49 homepage = "https://www.getzola.org/";
50 changelog = "https://github.com/getzola/zola/raw/v${version}/CHANGELOG.md";
51 license = lib.licenses.mit;
52 maintainers = with lib.maintainers; [
53 dandellion
54 dywedir
55 _0x4A6F
56 ];
57 };
58}