nixos-rebuild: add -F convenience flag for --flake (#464073)

This commit is contained in:
Thiago Kenji Okada
2025-11-22 23:21:29 +00:00
committed by GitHub
5 changed files with 5 additions and 4 deletions

View File

@@ -279,7 +279,7 @@ It must be one of the following:
attribute path from file specified by the *--file* option. If specified
without *--file* option, uses _default.nix_ in current directory.
*--flake* _flake-uri[#name]_
*--flake* _flake-uri[#name]_, *-F* _flake-uri[#name]_
Build the NixOS system from the specified flake. It defaults to the
directory containing the target of the symlink _/etc/nixos/flake.nix_,
if it exists. The flake must contain an output named

View File

@@ -100,6 +100,7 @@ def get_parser() -> tuple[argparse.ArgumentParser, dict[str, argparse.ArgumentPa
)
main_parser.add_argument(
"--flake",
"-F",
nargs="?",
const=True,
help="Build the NixOS system from the specified flake",

View File

@@ -51,7 +51,7 @@ _nixos-rebuild() {
# flakes options
--commit-lock-file
--flake # flake-uri
--flake -F # flake-uri
--override-input # input-name flake-uri
--recreate-lock-file
--update-input

View File

@@ -21,7 +21,7 @@
.br
.Op Fl -file | f Ar path
.Op Fl -attr | A Ar attrPath
.Op Fl -flake Ar flake-uri
.Op Fl -flake | F Ar flake-uri
.Op Fl -no-flake
.Op Fl -recreate-lock-file
.Op Fl -no-update-lock-file

View File

@@ -176,7 +176,7 @@ while [ "$#" -gt 0 ]; do
--no-ssh-tty)
noSSHTTY=1
;;
--flake)
--flake|-F)
flake="$1"
shift 1
;;