nixpkgs/pkgs/by-name/go/gomuks/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

58 lines
1.5 KiB
Nix

{ lib
, stdenv
, buildGoModule
, fetchFromGitHub
, makeDesktopItem
, makeWrapper
, libnotify
, olm
, pulseaudio
, sound-theme-freedesktop
}:
buildGoModule rec {
pname = "gomuks";
version = "0.3.1";
src = fetchFromGitHub {
owner = "tulir";
repo = pname;
rev = "v${version}";
sha256 = "sha256-bDJXo8d9K5UO599HDaABpfwc9/dJJy+9d24KMVZHyvI=";
};
vendorHash = "sha256-0my58bVKLWbdTwhAnXMruNjujd07NXFn4bkRe1cUYpE=";
doCheck = false;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ olm ];
postInstall = ''
cp -r ${
makeDesktopItem {
name = "net.maunium.gomuks.desktop";
exec = "@out@/bin/gomuks";
terminal = true;
desktopName = "Gomuks";
genericName = "Matrix client";
categories = [ "Network" "Chat" ];
comment = meta.description;
}
}/* $out/
substituteAllInPlace $out/share/applications/*
wrapProgram $out/bin/gomuks \
--prefix PATH : "${lib.makeBinPath (lib.optionals stdenv.hostPlatform.isLinux [ libnotify pulseaudio ])}" \
--set-default GOMUKS_SOUND_NORMAL "${sound-theme-freedesktop}/share/sounds/freedesktop/stereo/message-new-instant.oga" \
--set-default GOMUKS_SOUND_CRITICAL "${sound-theme-freedesktop}/share/sounds/freedesktop/stereo/complete.oga"
'';
meta = with lib; {
homepage = "https://maunium.net/go/gomuks/";
description = "A terminal based Matrix client written in Go";
mainProgram = "gomuks";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ chvp ];
};
}