nixpkgs/pkgs/tools/X11/caffeine-ng/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
1.8 KiB
Nix
Raw Normal View History

2022-07-15 16:15:11 +00:00
{ buildPythonApplication
, fetchPypi
, gobject-introspection
, gtk3
, lib
, libappindicator-gtk3
, libnotify
, click
, dbus-python
, ewmh
, pulsectl
, pygobject3
, pyxdg
, setproctitle
, python3
, procps
, xset
, xautolock
, xscreensaver
, xfce
, glib
, setuptools-scm
, wrapGAppsHook
2019-05-08 19:31:56 +00:00
}:
2022-07-15 16:15:11 +00:00
let
click_7 = click.overridePythonAttrs (old: rec {
version = "7.1.2";
src = old.src.override {
inherit version;
sha256 = "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a";
};
});
in buildPythonApplication rec {
2019-05-08 19:31:56 +00:00
pname = "caffeine-ng";
2022-07-15 16:15:11 +00:00
version = "4.0.2";
2019-05-08 19:31:56 +00:00
2022-07-15 16:15:11 +00:00
src = fetchPypi {
2019-05-08 19:31:56 +00:00
inherit pname version;
2022-07-15 16:15:11 +00:00
sha256 = "sha256-umIjXJ0et6Pi5Ejj96Q+ZhiKS+yj7bsgb4uQW6Ym6rU=";
2019-05-08 19:31:56 +00:00
};
nativeBuildInputs = [ wrapGAppsHook glib gobject-introspection setuptools-scm ];
2022-07-15 16:15:11 +00:00
buildInputs = [
2022-07-15 16:15:11 +00:00
libappindicator-gtk3
libnotify
gtk3
];
2022-07-15 16:15:11 +00:00
pythonPath = [
click_7
dbus-python
ewmh
pulsectl
pygobject3
pyxdg
setproctitle
2019-05-08 19:31:56 +00:00
];
doCheck = false; # There are no tests.
2022-08-08 16:35:28 +00:00
dontWrapGApps = true;
strictDeps = false;
postInstall = ''
2019-05-08 19:31:56 +00:00
cp -r share $out/
2022-07-15 16:15:11 +00:00
cp -r caffeine/assets/icons $out/share/
# autostart file
2022-07-15 16:15:11 +00:00
ln -s $out/${python3.sitePackages}/etc $out/etc
2019-05-08 19:31:56 +00:00
glib-compile-schemas --strict $out/share/glib-2.0/schemas
2022-08-08 16:35:28 +00:00
'';
2022-07-15 16:15:11 +00:00
2022-08-08 16:35:28 +00:00
preFixup = ''
2022-07-15 16:15:11 +00:00
gappsWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ procps xautolock xscreensaver xfce.xfconf xset ]}
)
2022-08-08 16:35:28 +00:00
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
2019-05-08 19:31:56 +00:00
'';
meta = with lib; {
mainProgram = "caffeine";
2019-05-08 19:31:56 +00:00
maintainers = with maintainers; [ marzipankaiser ];
description = "Status bar application to temporarily inhibit screensaver and sleep mode";
2022-07-15 16:15:11 +00:00
homepage = "https://codeberg.org/WhyNotHugo/caffeine-ng";
2019-05-08 19:31:56 +00:00
license = licenses.gpl3;
platforms = platforms.linux;
};
}