From fdb019109a1e76ae9ecb86eb0c1420cfcfe1c868 Mon Sep 17 00:00:00 2001 From: James N <59348282+RandomSpaceship@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:30:43 +1000 Subject: [PATCH] nix: Separate nixGL wrapped rviz out, fix patches overlay typo --- flake.nix | 5 ++--- software/ros_ws/overlay.nix | 5 +---- software/ros_ws/patches.nix | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 6989d83..d34fab8 100644 --- a/flake.nix +++ b/flake.nix @@ -94,8 +94,7 @@ standardPkgs = { inherit (pkgs) can-utils; inherit (pkgs.ros) - natrviz - rviz2 + rviz2-fixed rosbag2 teleop-twist-keyboard demo-nodes-cpp @@ -167,7 +166,7 @@ # --- SCRIPTS --- perseus = pkgs.writeShellScriptBin "perseus" '' - ${default}/bin/ros2 pkg list + ${default}/bin/ros2 launch perseus perseus.launch.py "$@" ''; treefmt-write-config = pkgs.writeShellScriptBin "treefmt-write-config" '' cd "$(git rev-parse --show-toplevel)" diff --git a/software/ros_ws/overlay.nix b/software/ros_ws/overlay.nix index c5df1c4..32f39d2 100644 --- a/software/ros_ws/overlay.nix +++ b/software/ros_ws/overlay.nix @@ -30,12 +30,9 @@ let }; # additionally, override rviz by default to wrap it with nixGL since most people are on Ubuntu not NixOS # also provide native rviz with an alias - rviz2 = prev.writeShellScriptBin "rviz2" '' + rviz2-fixed = prev.writeShellScriptBin "rviz2-fixed" '' NIXPKGS_ALLOW_UNFREE=1 QT_QPA_PLATFORM=xcb QT_SCREEN_SCALE_FACTORS=1 nix run --impure "github:nix-community/nixGL" "${prev.lib.getExe rosPrev.rviz2}" -- "$@" ''; - natrviz = prev.writeShellScriptBin "natrviz" '' - exec "${prev.lib.getExe rosPrev.rviz2}" "$@" - ''; }) ] rosFinal rosPrev); in diff --git a/software/ros_ws/patches.nix b/software/ros_ws/patches.nix index 5a1752c..2bb66f3 100644 --- a/software/ros_ws/patches.nix +++ b/software/ros_ws/patches.nix @@ -10,7 +10,7 @@ let }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ rosPrev.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ prev.qt5.wrapQtAppsHook ]; postFixup = postFixup + ''