forked from jrl-umi3218/mc_rtc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
81 lines (74 loc) · 2.96 KB
/
Copy pathflake.nix
File metadata and controls
81 lines (74 loc) · 2.96 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
{
description = " mc_rtc is an interface for simulated and real robotic systems suitable for real-time control";
inputs = {
mc-rtc-nix.url = "github:mc-rtc/nixpkgs";
flake-parts.follows = "mc-rtc-nix/flake-parts";
systems.follows = "mc-rtc-nix/systems";
# To override dependencies according to a commit/pull request, add them to inputs
# For example:
# mc-force-shoe-plugin.url = "github:Hugo-L3174/mc_force_shoe_plugin/pull/16/head";
# or use pull/N/merge to get the version merged with master, assuming there are no conflicts
# mc-force-shoe-plugin.flake = false;
# use true if the repository has a flake
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
{ lib, ... }:
{
systems = import inputs.systems;
imports = [
inputs.mc-rtc-nix.flakeModule
# or inputs.mc-rtc-nix.flakeModule if you don't need private repositories
{
flakoboros = {
extraPackages = [ "ninja" ];
overrideAttrs.mc-rtc = {
src = lib.cleanSource ./.;
};
# Define a custom superbuild configuration
# This will make all
overrides.mc-rtc-superbuild =
{ pkgs-prev, ... }:
let
cfg-prev = pkgs-prev.mc-rtc-superbuild.superbuildArgs;
in
{
superbuildArgs = cfg-prev // {
pname = "mc-rtc-superbuild-override";
# for example, override any runtime dependency (robots, controllers, etc)
# # extend robots
# robots = cfg-prev.robots ++ [ pkgs-final.mc-hrp4 ];
# # override controllers
# controllers = [ pkgs-final.polytopeController ];
# configs = [ "${pkgs-final.polytopeController}/lib/mc_controller/etc/mc_rtc.yaml" ];
# plugins = [ pkgs-final.mc-force-shoe-plugin ];
# observers = [ pkgs-final.mc-state-observation ];
# apps = [];
};
};
};
}
];
perSystem =
{ pkgs, ... }:
{
# define a devShell called local-superbuild with the superbuild configuration above
# you can also override attributes to add additional shell functionality
packages.default = pkgs.mc-rtc-superbuild;
devShells.default =
(pkgs.callPackage "${inputs.mc-rtc-nix}/shell.nix" {
inherit (pkgs) mc-rtc-superbuild;
}).overrideAttrs
(old: {
shellHook = ''
${old.shellHook or ""}
echo ""
echo "Welcome to the mc-rtc-superbuild devShell for local mc-rtc development!"
echo "----"
'';
});
};
}
);
}