23 assert withGui -> !stdenv.hostPlatform.isDarwin;
25 stdenv.mkDerivation rec {
29 src = fetchFromGitHub {
33 sha256 = "sha256-pOo1YfeqHUU6xyBRFbcj2lX1MHJ+a5Hi31BMC1nYZGo=";
37 # pass through NIX_* environment variables to scons.
47 ++ lib.optionals withGui [
59 ++ lib.optionals withGui [
65 python3.pkgs.pygobject3
67 ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
72 # remove sources of nondeterminism
73 substituteInPlace lib/cmdline.c \
74 --replace "__DATE__" "\"Jan 1 1970\"" \
75 --replace "__TIME__" "\"00:00:00\""
76 substituteInPlace docs/SConscript \
77 --replace "gzip -c " "gzip -cn "
80 # Otherwise tries to access /usr.
81 prefixKey = "--prefix=";
83 sconsFlags = lib.optionals (!withGui) [ "--without-gui" ];
85 # in GUI mode, this shells out to itself, and tries to import python modules
86 postInstall = lib.optionalString withGui ''
87 gappsWrapperArgs+=(--prefix PATH : "$out/bin")
88 gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
92 description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
93 homepage = "https://rmlint.readthedocs.org";
94 platforms = platforms.unix;
95 license = licenses.gpl3;
96 maintainers = with maintainers; [
100 mainProgram = "rmlint";