-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathflake.nix
More file actions
100 lines (93 loc) · 2.63 KB
/
flake.nix
File metadata and controls
100 lines (93 loc) · 2.63 KB
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 = "Hubble - A USB Recovery Tool for Exynos devices";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{
self,
nixpkgs,
...
}:
let
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
in
{
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree);
packages = forAllSystems (system: {
default = self.packages.${system}.hubble;
hubble = nixpkgs.legacyPackages.${system}.callPackage (
{
lib,
stdenv,
python3,
python3Packages,
autoPatchelfHook,
writeShellScriptBin,
fetchPypi,
udev,
}:
let
pkg-about-override = python3Packages.pkg-about.overrideAttrs (prev: rec {
version = "1.3.1";
src = fetchPypi {
pname = "pkg_about";
inherit version;
hash = "sha256-EyD4GS/iU31ucsBvpBkcY9SgvBX1lYxQH8vvAcW4PCY=";
};
});
libusb = python3Packages.buildPythonPackage rec {
pname = "libusb";
version = "1.0.28";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-8Ylppy6caIFiV7uhPvWD8kX+s9WS+8QuxYeWAegGUWc=";
};
dependencies = with python3Packages; [
pkg-about-override
setuptools
tox
];
nativeBuildInputs = [
autoPatchelfHook
];
buildInputs = [
udev
];
buildSystem = with python3Packages; [
setuptools
];
};
in
stdenv.mkDerivation {
name = "hubble";
installPhase = ''
install -Dm555 ${lib.getExe (
writeShellScriptBin "hubble" ''
${
lib.getExe (
python3.withPackages (
pythonPkgs: with pythonPkgs; [
coloredlogs
libusb
lz4
pygments
pyusb
]
)
)
} ${./hubble.py} $@
''
)} $out/bin/hubble
'';
dontUnpack = true;
meta.mainProgram = "hubble";
}
) { };
});
};
}