-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
77 lines (75 loc) · 2.09 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 managing Bitwarden vaults.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
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
];
shellHook = ''
venvShellHook
alias bwm="python -m bwm"
'';
venvDir = "./.venv";
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*
'';
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";
};
});
packages = forAllSystems ({pkgs}: {
default = pkgs.python3Packages.buildPythonApplication {
name = "bitwarden-menu";
pname = "bitwarden-menu";
format = "pyproject";
src = ./.;
nativeBuildInputs = builtins.attrValues {
inherit
(pkgs)
git
;
inherit
(pkgs.python3Packages)
hatchling
hatch-vcs
;
};
propagatedBuildInputs = builtins.attrValues {
inherit
(pkgs.python3Packages)
python
pynput
xdg-base-dirs
;
};
meta = {
description = "Dmenu/Rofi/Wofi frontend for managing Bitwarden vaults.";
homepage = "https://github.com/firecat53/bitwarden-menu";
license = pkgs.lib.licenses.mit;
maintainers = ["firecat53"];
platforms = systems;
};
};
});
};
}