-
Notifications
You must be signed in to change notification settings - Fork 14
/
flake.nix
100 lines (91 loc) · 2.64 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
description = "cross-platform terminal-based termux-oriented file manager.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
] (system: let
pkgs = nixpkgs.legacyPackages.${system};
py = {
env = pkgs.python311.withPackages (p: py.deps);
pkgs = pkgs.python311.pkgs;
deps = with pkgs.python311.pkgs;
[
send2trash
unicurses
]
# pyinput is marked as broken for darwin
# pkgs.gnome3.gnome-themes-extra
++ (pkgs.lib.optionals pkgs.stdenv.isLinux [
pynput
pyside6
requests
xlib
]);
};
in {
devShells.default = pkgs.mkShell {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.ncurses];
packages = [
py.env
py.env.pkgs.venvShellHook
pkgs.gnumake
];
venvDir = "venv";
postVenvCreation = ''
pip install -r requirements.txt
pip install -e .
'';
};
formatter = pkgs.alejandra;
packages = rec {
default = tuifi-manager;
tuifi-manager = let
pyproject = builtins.readFile ./pyproject.toml;
version = (builtins.fromTOML pyproject).project.version;
in
py.pkgs.buildPythonApplication {
pname = "tuifi-manager";
inherit version;
src = ./.;
format = "pyproject";
nativeBuildInputs =
(with py.pkgs; [
setuptools
setuptools-scm
])
++ (pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.qt6.wrapQtAppsHook
pkgs.makeWrapper
]);
propagatedBuildInputs =
py.deps
++ (with pkgs.kdePackages;
pkgs.lib.optionals pkgs.stdenv.isLinux [
qtbase
qt6gtk2
]);
postFixup = let
# https://github.com/NixOS/nixpkgs/issues/60918
theme = pkgs.gnome3.gnome-themes-extra;
in
pkgs.lib.optionalString pkgs.stdenv.isLinux ''
wrapProgram $out/bin/tuifi \
--prefix GTK_PATH : "${theme}/lib/gtk-2.0"
'';
pythonImportsCheck = ["TUIFIManager"];
meta.mainProgram = "tuifi";
};
};
});
}