Update 'nixconf.sh'

This commit is contained in:
MK 2023-02-12 10:15:11 +01:00
parent cf0c4e5a69
commit bbca2cc73a

View file

@ -1,23 +1,27 @@
#!/bin/bash #!/bin/bash
#nix-shell -p git #nix-shell -p git
echo "replacing config" echo "=================================================="
echo "replacing config"
echo "=================================================="
cd /etc/nixos/ cd /etc/nixos/
rm configuration.nix rm configuration.nix
git clone https://dev.spittank.org/MK/NixConfig.git git clone https://dev.spittank.org/MK/NixConfig.git
cp /etc/nixos/NixConfig/configuration.nix /etc/nixos/ cp /etc/nixos/NixConfig/configuration.nix /etc/nixos/
rm -r /etc/nixos/NixConfig/ rm -r /etc/nixos/NixConfig/
#read -p "name the device number" number echo "=================================================="
#echo "$number" >> configuration.nix read -p "name the device number" number
echo "generating config" sed -i "s/nixoslaptop/nixoslaptop$number/g" configuration.nix
echo "=================================================="
echo "generating config"
echo "=================================================="
nixos-rebuild switch nixos-rebuild switch
echo "=================================================="
while true; do while true; do
read -p "reboot?" yn read -p "reboot?" yn
case $yn in case $yn in
[Yy]* ) reboot;; [Yy]* ) reboot;;
[Nn]* ) exit;; [Nn]* ) exit;;
* ) echo "Please answer yes or no";; * ) echo "Please answer yes or no";;
esac esac
done done