Skip to content

Commit 73eb53e

Browse files
committed
nix: use gepetto/nix and flake template
Signed-off-by: Gwenn Le Bihan <[email protected]>
1 parent fd80a9a commit 73eb53e

File tree

1 file changed

+32
-40
lines changed

1 file changed

+32
-40
lines changed

flake.nix

Lines changed: 32 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,40 @@
11
{
2-
inputs = {
3-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4-
utils.url = "github:Gepetto/nix-lib";
2+
description = "odri-controls";
53

6-
odri-masterboard-sdk = {
7-
# FIXME update after https://github.com/open-dynamic-robot-initiative/master-board/pull/173
8-
url = "git+https://github.com/gwennlbh/master-board?ref=nix&rev=d5d6105f8db1770cd07fdde300c4c008e36de818";
9-
inputs.nixpkgs.follows = "nixpkgs";
10-
};
4+
inputs = {
5+
# TODO: drop `/module` after https://github.com/Gepetto/nix/pull/54
6+
gepetto.url = "github:gwennlbh/gepetto-nix/odri";
7+
flake-parts.follows = "gepetto/flake-parts";
8+
nixpkgs.follows = "gepetto/nixpkgs";
9+
nix-ros-overlay.follows = "gepetto/nix-ros-overlay";
10+
systems.follows = "gepetto/systems";
11+
treefmt-nix.follows = "gepetto/treefmt-nix";
1112
};
1213

1314
outputs =
14-
{
15-
nixpkgs,
16-
utils,
17-
odri-masterboard-sdk,
18-
...
19-
}:
20-
let
21-
pkgs = nixpkgs.legacyPackages.x86_64-linux;
22-
sdk = odri-masterboard-sdk.packages.x86_64-linux.default;
23-
rosVersion = utils.lib.rosVersion pkgs;
24-
in
25-
{
26-
packages.x86_64-linux.default = pkgs.stdenv.mkDerivation rec {
27-
pname = "odri-control";
28-
version = rosVersion ./package.xml;
29-
30-
src = builtins.path {
31-
name = pname;
32-
path = ./.;
15+
inputs:
16+
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
17+
systems = import inputs.systems;
18+
imports = [ inputs.gepetto.flakeModule ];
19+
perSystem =
20+
{
21+
lib,
22+
pkgs,
23+
self',
24+
...
25+
}:
26+
{
27+
packages = {
28+
default = self'.packages.odri-controls;
29+
odri-controls = pkgs.odri-controls.overrideAttrs {
30+
src = lib.fileset.toSource {
31+
root = ./.;
32+
fileset = lib.fileset.unions [
33+
./odri-controls
34+
];
35+
};
36+
};
37+
};
3338
};
34-
35-
nativeBuildInputs =
36-
[ sdk ]
37-
++ (with pkgs; [
38-
cmake
39-
eigen
40-
python312Packages.eigenpy
41-
python312Packages.boost
42-
python312
43-
]);
44-
45-
propagatedBuildInputs = with pkgs; [ yaml-cpp ];
46-
};
4739
};
4840
}

0 commit comments

Comments
 (0)