-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathdefault.nix
48 lines (41 loc) · 1.56 KB
/
default.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
# SPDX-FileCopyrightText: 2024 IObundle
#
# SPDX-License-Identifier: MIT
{ pkgs ? import <nixpkgs> {} }:
let
py2hwsw_commit = "4f92cafd667d313c15c23f61d10725f8a7a59cae"; # Replace with the desired commit.
py2hwsw_sha256 = "W3EZVcXvbUMN8LyCdn9ci48Xh3eOORgYN4sEtlYwZ6A="; # Replace with the actual SHA256 hash.
# Get local py2hwsw root from `PY2HWSW_ROOT` env variable
py2hwswRoot = builtins.getEnv "PY2HWSW_ROOT";
# For debug
disable_py2_build = 0;
py2hwsw =
if disable_py2_build == 0 then
pkgs.python3.pkgs.buildPythonPackage rec {
pname = "py2hwsw";
version = py2hwsw_commit;
src =
if py2hwswRoot != "" then
pkgs.lib.cleanSource py2hwswRoot
else
(pkgs.fetchFromGitHub {
owner = "IObundle";
repo = "py2hwsw";
rev = py2hwsw_commit;
sha256 = py2hwsw_sha256;
fetchSubmodules = true;
}).overrideAttrs (_: {
GIT_CONFIG_COUNT = 1;
GIT_CONFIG_KEY_0 = "url.https://github.com/.insteadOf";
GIT_CONFIG_VALUE_0 = "git@github.com:";
});
# Add any necessary dependencies here.
#propagatedBuildInputs = [ pkgs.python38Packages.someDependency ];
}
else
null;
in
if disable_py2_build == 0 then
import "${py2hwsw}/lib/python${builtins.substring 0 4 pkgs.python3.version}/site-packages/py2hwsw/lib/default.nix" { inherit pkgs; py2hwsw_pkg = py2hwsw; }
else
import "${py2hwswRoot}/py2hwsw/lib/default.nix" { inherit pkgs; py2hwsw_pkg = py2hwsw; }