-
Notifications
You must be signed in to change notification settings - Fork 17
nix: add flake #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
nix: add flake #26
Conversation
i added a workflow file, seems like actions were not turned on for this repo -- is ci useful here? |
because we did not have a package manager for master-board before I guess |
see open-dynamic-robot-initiative/odri_control_interface#26 Signed-off-by: Gwenn Le Bihan <[email protected]>
I ran the new CI locally with act and it passes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, github somehow lost part of my review :/
flake.nix
Outdated
shellHook = '' | ||
controlSitePackages=`echo ${self'.packages.odri_control_interface}/lib/python*/site-packages | head -n 1` | ||
masterboardSitePackages=`echo ${pkgs.odri_master_board_sdk}/lib/python*/site-packages | head -n 1` | ||
export PYTHONPATH="$controlSitePackages:$masterboardSitePackages:$PYTHONPATH" | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shellHook = '' | |
controlSitePackages=`echo ${self'.packages.odri_control_interface}/lib/python*/site-packages | head -n 1` | |
masterboardSitePackages=`echo ${pkgs.odri_master_board_sdk}/lib/python*/site-packages | head -n 1` | |
export PYTHONPATH="$controlSitePackages:$masterboardSitePackages:$PYTHONPATH" | |
''; | |
PYTHONPATH = lib.concatMapStringsSep ":" (p: "${p}/${pkgs.python3.sitePackages}") [ | |
self'.packages.odri_control_interface | |
pkgs.odri_master_board_sdk | |
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or better: pkgs.python3.withPackages (_: [ self'.packages.odri_control_interface pkgs.odri_master_board_sdk ])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or better:
pkgs.python3.withPackages (_: [ self'.packages.odri_control_interface pkgs.odri_master_board_sdk ])
so as buildInputs ? i'm not sure about dropping into a python shell directly, because some python scripts require cli args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in packages
, so yes that is kind of buildInputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm unfortunately doing that doesnt seem to add the packages to PYTHONPATH. maybe the packages have to be marked as python packages for this to work? i'm leaving it at PYTHONPATH =
for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, yes, to tell nix that a derivation has a python module, we need to either define it with pkgs.python3Packages.callPackage
instead of pkgs.callPackage
(so in nixpkgs use pkgs/top-level/python-packages.nix
instead of by-name
, or in gepetto/nix put the package in py-pkgs
instead of pkgs
), or transform it into a module afterwards with pkgs.python3Packages.toPythonModule
.
therefore,
here:
pkgs.python3.withPackages (p: [
(p.toPythonModule pkgs.odri_master_board_sdk)
(p.toPythonModule self'.packages.odri_control_interface)
])
and/or in gepetto/nix:
git mv {,py-}pkgs/odri-masterboard-sdk.nix
git mv {,py-}pkgs/odri-control-interface.nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes, it is still here, but as outdated. I'll resolve those. |
a6bc629
to
82653c8
Compare
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
This reverts commit 6706d9f. Turns out that having #s in the file contents prevent -D from working... thanks C++ > WARNING: Preprocessor definitions containing '#' may not be passed on the compiler command line because many compilers do not support it. > odri-control-interface> CMake is dropping a preprocessor definition: CONFIG_TESTBENCH_YAML="robot: > odri-control-interface> interface: enp2s0 so we'll keep the files as is i guess.
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
github action does not support macos Signed-off-by: Gwenn Le Bihan <[email protected]>
Co-authored-by: Guilhem Saurel <[email protected]>
Co-authored-by: Guilhem Saurel <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Signed-off-by: Gwenn Le Bihan <[email protected]>
Description
Add a flake to build a binary using Nix
How I Tested
Do not merge before
apps
section tonix run
see also open-dynamic-robot-initiative/master-board#173
I fulfilled the following requirements