Skip to content

Commit

Permalink
bumblebee-status: init at 2.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
augustebaum committed Sep 18, 2023
1 parent 98fae06 commit 074eb94
Show file tree
Hide file tree
Showing 3 changed files with 442 additions and 0 deletions.
63 changes: 63 additions & 0 deletions pkgs/applications/window-managers/i3/bumblebee-status/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{ pkgs
, lib
, python3
, python3Packages
, fetchFromGitHub
, withPlugins ? [ ]
, ...
}:
python3Packages.buildPythonPackage rec {
pname = "bumblebee-status";
version = "2.1.6";

src = fetchFromGitHub {
owner = "tobi-wan-kenobi";
repo = pname;
rev = "v${version}";
hash = "sha256-Oo7n3NyUxBedQHG5P7TM9nuI2hwnVN1SJcK9OP3yiyE=";
};

propagatedBuildInputs =
let
allPlugins = import ./plugins.nix { inherit pkgs python3Packages; };

isSelected = plugin: builtins.elem plugin.name withPlugins;

selectedPlugins = lib.filter isSelected allPlugins;

pluginPropagatedBuildInputs = builtins.concatMap (p: p.requires) selectedPlugins;
in
pluginPropagatedBuildInputs;

checkInputs = with python3Packages; [ freezegun netifaces psutil pytest pytest-mock ];

checkPhase = ''
runHook preCheck
# Fixes `locale.Error: unsupported locale setting` in some tests.
export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive";
# FIXME: We skip the `dunst` module tests, some of which fail with
# `RuntimeError: killall -s SIGUSR2 dunst not found`.
# This is not solved by adding `pkgs.killall` to `checkInputs`.
${python3.interpreter} -m pytest -k 'not test_dunst.py'
runHook postCheck
'';

postInstall = ''
# Remove binary cache files
find $out -name "__pycache__" -type d | xargs rm -rv
# Make themes available for bumblebee-status to detect them
cp -r ./themes $out/${python3.sitePackages}
'';

meta = with lib; {
description = "bumblebee-status is a modular, theme-able status line generator for the i3 window manager.";
homepage = "https://bumblebee-status.readthedocs.io/";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ augustebaum ];
};
}
Loading

0 comments on commit 074eb94

Please sign in to comment.