Properly mantain Arch Linux, new script, and fastest mirror selector
This commit is contained in:
@@ -19,6 +19,12 @@ curl -L https://raw.githubusercontent.com/TrudeEH/dotfiles/main/install.sh | bas
|
|||||||
- `update` Update Nix and the OS.
|
- `update` Update Nix and the OS.
|
||||||
- `reload` Rebuild the config after changing it.
|
- `reload` Rebuild the config after changing it.
|
||||||
|
|
||||||
|
## Scripts
|
||||||
|
- `archinstall` Install Arch Linux from the liveCD.
|
||||||
|
```sh
|
||||||
|
curl -L https://raw.githubusercontent.com/TrudeEH/dotfiles/main/scripts/archinstall.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
## Supported distros
|
## Supported distros
|
||||||
- Debian
|
- Debian
|
||||||
- Fedora Workstation
|
- Fedora Workstation
|
||||||
|
|||||||
15
home.nix
15
home.nix
@@ -89,12 +89,17 @@
|
|||||||
echo "Updating Arch..."
|
echo "Updating Arch..."
|
||||||
sudo pacman -Syu
|
sudo pacman -Syu
|
||||||
sudo pacman -Rsn $(pacman -Qdtq)
|
sudo pacman -Rsn $(pacman -Qdtq)
|
||||||
if p c pacman-contrib &>/dev/null; then
|
echo "Selecting the fastest mirrors..."
|
||||||
paccache -rk1
|
if [ ! "$(command -v reflector)" ]; then
|
||||||
else
|
sudo pacman -Syu --noconfirm reflector
|
||||||
sudo pacman -S pacman-contrib
|
|
||||||
paccache -rk1
|
|
||||||
fi
|
fi
|
||||||
|
reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
|
||||||
|
echo "Cleaning pacman cache..."
|
||||||
|
if [ ! "$(command -v paccache)" ]; then
|
||||||
|
sudo pacman -Syu --noconfirm pacman-contrib
|
||||||
|
fi
|
||||||
|
paccache -rk1
|
||||||
|
echo "Cleaning old logs..."
|
||||||
sudo journalctl --vacuum-time=7d
|
sudo journalctl --vacuum-time=7d
|
||||||
elif [ "$(grep -Ei 'fedora' /etc/*release)" ]; then
|
elif [ "$(grep -Ei 'fedora' /etc/*release)" ]; then
|
||||||
echo "Updating Fedora..."
|
echo "Updating Fedora..."
|
||||||
|
|||||||
10
scripts/archInstall.sh
Normal file
10
scripts/archInstall.sh
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Script to install Arch Linux from the liveCD.
|
||||||
|
|
||||||
|
echo "[+] Installing dependencies..."
|
||||||
|
pacman -Sy --noconfirm curl reflector archlinux-keyring
|
||||||
|
|
||||||
|
echo "[+] Selecting the fastest mirrors..."
|
||||||
|
reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
archinstall
|
||||||
Reference in New Issue
Block a user