-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathflake.nix
More file actions
99 lines (89 loc) · 2.66 KB
/
flake.nix
File metadata and controls
99 lines (89 loc) · 2.66 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
{
description = "Minimal flake for benchkit";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
dream2nix.url = "github:nix-community/dream2nix";
};
outputs = {
self,
nixpkgs,
dream2nix,
}:
let
eachSystem = nixpkgs.lib.genAttrs [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
in {
packages = eachSystem (system : {
default = dream2nix.lib.evalModules {
packageSets.nixpkgs = import nixpkgs { inherit system; };
modules = [
.nix/default.nix
{
paths.lockFile = ".nix/lock.${system}.json";
paths.projectRoot = ./.;
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
];
};
});
devShells = eachSystem (system:
let
pkgs = import nixpkgs { inherit system; };
benchkit = self.packages.${system}.default;
python = benchkit.config.deps.python;
# this is empty at the moment, it should mimic the dependencies from
# .nix/default.nix@config.deps
benchkitCorePackages = [];
pythonToolingPackages = [
pkgs.pyright
python.pkgs.python-lsp-ruff
python.pkgs.numpy
python.pkgs.pip
];
formattingPackages = [
python.pkgs.flake8
pkgs.pylint
pkgs.isort
pkgs.black
pkgs.ruff
];
in {
core = pkgs.mkShell {
inputsFrom = [benchkit.devShell];
packages = benchkitCorePackages
++ pythonToolingPackages
++ formattingPackages
++ [
];
};
embedded = pkgs.mkShell {
inputsFrom = [self.devShells.${system}.core];
packages = benchkitCorePackages
++ pythonToolingPackages
++ formattingPackages
++ [
pkgs.openocd
];
};
# example of a devshell where non free software is required
# unfree = pkgs.mkShell {
# inputsFrom = [self.devShells.${system}.core];
# packages = let
# pkgs = import nixpkgs {
# inherit system;
# config.allowUnfree = true;
# };
# in benchkitCorePackages
# ++ pythonToolingPackages
# ++ formattingPackages
# ++ [];
# };
default = self.devShells.${system}.core;
});
};
}