-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
77 lines (64 loc) · 1.73 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
#
# Copyright 2024, UNSW
# SPDX-License-Identifier: BSD-2-Clause
#
{
description = "A flake for building sDDF";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/24.05";
utils.url = "github:numtide/flake-utils";
zig-overlay.url = "github:mitchellh/zig-overlay";
};
outputs = { self, nixpkgs, zig-overlay, ... }@inputs: inputs.utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
]
(system:
let
pkgs = import nixpkgs {
inherit system;
};
zig = zig-overlay.packages.${system}.master;
pysdfgen = with pkgs.python312Packages;
buildPythonPackage rec {
pname = "sdfgen";
version = "0.2.0";
src = ./.;
build-system = [ setuptools ];
meta = with lib; {
homepage = "https://github.com/au-ts/microkit_sdf_gen";
maintainers = with maintainers; [ au-ts ];
};
ZIG_LOCAL_CACHE_DIR="/zig-cache-local";
ZIG_GLOBAL_CACHE_DIR="/zig-cache-global";
nativeBuildInputs = [ zig ];
};
in
{
devShells.default = pkgs.mkShell rec {
name = "dev";
nativeBuildInputs = with pkgs; [
dtc
zig
python313
sphinx
];
};
devShells.ci = pkgs.mkShell rec {
name = "ci";
pythonWithSdfgen = pkgs.python312.withPackages (ps: [
pysdfgen
ps.sphinx-rtd-theme
]);
nativeBuildInputs = with pkgs; [
dtc
zig
pythonWithSdfgen
sphinx
];
};
packages.pysdfgen = pysdfgen;
});
}