Skip to content

Commit 6891656

Browse files
authored
Merge pull request #317 from msfjarvis/hs/extra-flags
feat: add --option argument
2 parents cea66cb + 26a2459 commit 6891656

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

nix_update/__init__.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,22 @@ def parse_args(args: list[str]) -> Options:
115115
help="Attribute of a subpackage that nix-update should try to update hashes for",
116116
default=None,
117117
)
118+
parser.add_argument(
119+
"--option",
120+
help="Nix option to set",
121+
action="append",
122+
nargs=2,
123+
metavar=("name", "value"),
124+
default=[],
125+
)
118126

119127
a = parser.parse_args(args)
128+
extra_flags = ["--extra-experimental-features", "flakes nix-command"]
129+
if a.system:
130+
extra_flags.extend(["--system", a.system])
131+
for name, value in a.option:
132+
extra_flags.extend(["--option", name, value])
133+
120134
return Options(
121135
import_path=os.path.realpath(a.file),
122136
flake=a.flake,
@@ -140,8 +154,7 @@ def parse_args(args: list[str]) -> Options:
140154
system=a.system,
141155
generate_lockfile=a.generate_lockfile,
142156
lockfile_metadata_path=a.lockfile_metadata_path,
143-
extra_flags=(["--system", a.system] if a.system else [])
144-
+ ["--extra-experimental-features", "flakes nix-command"],
157+
extra_flags=extra_flags,
145158
)
146159

147160

0 commit comments

Comments
 (0)