mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 16:27:03 +00:00
darwin-rebuild edit
As a user I don't want to remember where the configuration exists. This adds a command that will point the $EDITOR to the <darwin-config> file. darwin-rebuild edit
This commit is contained in:
parent
91de10c24a
commit
a25d345a7e
1 changed files with 7 additions and 2 deletions
|
@ -5,7 +5,7 @@ export PATH=@path@:$PATH
|
||||||
|
|
||||||
|
|
||||||
showSyntax() {
|
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 " [--list-generations] [{--profile-name | -p} name] [--rollback]" >&2
|
||||||
echo " [{--switch-generation | -G} generation] [--verbose...] [-v...]" >&2
|
echo " [{--switch-generation | -G} generation] [--verbose...] [-v...]" >&2
|
||||||
echo " [-Q] [{--max-jobs | -j} number] [--cores number] [--dry-run]" >&1
|
echo " [-Q] [{--max-jobs | -j} number] [--cores number] [--dry-run]" >&1
|
||||||
|
@ -28,7 +28,7 @@ while [ "$#" -gt 0 ]; do
|
||||||
--help)
|
--help)
|
||||||
showSyntax
|
showSyntax
|
||||||
;;
|
;;
|
||||||
switch|build|changelog|check)
|
edit|switch|build|changelog|check)
|
||||||
action="$i"
|
action="$i"
|
||||||
;;
|
;;
|
||||||
--show-trace|--no-build-hook|--dry-run|--keep-going|-k|--keep-failed|-K|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback|-Q)
|
--show-trace|--no-build-hook|--dry-run|--keep-going|-k|--keep-failed|-K|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback|-Q)
|
||||||
|
@ -146,3 +146,8 @@ if [ "$action" = check ]; then
|
||||||
export checkActivation=1
|
export checkActivation=1
|
||||||
$systemConfig/activate-user
|
$systemConfig/activate-user
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$action" = edit ]; then
|
||||||
|
darwinConfig=$(nix-instantiate --eval --strict -E "<darwin-config>")
|
||||||
|
${EDITOR:-nano} "$darwinConfig"
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue