nixpkgs/pkgs/by-name/cl/clipmenu/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

48 lines
1.0 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, makeWrapper
, clipnotify
, coreutils
, gawk
, util-linux
, xdotool
, xsel
}:
stdenv.mkDerivation rec {
pname = "clipmenu";
version = "6.2.0";
src = fetchFromGitHub {
owner = "cdown";
repo = "clipmenu";
rev = version;
sha256 = "sha256-nvctEwyho6kl4+NXi76jT2kG7nchmI2a7mgxlgjXA5A=";
};
postPatch = ''
sed -i init/clipmenud.service \
-e "s,/usr/bin,$out/bin,"
'';
makeFlags = [ "PREFIX=$(out)" ];
nativeBuildInputs = [ makeWrapper xsel clipnotify ];
postFixup = ''
sed -i "$out/bin/clipctl" -e 's,clipmenud\$,\.clipmenud-wrapped\$,'
wrapProgram "$out/bin/clipmenu" \
--prefix PATH : "${lib.makeBinPath [ xsel ]}"
wrapProgram "$out/bin/clipmenud" \
--set PATH "${lib.makeBinPath [ clipnotify coreutils gawk util-linux xdotool xsel ]}"
'';
meta = with lib; {
description = "Clipboard management using dmenu";
inherit (src.meta) homepage;
maintainers = with maintainers; [ jb55 ];
license = licenses.publicDomain;
};
}