Skip to content

Commit

Permalink
Merge pull request #94 from zimbatm/darwin-rebuild-edit
Browse files Browse the repository at this point in the history
darwin-rebuild edit
  • Loading branch information
LnL7 authored Aug 3, 2018
2 parents 6418523 + a25d345 commit f697095
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkgs/nix-tools/darwin-rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export PATH=@path@:$PATH


showSyntax() {
echo "darwin-rebuild [--help] {build | switch | check | changelog}" >&2
echo "darwin-rebuild [--help] {edit | build | switch | check | changelog}" >&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
Expand All @@ -28,7 +28,7 @@ while [ "$#" -gt 0 ]; do
--help)
showSyntax
;;
switch|build|changelog|check)
edit|switch|build|changelog|check)
action="$i"
;;
--show-trace|--no-build-hook|--dry-run|--keep-going|-k|--keep-failed|-K|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback|-Q)
Expand Down Expand Up @@ -146,3 +146,8 @@ if [ "$action" = check ]; then
export checkActivation=1
$systemConfig/activate-user
fi

if [ "$action" = edit ]; then
darwinConfig=$(nix-instantiate --eval --strict -E "<darwin-config>")
${EDITOR:-nano} "$darwinConfig"
fi

0 comments on commit f697095

Please sign in to comment.