mirror of
https://github.com/nix-community/disko.git
synced 2024-09-11 14:35:55 +03:00
use nom-build if available
Nicer progress bars etc
This commit is contained in:
parent
a949edef70
commit
fe064a6393
10
disko
10
disko
@ -104,6 +104,14 @@ while [[ $# -gt 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
nixBuild() {
|
||||||
|
if command -v nom-build > /dev/null; then
|
||||||
|
nom-build "$@"
|
||||||
|
else
|
||||||
|
nix-build "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if ! { [[ $mode = "format" ]] || [[ $mode = "mount" ]] || [[ $mode = "disko" ]] || [[ $mode = "create" ]] || [[ $mode = "zap_create_mount" ]] ; }; then
|
if ! { [[ $mode = "format" ]] || [[ $mode = "mount" ]] || [[ $mode = "disko" ]] || [[ $mode = "create" ]] || [[ $mode = "zap_create_mount" ]] ; }; then
|
||||||
abort "mode must be either format, mount or disko"
|
abort "mode must be either format, mount or disko"
|
||||||
fi
|
fi
|
||||||
@ -131,7 +139,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# The "--impure" is still pure, as the path is within the nix store.
|
# The "--impure" is still pure, as the path is within the nix store.
|
||||||
script=$(nix-build "${libexec_dir}"/cli.nix \
|
script=$(nixBuild "${libexec_dir}"/cli.nix \
|
||||||
--no-out-link \
|
--no-out-link \
|
||||||
--impure \
|
--impure \
|
||||||
--argstr mode "$mode" \
|
--argstr mode "$mode" \
|
||||||
|
@ -139,6 +139,14 @@ cleanupMountPoint() {
|
|||||||
rmdir "${mountPoint}"
|
rmdir "${mountPoint}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nixBuild() {
|
||||||
|
if command -v nom-build > /dev/null; then
|
||||||
|
nom-build "$@"
|
||||||
|
else
|
||||||
|
nix-build "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
parseArgs "$@"
|
parseArgs "$@"
|
||||||
|
|
||||||
@ -168,7 +176,7 @@ main() {
|
|||||||
# shellcheck disable=SC2064
|
# shellcheck disable=SC2064
|
||||||
trap "cleanupMountPoint ${escapeMountPoint}" EXIT
|
trap "cleanupMountPoint ${escapeMountPoint}" EXIT
|
||||||
|
|
||||||
outputs=$(nix-build "${libexec_dir}"/install-cli.nix \
|
outputs=$(nixBuild "${libexec_dir}"/install-cli.nix \
|
||||||
"${nix_args[@]}" \
|
"${nix_args[@]}" \
|
||||||
--no-out-link \
|
--no-out-link \
|
||||||
--impure \
|
--impure \
|
||||||
|
Loading…
Reference in New Issue
Block a user