1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00

installer: ask to edit configuration before installing

This is skipped when stdin is not a tty, unlike the other interactive
parts that look at stdout.
This commit is contained in:
Daiderd Jordan 2018-01-14 19:08:02 +01:00
parent d31dbefca7
commit ac238d0323
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -45,6 +45,17 @@ stdenv.mkDerivation {
echo "copying example configuration.nix" >&2
mkdir -p "$HOME/.nixpkgs"
cp "${toString ../../modules/examples/simple.nix}" "$config"
# Skip when stdin is not a tty, eg.
# $ yes | darwin-installer
if test -t 0; then
read -p "Would you like edit the default configuration.nix before starting? [y/n] " i
fi
case "$i" in
e|E)
$EDITOR "$config"
;;
esac
fi
export NIX_PATH=${nixPath}