-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
64 lines (62 loc) · 1.93 KB
/
Copy pathflake.nix
File metadata and controls
64 lines (62 loc) · 1.93 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
{
inputs = {
nix-ros-overlay.url = "github:lopsided98/nix-ros-overlay/master";
nixpkgs.follows = "nix-ros-overlay/nixpkgs"; # IMPORTANT!!!
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nix-ros-overlay,
nixpkgs,
...
}@inputs:
nix-ros-overlay.inputs.flake-utils.lib.eachDefaultSystem (
system:
let
applyDistroOverlay =
rosOverlay: rosPackages:
rosPackages
// builtins.mapAttrs (
rosDistro: rosPkgs: if rosPkgs ? overrideScope then rosPkgs.overrideScope rosOverlay else rosPkgs
) rosPackages;
rosDistroOverlays = final: prev: {
# Apply the overlay to multiple ROS distributions
rosPackages = applyDistroOverlay (import ./overlay.nix) prev.rosPackages;
};
pkgs = import nixpkgs {
inherit system;
overlays = [
nix-ros-overlay.overlays.default
rosDistroOverlays
];
};
rosDistro = "humble";
in
{
legacyPackages = pkgs.rosPackages;
packages = builtins.intersectAttrs (import ./overlay.nix null null) pkgs.rosPackages.${rosDistro};
checks = builtins.intersectAttrs (import ./overlay.nix null null) pkgs.rosPackages.${rosDistro};
devShells.default = import ./shell.nix {
inherit pkgs rosDistro;
extraPkgs = { };
extraPaths = [ ];
};
formatter = (inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix).config.build.wrapper;
}
);
nixConfig = {
# Cache to pull ros packages from
extra-substituters = [
"https://ros.cachix.org"
"https://attic.iid.ciirc.cvut.cz/ros"
];
extra-trusted-public-keys = [
"ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo="
"ros:JR95vUYsShSqfA1VTYoFt1Nz6uXasm5QrcOsGry9f6Q="
];
};
}