mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
darwin: add --check flag
This commit is contained in:
parent
e4a11b2073
commit
6d91e5b565
2 changed files with 17 additions and 2 deletions
|
@ -67,8 +67,15 @@ in
|
|||
|
||||
system.activationScripts.checks.text = ''
|
||||
set +e
|
||||
|
||||
${buildUsers}
|
||||
${nixPath}
|
||||
|
||||
if test ''${checkActivation:-0} -eq 1; then
|
||||
echo "ok" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set -e
|
||||
'';
|
||||
|
||||
|
|
|
@ -52,6 +52,10 @@ while [ "$#" -gt 0 ]; do
|
|||
k="$1"; shift 1
|
||||
extraBuildFlags+=("$i" "$j" "$k")
|
||||
;;
|
||||
--check)
|
||||
action="check"
|
||||
export checkActivation=1
|
||||
;;
|
||||
--rollback)
|
||||
action="rollback"
|
||||
extraProfileFlags=("$i")
|
||||
|
@ -85,12 +89,12 @@ done
|
|||
|
||||
if [ -z "$action" ]; then showSyntax; fi
|
||||
|
||||
if [ "$action" = switch ]; then
|
||||
if [ "$action" = switch -o "$action" = check ]; then
|
||||
extraBuildFlags+=("--no-out-link")
|
||||
fi
|
||||
|
||||
echo "building the system configuration..." >&2
|
||||
if [ "$action" = switch -o "$action" = build ]; then
|
||||
if [ "$action" = switch -o "$action" = build -o "$action" = check ]; then
|
||||
systemConfig="$(nix-build '<darwin>' ${extraBuildFlags[@]} -A system)"
|
||||
fi
|
||||
|
||||
|
@ -127,3 +131,7 @@ if [ "$action" = switch -o "$action" = rollback ]; then
|
|||
$systemConfig/activate
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$action" = check ]; then
|
||||
$systemConfig/activate-user
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue