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:
parent
d31dbefca7
commit
ac238d0323
1 changed files with 11 additions and 0 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Reference in a new issue