-
Notifications
You must be signed in to change notification settings - Fork 32
/
flake.nix
77 lines (75 loc) · 2.04 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
{
description = "Dmenu/Rofi/Wofi frontend for Keepass databases";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "i686-linux" "aarch64-linux"];
forAllSystems = f:
nixpkgs.lib.genAttrs systems (system:
f {
pkgs = nixpkgs.legacyPackages.${system};
});
in {
devShells = forAllSystems ({pkgs}: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
pandoc
python3Packages.venvShellHook
uv
];
venvDir = "./.venv";
C_INCLUDE_PATH = "${pkgs.linuxHeaders}/include";
HATCH_ENV_TYPE_VIRTUAL_UV_PATH = "${pkgs.uv}/bin/uv"; # use Nix uv instead of hatch downloaded binary
PYTHONPATH = "$PYTHONPATH:$PWD";
shellHook = ''
venvShellHook
alias keepmenu="python -m keepmenu"
'';
postVenvCreation = ''
uv pip install hatch
uv pip install -e .
# Prevent venv uv from overriding nixpkgs uv
[ -f $(pwd)/.venv/bin/uv ] && rm $(pwd)/.venv/bin/uv*
'';
};
});
packages = forAllSystems ({pkgs}: {
default = pkgs.python3Packages.buildPythonApplication {
name = "keepmenu";
pname = "keepmenu";
format = "pyproject";
src = ./.;
nativeBuildInputs = builtins.attrValues {
inherit
(pkgs)
git
;
inherit
(pkgs.python3Packages)
hatchling
hatch-vcs
;
};
propagatedBuildInputs = builtins.attrValues {
inherit
(pkgs.python3Packages)
python
pykeepass
pynput
;
};
meta = {
description = "Dmenu/Rofi/Wofi frontend for Keepass databases";
homepage = "https://github.com/firecat53/keepmenu";
license = pkgs.lib.licenses.gpl3;
maintainers = ["firecat53"];
platforms = systems;
};
};
});
};
}