Update dist-nix (improve install via system PM)

This commit is contained in:
clsty
2025-11-05 11:51:47 +08:00
parent a92bd67957
commit 564fd54cdb
4 changed files with 70 additions and 65 deletions
+4 -4
View File
@@ -87,7 +87,7 @@
#breeze-plus (https://github.com/mjkim0727/breeze-plus) (TODO: Not available as nixpkg) (Used in kde-material-you-colors config) #breeze-plus (https://github.com/mjkim0727/breeze-plus) (TODO: Not available as nixpkg) (Used in kde-material-you-colors config)
darkly darkly-qt5 #darkly-bin (darkly is supposed to be set as the theme for Qt apps, just have not figured out how to properly set it yet.) darkly darkly-qt5 #darkly-bin (darkly is supposed to be set as the theme for Qt apps, just have not figured out how to properly set it yet.)
eza #eza (Used in Fish config: `alias ls 'eza --icons'`) eza #eza (Used in Fish config: `alias ls 'eza --icons'`)
#fish (Install via system PM instead) #fish (Install via system PM instead; TODO: should install via nix in future when authentication problem fixed)
fontconfig #fontconfig (Basic thing) fontconfig #fontconfig (Basic thing)
kitty #kitty (Used in fuzzel, Hyprland, kdeglobals and Quickshell config; kitty config is also included as dots) kitty #kitty (Used in fuzzel, Hyprland, kdeglobals and Quickshell config; kitty config is also included as dots)
matugen #matugen-bin (Used in Quickshell) matugen #matugen-bin (Used in Quickshell)
@@ -105,7 +105,7 @@
### illogical-impulse-hyprland ### illogical-impulse-hyprland
hypridle #hypridle (Used for loginctl to lock session) hypridle #hypridle (Used for loginctl to lock session)
#hyprland (Need NixGL, included elsewhere) #hyprland (Need NixGL, included elsewhere)
#hyprlock (Should not be installed via Nix) #hyprlock (Should not be installed via Nix; TODO: should install via nix in future when authentication problem fixed)
hyprpicker #hyprpicker (Used in Hyprland and Quickshell config) hyprpicker #hyprpicker (Used in Hyprland and Quickshell config)
hyprsunset #hyprsunset (Used in Quickshell config) hyprsunset #hyprsunset (Used in Quickshell config)
#xdg-desktop-portal-hyprland (DUPLICATE) #xdg-desktop-portal-hyprland (DUPLICATE)
@@ -114,10 +114,10 @@
### illogical-impulse-kde ### illogical-impulse-kde
kdePackages.bluedevil #bluedevil (Seems not being used anywhere, maybe a part of KDE settings panel) kdePackages.bluedevil #bluedevil (Seems not being used anywhere, maybe a part of KDE settings panel)
#gnome-keyring #gnome-keyring (TODO: Install via system PM instead) (Provide executable gnome-keyring-daemon, used in Hyprland and Quickshell config) #gnome-keyring #gnome-keyring (TODO: Install via system PM instead; should install via nix in future when authentication problem fixed) (Provide executable gnome-keyring-daemon, used in Hyprland and Quickshell config)
networkmanager #networkmanager networkmanager #networkmanager
kdePackages.plasma-nm #plasma-nm (Seems not being used anywhere, maybe a part of KDE settings panel) kdePackages.plasma-nm #plasma-nm (Seems not being used anywhere, maybe a part of KDE settings panel)
#polkit-kde-agent (TODO: Install via system PM instead) #polkit-kde-agent (TODO: Install via system PM instead; should install via nix in future when authentication problem fixed)
kdePackages.dolphin #dolphin (Used in Hyprland and Quickshell config) kdePackages.dolphin #dolphin (Used in Hyprland and Quickshell config)
kdePackages.systemsettings #systemsettings (Used in Hyprland keybinds.conf) kdePackages.systemsettings #systemsettings (Used in Hyprland keybinds.conf)
+26 -60
View File
@@ -45,56 +45,24 @@ function install_nix(){
echo "Please install it by yourself and then retry." echo "Please install it by yourself and then retry."
return 1 return 1
} }
function install_curl(){ function install_cmds(){
local cmd=curl
if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then
local pkgs=()
for cmd in "$@";do
# For package name which is not cmd name, use "case" syntax to replace
pkgs+=($cmd)
done
x sudo pacman -Syu x sudo pacman -Syu
x sudo pacman -S --noconfirm $cmd x sudo pacman -S --noconfirm --needed "${pkgs[@]}"
elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then
x sudo apt update local pkgs=()
x sudo apt install $cmd for cmd in "$@";do
# For package name which is not cmd name, use "case" syntax to replace
pkgs+=($cmd)
done
x sudo apt update -y
x sudo apt install -y "${pkgs[@]}"
fi fi
command -v $cmd && return
echo "Failed in installing $cmd."
echo "Please install it by yourself and then retry."
return 1
}
function install_fish(){
local cmd=fish
if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then
x sudo pacman -Syu
x sudo pacman -S --noconfirm $cmd
elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then
x sudo apt update
x sudo apt install $cmd
fi
command -v $cmd && return
echo "Failed in installing $cmd."
echo "Please install it by yourself and then retry."
return 1
}
function install_swaylock(){
local cmd=swaylock
echo "Detecting command \"$cmd\"..."
command -v $cmd && return
echo "Command \"$cmd\" not found, try to install..."
if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then
x sudo pacman -Syu
x sudo pacman -S --noconfirm $cmd
elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then
x sudo apt update
x sudo apt install $cmd
fi
command -v $cmd && return
echo "Failed in installing $cmd."
echo "Please install it by yourself and then retry."
return 1
} }
function hm_deps(){ function hm_deps(){
@@ -115,21 +83,19 @@ function hm_deps(){
vianix-warning vianix-warning
if ! command -v curl >/dev/null 2>&1;then NOT_FOUND_CMDS=()
echo -e "${STY_YELLOW}[$0]: \"curl\" not found.${STY_RST}" TEST_CMDS=(curl fish swaylock gnome-keyring)
showfun install_curl for cmd in "${TEST_CMDS[@]}"; do
v install_curl if ! command -v $cmd >/dev/null 2>&1;then
fi NOT_FOUND_CMDS+=($cmd)
if ! command -v fish >/dev/null 2>&1;then fi
echo -e "${STY_YELLOW}[$0]: \"fish\" not found.${STY_RST}" done
showfun install_fish if [[ ${#NOT_FOUND_CMDS[@]} -gt 0 ]]; then
v install_fish echo -e "${STY_YELLOW}[$0]: Not found: ${NOT_FOUND_CMDS[*]}.${STY_RST}"
fi showfun install_cmds
if ! command -v swaylock >/dev/null 2>&1;then v install_cmds "${NOT_FOUND_CMDS[@]}"
echo -e "${STY_YELLOW}[$0]: \"swaylock\" not found.${STY_RST}"
showfun install_swaylock
v install_swaylock
fi fi
if ! command -v nix >/dev/null 2>&1;then if ! command -v nix >/dev/null 2>&1;then
echo -e "${STY_YELLOW}[$0]: \"nix\" not found.${STY_RST}" echo -e "${STY_YELLOW}[$0]: \"nix\" not found.${STY_RST}"
showfun install_nix showfun install_nix
+39
View File
@@ -0,0 +1,39 @@
# 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
if [[ -z $(getent group i2c) ]]; then
v sudo groupadd i2c
fi
v sudo usermod -aG video,i2c,input "$(whoami)"
if [[ ! -z $(systemctl --version) ]]; then
v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf"
# TODO: find a proper way for enable Nix installed ydotool
if ! [[ "${INSTALL_VIA_NIX}" == true ]]; then
v systemctl --user enable ydotool --now
fi
v sudo systemctl enable bluetooth --now
elif [[ ! -z $(openrc --version) ]]; then
v bash -c "echo 'modules=i2c-dev' | sudo tee -a /etc/conf.d/modules"
v sudo rc-update add modules boot
v sudo rc-update add ydotool default
v sudo rc-update add bluetooth default
x sudo rc-service ydotool start
x sudo rc-service bluetooth start
else
printf "${STY_RED}"
printf "====================INIT SYSTEM NOT FOUND====================\n"
printf "${STY_RST}"
pause
fi
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
+1 -1
View File
@@ -19,7 +19,7 @@ export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolo
if [[ "$INSTALL_VIA_NIX" == "true" ]]; then if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
TARGET_ID=fallback TARGET_ID=nix
printf "${STY_YELLOW}" printf "${STY_YELLOW}"
printf "===WARNING===\n" printf "===WARNING===\n"
printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n" printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n"