Skip to content

Commit d1c4b2e

Browse files
committed
chore(nix): make vendored dependencies update-able
Previously running e.g `update-python-libraries nix/treelib` would update the vendored treelib derivation to the latest version from pypi. However it was brittle and could not get it to work in GitHub action in a stable manner. While extracting the version information, I made sure to also reworked the nix derivations to follow upstream more closely: - jefferson and unblob are applications - made the python package set an actual extension of the builtin one
1 parent 2dcd83b commit d1c4b2e

File tree

15 files changed

+1068
-91
lines changed

15 files changed

+1068
-91
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3-
exclude: ^tests/integration|\.patch$
3+
exclude: ^tests/integration|\.patch|nix/_sources$
44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
66
rev: v4.4.0

default.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let
2+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
3+
flake-compat = fetchTarball {
4+
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
5+
sha256 = lock.nodes.flake-compat.locked.narHash;
6+
};
7+
8+
src = ./.;
9+
in
10+
(import flake-compat { inherit src; }).defaultNix.legacyPackages.${builtins.currentSystem}

flake.lock

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
url = "github:onekey-sec/sasquatch";
1616
inputs.nixpkgs.follows = "nixpkgs";
1717
};
18+
inputs.flake-compat = {
19+
url = "github:edolstra/flake-compat";
20+
flake = false;
21+
};
1822

19-
outputs = { self, nixpkgs, filter, unblob-native, pyperscan, sasquatch }:
23+
outputs = { self, nixpkgs, filter, unblob-native, pyperscan, sasquatch, ... }:
2024
let
2125
# System types to support.
2226
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];

nix/_sources/generated.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"jefferson": {
3+
"cargoLocks": null,
4+
"date": null,
5+
"extract": null,
6+
"name": "jefferson",
7+
"passthru": null,
8+
"pinned": false,
9+
"src": {
10+
"name": null,
11+
"sha256": "sha256-RHEXbKRQWTyPWIzSRLwW82u/TsDgiL7L5o+cUWgLLk0=",
12+
"type": "url",
13+
"url": "https://pypi.org/packages/source/j/jefferson/jefferson-0.4.4.tar.gz"
14+
},
15+
"version": "0.4.4"
16+
},
17+
"lzallright": {
18+
"cargoLocks": {
19+
"Cargo.lock": [
20+
"./lzallright-v0.2.2/Cargo.lock",
21+
{}
22+
]
23+
},
24+
"date": null,
25+
"extract": null,
26+
"name": "lzallright",
27+
"passthru": null,
28+
"pinned": false,
29+
"src": {
30+
"deepClone": false,
31+
"fetchSubmodules": false,
32+
"leaveDotGit": false,
33+
"name": null,
34+
"owner": "vlaci",
35+
"repo": "lzallright",
36+
"rev": "v0.2.2",
37+
"sha256": "sha256-MOTIUC/G92tB2ZOp3OzgKq3d9zGN6bfv83vXOK3deFI=",
38+
"type": "github"
39+
},
40+
"version": "v0.2.2"
41+
},
42+
"treelib": {
43+
"cargoLocks": null,
44+
"date": null,
45+
"extract": null,
46+
"name": "treelib",
47+
"passthru": null,
48+
"pinned": false,
49+
"src": {
50+
"name": null,
51+
"sha256": "sha256-HL//stK3XMrCfQIAzuBQe2+7Bybgr7n64Bet5dLOh4g=",
52+
"type": "url",
53+
"url": "https://pypi.org/packages/source/t/treelib/treelib-1.6.1.tar.gz"
54+
},
55+
"version": "1.6.1"
56+
},
57+
"ubi_reader": {
58+
"cargoLocks": null,
59+
"date": null,
60+
"extract": null,
61+
"name": "ubi_reader",
62+
"passthru": null,
63+
"pinned": false,
64+
"src": {
65+
"name": null,
66+
"sha256": "sha256-b6Jp8xB6jie35F/oLEea1RF+F8J64AiiQE3/ufwu1mE=",
67+
"type": "url",
68+
"url": "https://pypi.org/packages/source/u/ubi_reader/ubi_reader-0.8.9.tar.gz"
69+
},
70+
"version": "0.8.9"
71+
}
72+
}

nix/_sources/generated.nix

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This file was generated by nvfetcher, please do not modify it manually.
2+
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
3+
{
4+
jefferson = {
5+
pname = "jefferson";
6+
version = "0.4.4";
7+
src = fetchurl {
8+
url = "https://pypi.org/packages/source/j/jefferson/jefferson-0.4.4.tar.gz";
9+
sha256 = "sha256-RHEXbKRQWTyPWIzSRLwW82u/TsDgiL7L5o+cUWgLLk0=";
10+
};
11+
};
12+
lzallright = {
13+
pname = "lzallright";
14+
version = "v0.2.2";
15+
src = fetchFromGitHub {
16+
owner = "vlaci";
17+
repo = "lzallright";
18+
rev = "v0.2.3";
19+
fetchSubmodules = false;
20+
sha256 = "sha256-MOTIUC/G92tB2ZOp3OzgKq3d9zGN6bfv83vXOK3deFI=";
21+
};
22+
cargoLock."Cargo.lock" = {
23+
lockFile = ./lzallright-v0.2.2/Cargo.lock;
24+
outputHashes = { };
25+
};
26+
};
27+
treelib = {
28+
pname = "treelib";
29+
version = "1.6.1";
30+
src = fetchurl {
31+
url = "https://pypi.org/packages/source/t/treelib/treelib-1.6.1.tar.gz";
32+
sha256 = "sha256-HL//stK3XMrCfQIAzuBQe2+7Bybgr7n64Bet5dLOh4g=";
33+
};
34+
};
35+
ubi_reader = {
36+
pname = "ubi_reader";
37+
version = "0.8.9";
38+
src = fetchurl {
39+
url = "https://pypi.org/packages/source/u/ubi_reader/ubi_reader-0.8.9.tar.gz";
40+
sha256 = "sha256-b6Jp8xB6jie35F/oLEea1RF+F8J64AiiQE3/ufwu1mE=";
41+
};
42+
};
43+
}

0 commit comments

Comments
 (0)