nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv
2, lib
3, fetchurl
4, autoPatchelfHook
5, makeShellWrapper
6, wrapGAppsHook
7, alsa-lib
8, at-spi2-atk
9, at-spi2-core
10, atk
11, cairo
12, cups
13, dbus
14, expat
15, glib
16, gtk3
17, libsecret
18, mesa
19, nss
20, pango
21, udev
22, xdg-utils
23, xorg
24}:
25
26stdenv.mkDerivation rec {
27 pname = "publii";
28 version = "0.42.1";
29
30 src = fetchurl {
31 url = "https://getpublii.com/download/Publii-${version}.deb";
32 hash = "sha256-GHGXu/z2L4aJG1O1THPIxnRBdPJOIVuQsZP0zhjTZlo=";
33 };
34
35 dontConfigure = true;
36 dontBuild = true;
37 dontWrapGApps = true;
38
39 nativeBuildInputs = [
40 autoPatchelfHook
41 makeShellWrapper
42 wrapGAppsHook
43 ];
44
45 buildInputs = [
46 alsa-lib
47 at-spi2-atk
48 at-spi2-core
49 atk
50 cairo
51 cups
52 dbus
53 expat
54 glib
55 gtk3
56 libsecret
57 mesa
58 nss
59 pango
60 xorg.libX11
61 xorg.libxcb
62 ];
63
64 unpackPhase = ''
65 ar p $src data.tar.xz | tar xJ
66 '';
67
68 installPhase = ''
69 runHook preInstall
70
71 mkdir -p $out/bin
72
73 mv usr/share $out
74 substituteInPlace $out/share/applications/Publii.desktop \
75 --replace 'Exec=/opt/Publii/Publii' 'Exec=Publii'
76
77 mv opt $out
78
79 runHook postInstall
80 '';
81
82 preFixup = ''
83 makeWrapper $out/opt/Publii/Publii $out/bin/Publii \
84 "''${gappsWrapperArgs[@]}" \
85 --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
86 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
87 '';
88
89 meta = with lib; {
90 description = "Static Site CMS with GUI to build privacy-focused SEO-friendly website.";
91 longDescription = ''
92 Creating a website doesn't have to be complicated or expensive. With Publii, the most
93 intuitive static site CMS, you can create a beautiful, safe, and privacy-friendly website
94 quickly and easily; perfect for anyone who wants a fast, secure website in a flash.
95 '';
96 homepage = "https://getpublii.com";
97 changelog = "https://github.com/getpublii/publii/releases/tag/v${version}";
98 license = licenses.gpl3Only;
99 maintainers = with lib.maintainers; [ urandom sebtm ];
100 platforms = [ "x86_64-linux" ];
101 };
102}