nixpkgs/pkgs/development/python-modules/pywal/default.nix
Ihar Hrachyshka 567e8dfd8e
treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

50 lines
1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
imagemagick,
feh,
isPy3k,
}:
buildPythonPackage rec {
pname = "pywal";
version = "3.3.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "1drha9kshidw908k7h3gd9ws2bl64ms7bjcsa83pwb3hqa9bkspg";
};
patches = [
./convert.patch
./feh.patch
];
postPatch = ''
substituteInPlace pywal/backends/wal.py --subst-var-by convert "${imagemagick}/bin/convert"
substituteInPlace pywal/wallpaper.py --subst-var-by feh "${feh}/bin/feh"
'';
# Invalid syntax
disabled = !isPy3k;
preCheck = ''
mkdir tmp
HOME=$PWD/tmp
for f in tests/test_export.py tests/test_util.py ; do
substituteInPlace "$f" \
--replace '/tmp/' "$TMPDIR/"
done
'';
meta = {
description = "Generate and change colorschemes on the fly. A 'wal' rewrite in Python 3";
mainProgram = "wal";
homepage = "https://github.com/dylanaraps/pywal";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ Fresheyeball ];
};
}