diff --git a/README.md b/README.md index 203ac5b..3fbfcd3 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,8 @@ usage: ros2nix [-h] [--extra-propagated-build-inputs DEP1,DEP2,...] [--extra-check-inputs DEP1,DEP2,...] [--extra-native-build-inputs DEP1,DEP2,...] [--flake] - [--nixfmt] [--compare] [--copyright-holder COPYRIGHT_HOLDER] - [--license LICENSE] + [--overlay | --no-overlay] [--nixfmt] [--compare] + [--copyright-holder COPYRIGHT_HOLDER] [--license LICENSE] package.xml [package.xml ...] positional arguments: @@ -159,6 +159,8 @@ options: --flake Generate top-level flake.nix instead of default.nix. Use with --fetch if some package.xml files are outside of the flake repo (default: False) + --overlay, --no-overlay + Generate overlay.nix (default: True) --nixfmt Format the resulting expressions with nixfmt (default: False) --compare Don't write any file, but check whether writing the diff --git a/ros2nix/ros2nix.py b/ros2nix/ros2nix.py index 2b44c3c..4452980 100755 --- a/ros2nix/ros2nix.py +++ b/ros2nix/ros2nix.py @@ -255,6 +255,12 @@ def ros2nix(args): help="Generate top-level flake.nix instead of default.nix. " "Use with --fetch if some package.xml files are outside of the flake repo", ) + parser.add_argument( + "--overlay", + action=argparse.BooleanOptionalAction, + default=True, + help="Generate overlay.nix", + ) parser.add_argument( "--nixfmt", action="store_true", @@ -431,7 +437,8 @@ def ros2nix(args): err("Failed to write derivation to disk!") raise e - generate_overlay(expressions, args) + if args.overlay: + generate_overlay(expressions, args) if args.flake: generate_flake(args)