Skip to content

Commit

Permalink
feat: add --option flag
Browse files Browse the repository at this point in the history
Fixes #316
  • Loading branch information
msfjarvis committed Jan 14, 2025
1 parent c2f4539 commit 1d81b3d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nix_update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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"],
)

Expand Down

0 comments on commit 1d81b3d

Please sign in to comment.