diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2017-10-20 21:45:31 +0200 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2017-10-20 21:45:31 +0200 |
| commit | 6ea3f405e80224fbaf1725b6e6fb1aa5f8a1f6cf (patch) | |
| tree | ae41e83395465d8d60583c2ad487c44ca1f661a4 | |
| parent | 78d426940a1da0ccddcaf5919cedc04ebb65b778 (diff) | |
darwin-rebuild: add --list-generations flag
| -rw-r--r-- | pkgs/nix-tools/darwin-rebuild.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/pkgs/nix-tools/darwin-rebuild.sh b/pkgs/nix-tools/darwin-rebuild.sh index aaeeb2e..a54c1c2 100644 --- a/pkgs/nix-tools/darwin-rebuild.sh +++ b/pkgs/nix-tools/darwin-rebuild.sh @@ -6,10 +6,11 @@ export PATH=@path@:$PATH showSyntax() { echo "darwin-rebuild [--help] {build | switch | check | changelog}" >&2 - echo " [{--profile-name | -p} name] [{--switch-generation | -G} generation] [--rollback]" >&1 - echo " [--verbose...] [-v...] [-Q] [{--max-jobs | -j} number] [--cores number]" >&2 - echo " [--dry-run] [--keep-going] [-k] [--keep-failed] [-K] [--fallback] [--show-trace] [-I path]" >&2 - echo " [--option name value] [--arg name value] [--argstr name value]" >&2 + echo " [--list-generations] [{--profile-name | -p} name] [--rollback]" >&2 + echo " [{--switch-generation | -G} generation] [--verbose...] [-v...]" >&2 + echo " [-Q] [{--max-jobs | -j} number] [--cores number] [--dry-run]" >&1 + echo " [--keep-going] [-k] [--keep-failed] [-K] [--fallback] [--show-trace]" >&2 + echo " [-I path] [--option name value] [--arg name value] [--argstr name value]" >&2 exec man darwin-rebuild exit 1 } @@ -53,6 +54,10 @@ while [ "$#" -gt 0 ]; do k="$1"; shift 1 extraBuildFlags+=("$i" "$j" "$k") ;; + --list-generations) + action="list" + extraProfileFlags=("$i") + ;; --rollback) action="rollback" extraProfileFlags=("$i") @@ -90,12 +95,12 @@ if ! [ "$action" = build ]; then extraBuildFlags+=("--no-out-link") fi -echo "building the system configuration..." >&2 -if ! [ "$action" = rollback ]; then +if ! [ "$action" = list -o "$action" = rollback ]; then + echo "building the system configuration..." >&2 systemConfig="$(nix-build '<darwin>' ${extraBuildFlags[@]} -A system)" fi -if [ "$action" = rollback ]; then +if [ "$action" = list -o "$action" = rollback ]; then if [ "$USER" != root -a ! -w $(dirname "$profile") ]; then sudo nix-env -p $profile ${extraProfileFlags[@]} else |
