Skip to content

Commit

Permalink
clerk: update and format
Browse files Browse the repository at this point in the history
And fix version
  • Loading branch information
AndersonTorres committed Nov 1, 2024
1 parent ca1ecc0 commit b1b1176
Showing 1 changed file with 61 additions and 40 deletions.
101 changes: 61 additions & 40 deletions pkgs/applications/audio/clerk/default.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, rofi
, tmux
, fzf
, mpc-cli
, perl
, util-linux
, libnotify
, perlPackages
{
lib,
fetchFromGitHub,
fzf,
installShellFiles,
libnotify,
makeWrapper,
mpc,
perlPackages,
rofi,
stdenv,
tmux,
unstableGitUpdater,
util-linux,
}:

stdenv.mkDerivation {
pname = "clerk";
version = "unstable-2023-10-07";
version = "4.0.5-unstable-2023-10-07";

src = fetchFromGitHub {
owner = "carnager";
Expand All @@ -23,12 +25,10 @@ stdenv.mkDerivation {
hash = "sha256-V2nDLq2ViC5Twve0EILBEYOdEavqgYB/TQq/T+ftfmk=";
};

postPatch = ''
substituteInPlace clerk_rating_client.service \
--replace "/usr" "$out"
'';

nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [
installShellFiles
makeWrapper
];

buildInputs = with perlPackages; [
perl
Expand All @@ -47,36 +47,57 @@ stdenv.mkDerivation {

strictDeps = true;

postPatch = ''
substituteInPlace clerk_rating_client.service \
--replace "/usr" "$out"
'';

installPhase = ''
runHook preInstall
install -D clerk.pl $out/bin/clerk
install -D clerk_rating_client $out/bin/clerk_rating_client
mv clerk.pl clerk
installBin clerk clerk_rating_client
install -D clerk_rating_client.service $out/lib/systemd/user/clerk_rating_client.service
runHook postInstall
'';

postFixup = let
binPath = lib.makeBinPath [
libnotify
mpc-cli
rofi
tmux
fzf
util-linux
];
in
''
wrapProgram $out/bin/clerk --set PERL5LIB $PERL5LIB --prefix PATH : "${binPath}"
wrapProgram $out/bin/clerk_rating_client --set PERL5LIB $PERL5LIB --prefix PATH : "${binPath}"
'';
postFixup =
let
binPath = lib.makeBinPath [
fzf
libnotify
mpc
rofi
tmux
util-linux
];
in
''
pushd $out/bin
for f in clerk clerk_rating_client; do
wrapProgram $f \
--prefix PATH : "${binPath}" \
--set PERL5LIB $PERL5LIB
done
popd
'';

meta = with lib; {
description = "MPD client based on rofi/fzf";
passthru.updateScript = unstableGitUpdater {
url = "https://github.com/carnager/clerk.git";
hardcodeZeroVersion = true;
};

meta = {
homepage = "https://github.com/carnager/clerk";
license = licenses.mit;
maintainers = with maintainers; [ anderspapitto rewine ];
description = "MPD client based on rofi/fzf";
license = lib.licenses.mit;
mainProgram = "clerk";
platforms = platforms.linux;
maintainers = with lib.maintainers; [
anderspapitto
rewine
AndersonTorres
];
platforms = lib.platforms.linux;
};
}

0 comments on commit b1b1176

Please sign in to comment.