mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
add darwin-option example to readme
This commit is contained in:
parent
942d662d1e
commit
68ffdbeb37
3 changed files with 24 additions and 7 deletions
15
README.md
15
README.md
|
@ -22,6 +22,21 @@ writing defaults...
|
|||
$
|
||||
```
|
||||
|
||||
```
|
||||
$ darwin-option services.activate-system.enable ~/src/nix-darwin
|
||||
Value:
|
||||
true
|
||||
|
||||
Default:
|
||||
false
|
||||
|
||||
Example:
|
||||
no example
|
||||
|
||||
Description:
|
||||
Whether to activate system at boot time.
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
This will link the system profile to `/run/current-system`, you have to create `/run` or symlink it to `private/var/run`.
|
||||
|
|
|
@ -5,7 +5,8 @@ export PATH=@path@:$PATH
|
|||
|
||||
|
||||
showSyntax() {
|
||||
echo "$0: not implemented" >&2
|
||||
echo "$0: <option>" >&2
|
||||
exec man darwin-option
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
@ -18,7 +19,7 @@ evalAttrs() {
|
|||
}
|
||||
|
||||
evalOpt() {
|
||||
evalNix "options.$option.$@" || true
|
||||
evalNix "options.$option.$@" 2>/dev/null
|
||||
}
|
||||
|
||||
# Parse the command line.
|
||||
|
@ -39,18 +40,18 @@ done
|
|||
|
||||
if [ -z "$option" ]; then showSyntax; fi
|
||||
|
||||
if [ "$(evalOpt "_type" 2> /dev/null)" = '"option"' ]; then
|
||||
if [ "$(evalOpt "_type")" = '"option"' ]; then
|
||||
echo "Value:"
|
||||
evalOpt "value"
|
||||
evalOpt "value" || echo "no value"
|
||||
echo
|
||||
echo "Default:"
|
||||
evalOpt "default"
|
||||
evalOpt "default" || echo "no default"
|
||||
echo
|
||||
echo "Example:"
|
||||
evalOpt "example"
|
||||
evalOpt "example" || echo "no example"
|
||||
echo
|
||||
echo "Description:"
|
||||
eval printf $(evalOpt "description")
|
||||
eval printf $(evalOpt "description") || echo "no description"
|
||||
echo
|
||||
else
|
||||
eval printf $(evalAttrs "options.$option")
|
||||
|
|
|
@ -5,6 +5,7 @@ export PATH=@path@:$PATH
|
|||
|
||||
|
||||
showSyntax() {
|
||||
echo "$0: {build|switch}"
|
||||
exec man darwin-rebuild
|
||||
exit 1
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue