update install.sh

This commit is contained in:
ponymushama 2024-07-21 17:07:49 +08:00
parent d08d4d45a4
commit 47e36412bf

View file

@ -11,7 +11,7 @@ fi
nix-shell -p git --command "git clone https://github.com/ponymushama/nixos-config.git $SCRIPT_DIR" nix-shell -p git --command "git clone https://github.com/ponymushama/nixos-config.git $SCRIPT_DIR"
# Generate hardware config for new system # Generate hardware config for new system
sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/system/hardware-configuration.nix sudo nixos-generate-config --show-hardware-config > $SCRIPT_DIR/system/hardware-configuration.nix
# Check if uefi or bios # Check if uefi or bios
if [ -d /sys/firmware/efi/efivars ]; then if [ -d /sys/firmware/efi/efivars ]; then
@ -23,9 +23,9 @@ else
fi fi
# Patch flake.nix with different username/name and remove email by default # Patch flake.nix with different username/name and remove email by default
sed -i "0,/emmet/s//$(whoami)/" $SCRIPT_DIR/flake.nix sed -i "0,/ama/s//$(whoami)/" $SCRIPT_DIR/flake.nix
sed -i "0,/Emmet/s//$(getent passwd $(whoami) | cut -d ':' -f 5 | cut -d ',' -f 1)/" $SCRIPT_DIR/flake.nix sed -i "0,/ama/s//$(getent passwd $(whoami) | cut -d ':' -f 5 | cut -d ',' -f 1)/" $SCRIPT_DIR/flake.nix
sed -i "s/emmet@librephoenix.com//" $SCRIPT_DIR/flake.nix sed -i "s/ponymushama@gmail.com//" $SCRIPT_DIR/flake.nix
sed -i "s+~/.dotfiles+$SCRIPT_DIR+g" $SCRIPT_DIR/flake.nix sed -i "s+~/.dotfiles+$SCRIPT_DIR+g" $SCRIPT_DIR/flake.nix
# Open up editor to manually edit flake.nix before install # Open up editor to manually edit flake.nix before install