Skip to content

Commit

Permalink
Merge pull request #317 from msfjarvis/hs/extra-flags
Browse files Browse the repository at this point in the history
feat: add --option argument
  • Loading branch information
Mic92 authored Jan 20, 2025
2 parents cea66cb + 26a2459 commit 6891656
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions nix_update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,22 @@ 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)
extra_flags = ["--extra-experimental-features", "flakes nix-command"]
if a.system:
extra_flags.extend(["--system", a.system])
for name, value in a.option:
extra_flags.extend(["--option", name, value])

return Options(
import_path=os.path.realpath(a.file),
flake=a.flake,
Expand All @@ -140,8 +154,7 @@ def parse_args(args: list[str]) -> Options:
system=a.system,
generate_lockfile=a.generate_lockfile,
lockfile_metadata_path=a.lockfile_metadata_path,
extra_flags=(["--system", a.system] if a.system else [])
+ ["--extra-experimental-features", "flakes nix-command"],
extra_flags=extra_flags,
)


Expand Down

0 comments on commit 6891656

Please sign in to comment.