1
Fork 0
satellite/pkgs/vimclip.nix

31 lines
718 B
Nix
Raw Normal View History

{ pkgs, lib, ... }:
2023-12-10 23:48:46 +01:00
let vimclipRaw = pkgs.stdenv.mkDerivation rec {
name = "vimclip";
rev = "52003cc31e6e1d20550cdf6b7d3bf1a019a34fa0";
src = pkgs.fetchFromGitHub {
inherit rev;
owner = "hrantzsch";
repo = "vimclip";
sha256 = "1ifsiiafvby8z9gp1x6fpfwklr6k9mg5vrajw9di06yixmrxzw7g";
};
installPhase = ''
mkdir -p $out/bin
cp ./vimclip $out/bin/vimclip
chmod +x $out/bin/vimclip
'';
meta.mainProgram = "vimclip";
}; in
pkgs.writeShellScriptBin "vimclip" ''
2023-06-04 08:35:38 +02:00
if [ "wayland" = $XDG_SESSION_TYPE ]
then
2023-06-04 08:17:14 +02:00
export VIMCLIP_CLIPBOARD_COMMAND=${pkgs.wl-clipboard}/bin/wl-copy
else
export VIMCLIP_CLIPBOARD_COMMAND=${pkgs.xsel}/bin/xsel
fi
2023-12-10 23:48:46 +01:00
${lib.getExe vimclipRaw}
''