From 1d81b3d339cc982c9801d409127f325219f0649d Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 8 Jan 2025 22:59:47 +0530 Subject: [PATCH] feat: add --option flag Fixes #316 --- nix_update/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nix_update/__init__.py b/nix_update/__init__.py index 2ea5d54..d5d070e 100644 --- a/nix_update/__init__.py +++ b/nix_update/__init__.py @@ -114,6 +114,14 @@ def parse_args(args: list[str]) -> Options: help="Attribute of a subpackage that nix-update should try to update hashes for", default=None, ) + parser.add_argument( + "--option", + help="Nix option to set", + action="append", + nargs=2, + metavar=("name", "value"), + default=[], + ) a = parser.parse_args(args) return Options( @@ -140,6 +148,7 @@ def parse_args(args: list[str]) -> Options: generate_lockfile=a.generate_lockfile, lockfile_metadata_path=a.lockfile_metadata_path, extra_flags=(["--system", a.system] if a.system else []) + + [item for sublist in a.option for item in sublist] + ["--extra-experimental-features", "flakes nix-command"], )