-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
100 lines (84 loc) · 2.87 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# 🍳 cookin 👩🍳
{
description = "flake for HT_CAN sym file for dbc output creation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }@inputs:
let
makePackageSet = pkgs: {
default = pkgs.ht_can_pkg;
};
ht_can_dbc_overlay = final: prev: {
ht_can_pkg = final.callPackage ./default.nix { };
};
my_overlays = [
ht_can_dbc_overlay
];
system = builtins.currentSystem;
x86_pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ self.overlays.default ];
};
arm_pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [ self.overlays.default ];
};
arch64-darwin_pkgs = import nixpkgs {
system = "aarch64-darwin";
overlays = [ self.overlays.default ];
};
x86-darwin_pkgs = import nixpkgs {
system = "x86_64-darwin";
overlays = [ self.overlays.default ];
};
packageSets = {
"x86_64-linux" = makePackageSet x86_pkgs;
"aarch64-linux" = makePackageSet arm_pkgs;
"x86_64-darwin" = makePackageSet x86-darwin_pkgs;
"aarch64-darwin" = makePackageSet arch64-darwin_pkgs;
# Add more systems as needed
};
in {
overlays.default = nixpkgs.lib.composeManyExtensions my_overlays;
packages = packageSets;
devShells.x86_64-linux.default = x86_pkgs.mkShell rec {
# Update the name to something that suites your project.
name = "nix-devshell";
packages = with x86_pkgs; [
# Development Tools
python311Packages.cantools
# ht_can_pkg
];
};
devShells.aarch64-linux.default = arm_pkgs.mkShell rec {
# Update the name to something that suites your project.
name = "nix-devshell";
packages = with arm_pkgs; [
# Development Tools
python311Packages.cantools
# ht_can_pkg
];
};
devShells.aarch64-darwin.default = arch64-darwin_pkgs.mkShell rec {
# Update the name to something that suites your project.
name = "nix-devshell";
packages = with arch64-darwin_pkgs; [
# Development Tools
#https://discourse.nixos.org/t/overriding-docheck-doesnt-work-with-python-package/14674
(python311Packages.cantools.overridePythonAttrs (_: { doCheck = false; }))
# ht_can_pkg
];
};
devShells.x86_64-darwin.default = x86-darwin_pkgs.mkShell rec {
# Update the name to something that suites your project.
name = "nix-devshell";
packages = with x86-darwin_pkgs; [
# Development Tools
(python311Packages.cantools.overridePythonAttrs (_: { doCheck = false; }))
# ht_can_pkg
];
};
};
}