Skip to content
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

rosdep produces error with nix flake check #520

Open
Guelakais opened this issue Oct 28, 2024 · 1 comment
Open

rosdep produces error with nix flake check #520

Guelakais opened this issue Oct 28, 2024 · 1 comment

Comments

@Guelakais
Copy link

nix flake check                                                                                                                                                                              28.10.2024 12:18:21
warning: ignoring untrusted substituter 'https://ros.cachix.org', you are not a trusted user.
Run `man nix.conf` for more information on the `substituters` configuration option.
warning: ignoring the client-specified setting 'trusted-public-keys', because it is a restricted setting and you are not a trusted user
error:
       … while checking flake output 'devShells'
         at /nix/store/qkig73szmrhgp0qhncxy5vb36lw2g3jj-source/lib.nix:39:17:
           38|               {
           39|                 ${key} = (attrs.${key} or { })
             |                 ^
           40|                   // { ${system} = ret.${key}; };while checking the derivation 'devShells.x86_64-linux.default'
         at /nix/store/aic4p2xr91i2sxfzmy321zc42x3sc28f-source/flake.nix:14:9:
           13|       in {
           14|         devShells.default = pkgs.mkShell {
             |         ^
           15|           name = "Example project";

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'rosdep' missing
       at /nix/store/aic4p2xr91i2sxfzmy321zc42x3sc28f-source/flake.nix:19:13:
           18|             pkgs.cargo-ament-build
           19|             pkgs.rosdep
             |             ^
           20|             # ... other non-ROS packages
       Did you mean one of rosie or rsbep?

The corresponding flake.nix

{
  inputs = {
    nix-ros-overlay.url = "github:lopsided98/nix-ros-overlay/master";
    nixpkgs.follows = "nix-ros-overlay/nixpkgs";  # IMPORTANT!!!
  };
  outputs = { self, nix-ros-overlay, nixpkgs }:
    nix-ros-overlay.inputs.flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;
          overlays = [ nix-ros-overlay.overlays.default ];
        };
      in {
        devShells.default = pkgs.mkShell {
          name = "Example project";
          packages = [
            pkgs.colcon
            pkgs.cargo-ament-build
            pkgs.rosdep
            # ... other non-ROS packages
            (with pkgs.rosPackages.humble; buildEnv {
                paths = [
                    ros-core

                ];
            })
          ];
        };
      });
  nixConfig = {
    extra-substituters = [ "https://ros.cachix.org" ];
    extra-trusted-public-keys = [ "ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=" ];
  };
}

To be honest, I still find it difficult to understand nix mistakes.

@wentasah
Copy link
Contributor

That's because rosdep is not the top-level package. Use pkgs.python3Packages.rosdep and nix flake check will be happy.

However, you usually don't need rosdep with Nix, because all dependencies are automatically installed by Nix even without rosdep. rosdep is used when generating this overlay, so users don't need to bother with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants