diff options
Diffstat (limited to 'pkgs/by-name/ar/artalk/package.nix')
-rw-r--r-- | pkgs/by-name/ar/artalk/package.nix | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/pkgs/by-name/ar/artalk/package.nix b/pkgs/by-name/ar/artalk/package.nix index 63edf4852b5aa..a9918059d6ad1 100644 --- a/pkgs/by-name/ar/artalk/package.nix +++ b/pkgs/by-name/ar/artalk/package.nix @@ -3,8 +3,11 @@ buildGoModule, fetchFromGitHub, artalk, - testers, fetchurl, + installShellFiles, + stdenv, + testers, + nixosTests, }: buildGoModule rec { pname = "artalk"; @@ -13,7 +16,7 @@ buildGoModule rec { src = fetchFromGitHub { owner = "ArtalkJS"; repo = "artalk"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-fOuZiFomXGvRUXkpEM3BpJyMOtSm6/RHd0a7dPOsoT4="; }; web = fetchurl { @@ -31,20 +34,38 @@ buildGoModule rec { "-X github.com/ArtalkJS/Artalk/internal/config.Version=${version}" "-X github.com/ArtalkJS/Artalk/internal/config.CommitHash=${version}" ]; + preBuild = '' tar -xzf ${web} cp -r ./artalk_ui/* ./public ''; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = + '' + # work around case insensitive file systems + mv $out/bin/Artalk $out/bin/artalk.tmp + mv $out/bin/artalk.tmp $out/bin/artalk + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd artalk \ + --bash <($out/bin/artalk completion bash) \ + --fish <($out/bin/artalk completion fish) \ + --zsh <($out/bin/artalk completion zsh) + ''; + passthru.tests = { version = testers.testVersion { package = artalk; }; + inherit (nixosTests) artalk; }; - meta = with lib; { + meta = { description = "Self-hosted comment system"; homepage = "https://github.com/ArtalkJS/Artalk"; - license = licenses.mit; - maintainers = with maintainers; [ moraxyc ]; - mainProgram = "Artalk"; + changelog = "https://github.com/ArtalkJS/Artalk/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ moraxyc ]; + mainProgram = "artalk"; }; } |