2021-06-22 12:36:25 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
|
|
|
, dbus
|
|
|
|
, signal-cli
|
|
|
|
, xclip
|
|
|
|
}:
|
2021-05-09 08:43:10 +00:00
|
|
|
|
2021-06-22 12:36:25 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2021-05-09 08:43:10 +00:00
|
|
|
pname = "scli";
|
2022-04-03 16:55:01 +00:00
|
|
|
version = "0.7.1";
|
2021-05-09 08:43:10 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "isamert";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-04-03 16:55:01 +00:00
|
|
|
sha256 = "sha256-YEgeeoUqDeBx3jPddTeykl+68lS8gVKD+zdo+gRTaT4=";
|
2021-05-09 08:43:10 +00:00
|
|
|
};
|
|
|
|
|
2021-06-22 12:36:25 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
pyqrcode
|
|
|
|
urwid
|
|
|
|
urwid-readline
|
|
|
|
];
|
|
|
|
|
2021-05-09 08:43:10 +00:00
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# scli attempts to write to these directories, make sure they're writeable
|
|
|
|
export XDG_DATA_HOME=$(mktemp -d)
|
|
|
|
export XDG_CONFIG_HOME=$(mktemp -d)
|
|
|
|
./scli --help > /dev/null # don't spam nix-build log
|
|
|
|
test $? == 0
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
patchShebangs scli
|
|
|
|
install -m755 -D scli $out/bin/scli
|
|
|
|
'';
|
|
|
|
|
2021-06-22 12:36:25 +00:00
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix" "PATH" ":" (lib.makeBinPath [ dbus signal-cli xclip ])
|
|
|
|
];
|
|
|
|
|
2021-05-09 08:43:10 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple terminal user interface for Signal";
|
|
|
|
homepage = "https://github.com/isamert/scli";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ alex-eyre ];
|
|
|
|
};
|
|
|
|
}
|