nixpkgs/pkgs/by-name/tu/tuifimanager/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

88 lines
2.3 KiB
Nix

{
stdenv,
lib,
python3,
fetchFromGitHub,
kdePackages,
gnome-themes-extra,
qt6,
makeWrapper,
x11Support ? stdenv.hostPlatform.isLinux,
# pypinput is marked as broken for darwin
pynputSupport ? stdenv.hostPlatform.isLinux,
# Experimental Drag & Drop support requires x11 & pyinput suport
hasDndSupport ? x11Support && pynputSupport,
enableDragAndDrop ? false,
}:
lib.throwIf (enableDragAndDrop && !hasDndSupport)
"Drag and drop support is only available for linux with xorg."
python3.pkgs.buildPythonApplication
rec {
pname = "tuifimanager";
version = "5.0.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "GiorgosXou";
repo = "TUIFIManager";
rev = "v.${version}";
hash = "sha256-2yYD1YFGoN0uj3HzcYxEs3zbwfUIDLLzvfTcZILx5h4=";
};
nativeBuildInputs =
[
python3.pkgs.setuptools
python3.pkgs.setuptools-scm
]
++ (lib.optionals enableDragAndDrop [
qt6.wrapQtAppsHook
makeWrapper
]);
propagatedBuildInputs =
[
python3.pkgs.send2trash
python3.pkgs.unicurses
]
++ (lib.optionals enableDragAndDrop [
python3.pkgs.pynput
python3.pkgs.pyside6
python3.pkgs.requests
python3.pkgs.xlib
kdePackages.qtbase
kdePackages.qt6gtk2
]);
postFixup =
let
# fix missing 'adwaita' warning missing with ncurses tui
# see: https://github.com/NixOS/nixpkgs/issues/60918
theme = gnome-themes-extra;
in
lib.optionalString enableDragAndDrop ''
wrapProgram $out/bin/tuifi \
--prefix GTK_PATH : "${theme}/lib/gtk-2.0" \
--set tuifi_synth_dnd True
'';
pythonImportsCheck = [ "TUIFIManager" ];
meta = {
description = "Cross-platform terminal-based termux-oriented file manager";
longDescription = ''
A cross-platform terminal-based termux-oriented file manager (and component),
meant to be used with a Uni-Curses project or as is. This project is mainly an
attempt to get more attention to the Uni-Curses project.
'';
homepage = "https://github.com/GiorgosXou/TUIFIManager";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
michaelBelsanti
sigmanificient
];
mainProgram = "tuifi";
};
}