Re-arrange scripts; fix comments in dist-nix

This commit is contained in:
clsty
2025-10-02 23:51:59 +08:00
parent b380a77a7d
commit 98ddce24ad
17 changed files with 86 additions and 101 deletions
+19 -19
View File
@@ -16,17 +16,17 @@ handle-deprecated-dependencies(){
printf "${STY_CYAN}[$0]: Removing deprecated dependencies:${STY_RESET}\n"
for i in illogical-impulse-{microtex,pymyc-aur,ags,agsv1} {hyprutils,hyprpicker,hyprlang,hypridle,hyprland-qt-support,hyprland-qtutils,hyprlock,xdg-desktop-portal-hyprland,hyprcursor,hyprwayland-scanner,hyprland}-git;do try sudo pacman --noconfirm -Rdd $i;done
# Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages
remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf
readarray -t old_deps_list < ./cache/old_deps_stripped.conf
pacman -Qeq > ./cache/pacman_explicit_packages
readarray -t explicitly_installed < ./cache/pacman_explicit_packages
remove_bashcomments_emptylines ./dist-arch/previous_dependencies.conf ./cache/old_deps_stripped.conf
readarray -t old_deps_list < ./cache/old_deps_stripped.conf
pacman -Qeq > ./cache/pacman_explicit_packages
readarray -t explicitly_installed < ./cache/pacman_explicit_packages
echo "Attempting to set previously explicitly installed deps as implicit..."
for i in "${explicitly_installed[@]}"; do for j in "${old_deps_list[@]}"; do
[ "$i" = "$j" ] && yay -D --asdeps "$i"
done; done
echo "Attempting to set previously explicitly installed deps as implicit..."
for i in "${explicitly_installed[@]}"; do for j in "${old_deps_list[@]}"; do
[ "$i" = "$j" ] && yay -D --asdeps "$i"
done; done
return 0
return 0
}
#####################################################################################
@@ -55,16 +55,16 @@ v handle-deprecated-dependencies
# https://github.com/end-4/dots-hyprland/issues/581
# yay -Bi is kinda hit or miss, instead cd into the relevant directory and manually source and install deps
install-local-pkgbuild() {
local location=$1
local installflags=$2
local location=$1
local installflags=$2
x pushd $location
x pushd $location
source ./PKGBUILD
x yay -S $installflags --asdeps "${depends[@]}"
x makepkg -Asi --noconfirm
source ./PKGBUILD
x yay -S $installflags --asdeps "${depends[@]}"
x makepkg -Asi --noconfirm
x popd
x popd
}
# Install core dependencies from the meta-packages
@@ -76,9 +76,9 @@ metapkgs+=(./dist-arch/illogical-impulse-microtex-git)
metapkgs+=(./dist-arch/illogical-impulse-bibata-modern-classic-bin)
for i in "${metapkgs[@]}"; do
metainstallflags="--needed"
$ask && showfun install-local-pkgbuild || metainstallflags="$metainstallflags --noconfirm"
v install-local-pkgbuild "$i" "$metainstallflags"
metainstallflags="--needed"
$ask && showfun install-local-pkgbuild || metainstallflags="$metainstallflags --noconfirm"
v install-local-pkgbuild "$i" "$metainstallflags"
done
## Optional dependencies
+3 -3
View File
@@ -5,16 +5,16 @@
#
#
# TODO:
# Write a proper `flake.nix` and optionally `home.nix` and other files (under a new folder `scriptdata/iiqs-hm`) to install all dependencies that `scriptdata/install-deps-arch.sh` does. (excluding the screenlock)
# Write a proper `flake.nix` and optionally `home.nix` and other files under ./dist-nix/iiqs-hm/ to install all dependencies that `./dist-arch/install-deps.sh` does. (**excluding** the screenlock)
#
# TODO:
# In this script, i.e. `scriptdata/install-deps.nix.sh`, implement the process below:
# In this script, implement the process below:
# 1. Warning user about "this script is only experimental and must only use it at your own risks.", and prompt `y/N` (default N) before proceeding.
# 2. If nix not installed:
# 1. install nix via [DeterminateSystems/nix-installer](https://github.com/DeterminateSystems/nix-installer).
# 2. Enable nix (probably in `.zshrc` or `~/.config/fish`).
# 3. Ensure the experimental feature, Nix Flake, is enabled.
# 3. Sync (copy) `iiqs-hm` folder to `~/.config/iiqs-hm` using `rsync`.
# 3. Sync (copy) `./dist-nix/iiqs-hm/` folder to `~/.config/iiqs-hm/` using `rsync`.
# 4. Use something like `home-manager switch --flake .#iiqs` to install the dependencies.
# 5. Install screen lock using system package manager of the current distro.
# Note that this script must be idempotent.
-15
View File
@@ -1,15 +0,0 @@
# This script is meant to be sourced.
# It's not for directly running.
#####################################################################################
# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies.
showfun install-python-packages
v install-python-packages
v sudo usermod -aG video,i2c,input "$(whoami)"
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
v systemctl --user enable ydotool --now
v sudo systemctl enable bluetooth --now
v gsettings set org.gnome.desktop.interface font-name 'Rubik 11'
v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly
+8 -8
View File
@@ -1,29 +1,29 @@
#!/usr/bin/env bash
cd "$(dirname "$0")"
export base="$(pwd)"
source ./scriptdata/environment-variables.sh
source ./scriptdata/functions.sh
source ./scriptdata/package-installers.sh
source ./scriptdata/options.sh
source ./scriptdata/lib/environment-variables.sh
source ./scriptdata/lib/functions.sh
source ./scriptdata/lib/package-installers.sh
source ./scriptdata/lib/options.sh
prevent_sudo_or_root
set -e
#####################################################################################
# 0. Before we start
source ./scriptdata/0.install-greeting.sh
source ./scriptdata/step/0.install-greeting.sh
#####################################################################################
if [[ "${SKIP_ALLDEPS}" != true ]]; then
printf "${STY_CYAN}[$0]: 1. Install dependencies\n${STY_RESET}"
source ./scriptdata/1.install-deps-selector.sh
source ./scriptdata/step/1.install-deps-selector.sh
fi
#####################################################################################
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
printf "${STY_CYAN}[$0]: 2. Setup for permissions/services etc\n${STY_RESET}"
source ./scriptdata/2.install-setups-selector.sh
source ./scriptdata/step/2.install-setups-selector.sh
fi
#####################################################################################
if [[ "${SKIP_ALLFILES}" != true ]]; then
printf "${STY_CYAN}[$0]: 3. Copying config files\n${STY_RESET}"
source ./scriptdata/3.install-files.sh
source ./scriptdata/step/3.install-files.sh
fi
@@ -106,6 +106,6 @@ install-python-packages(){
# we need python 3.12 https://github.com/python-pillow/Pillow/issues/8089
x uv venv --prompt .venv $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV) -p 3.12
x source $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate
x uv pip install -r scriptdata/requirements.txt
x uv pip install -r scriptdata/uv/requirements.txt
x deactivate # We don't need the virtual environment anymore
}
-50
View File
@@ -1,50 +0,0 @@
# This file was autogenerated by uv via the following command:
# uv pip compile scriptdata/requirements.in -o scriptdata/requirements.txt
build==1.2.2.post1
# via -r scriptdata/requirements.in
cffi==1.17.1
# via pywayland
click==8.2.1
# via -r scriptdata/requirements.in
libsass==0.23.0
# via -r scriptdata/requirements.in
loguru==0.7.3
# via -r scriptdata/requirements.in
material-color-utilities==0.2.1
# via -r scriptdata/requirements.in
materialyoucolor==2.0.10
# via -r scriptdata/requirements.in
numpy==2.2.2
# via material-color-utilities
packaging==24.2
# via
# build
# setuptools-scm
pillow==11.1.0
# via
# -r scriptdata/requirements.in
# material-color-utilities
psutil==6.1.1
# via -r scriptdata/requirements.in
pycairo==1.28.0
# via
# -r scriptdata/requirements.in
# pygobject
pycparser==2.22
# via cffi
pygobject==3.52.3
# via -r scriptdata/requirements.in
pyproject-hooks==1.2.0
# via build
pywayland==0.4.18
# via -r scriptdata/requirements.in
setproctitle==1.3.4
# via -r scriptdata/requirements.in
setuptools==80.9.0
# via setuptools-scm
setuptools-scm==8.1.0
# via -r scriptdata/requirements.in
tqdm==4.67.1
# via -r scriptdata/requirements.in
wheel==0.45.1
# via -r scriptdata/requirements.in
@@ -62,7 +62,7 @@ if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
TARGET_ID=nix
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "Nix will be used to install dependencies.\n"
printf "./dist-${TARGET_ID}/install-deps.sh will be used.\n"
printf "The process is still WIP.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
@@ -16,10 +16,10 @@ export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolo
if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
TARGET_ID=nix
TARGET_ID=fallback
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "Nix will be used to do setups.\n"
printf "./dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "The process is still WIP.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
+50
View File
@@ -0,0 +1,50 @@
# This file was autogenerated by uv via the following command:
# uv pip compile scriptdata/uv/requirements.in -o scriptdata/uv/requirements.txt
build==1.2.2.post1
# via -r scriptdata/uv/requirements.in
cffi==1.17.1
# via pywayland
click==8.2.1
# via -r scriptdata/uv/requirements.in
libsass==0.23.0
# via -r scriptdata/uv/requirements.in
loguru==0.7.3
# via -r scriptdata/uv/requirements.in
material-color-utilities==0.2.1
# via -r scriptdata/uv/requirements.in
materialyoucolor==2.0.10
# via -r scriptdata/uv/requirements.in
numpy==2.2.2
# via material-color-utilities
packaging==24.2
# via
# build
# setuptools-scm
pillow==11.1.0
# via
# -r scriptdata/uv/requirements.in
# material-color-utilities
psutil==6.1.1
# via -r scriptdata/uv/requirements.in
pycairo==1.28.0
# via
# -r scriptdata/uv/requirements.in
# pygobject
pycparser==2.22
# via cffi
pygobject==3.52.3
# via -r scriptdata/uv/requirements.in
pyproject-hooks==1.2.0
# via build
pywayland==0.4.18
# via -r scriptdata/uv/requirements.in
setproctitle==1.3.4
# via -r scriptdata/uv/requirements.in
setuptools==80.9.0
# via setuptools-scm
setuptools-scm==8.1.0
# via -r scriptdata/uv/requirements.in
tqdm==4.67.1
# via -r scriptdata/uv/requirements.in
wheel==0.45.1
# via -r scriptdata/uv/requirements.in
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
cd "$(dirname "$0")"
source ./scriptdata/environment-variables.sh
source ./scriptdata/functions.sh
source ./scriptdata/lib/environment-variables.sh
source ./scriptdata/lib/functions.sh
prevent_sudo_or_root
function v() {