mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-23 21:51:56 +00:00
Merge 1d9471a3ce
into 79eb752552
This commit is contained in:
commit
e8eb2cf8a4
|
@ -9,6 +9,9 @@ installAlacritty() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
|
||||||
;;
|
;;
|
||||||
|
nix-env)
|
||||||
|
"$PACKAGER" -iA nixpkgs.alacritty
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
|
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -15,6 +15,9 @@ install_adb() {
|
||||||
dnf|zypper)
|
dnf|zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
||||||
;;
|
;;
|
||||||
|
nix-env)
|
||||||
|
"$PACKAGER" -iA nixpkgs.android-tools
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
# Function to prompt the user for installation choice
|
# Function to prompt the user for installation choice
|
||||||
choose_installation() {
|
choose_installation() {
|
||||||
clear
|
|
||||||
printf "%b\n" "${YELLOW}Choose what to install:${RC}"
|
printf "%b\n" "${YELLOW}Choose what to install:${RC}"
|
||||||
printf "%b\n" "1. ${YELLOW}Docker${RC}"
|
printf "%b\n" "1. ${YELLOW}Docker${RC}"
|
||||||
printf "%b\n" "2. ${YELLOW}Docker Compose${RC}"
|
printf "%b\n" "2. ${YELLOW}Docker Compose${RC}"
|
||||||
|
@ -36,6 +35,11 @@ install_docker() {
|
||||||
"$ESCALATION_TOOL" systemctl enable docker
|
"$ESCALATION_TOOL" systemctl enable docker
|
||||||
"$ESCALATION_TOOL" systemctl start docker
|
"$ESCALATION_TOOL" systemctl start docker
|
||||||
;;
|
;;
|
||||||
|
nix-env)
|
||||||
|
"$PACKAGER" -iA nixpkgs.docker
|
||||||
|
"$ESCALATION_TOOL" sed -i'' -E '/^[[:space:]]*virtualisation\.docker\.enable/!b; s/^([[:space:]]*)virtualisation\.docker\.enable.*/\1virtualisation.docker.enable = true;/' "$NIXOS_CONFIG" || echo 'virtualisation.docker.enable = true;' | "$ESCALATION_TOOL" tee -a "$NIXOS_CONFIG"
|
||||||
|
"$ESCALATION_TOOL" nixos-rebuild switch
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -55,6 +59,9 @@ install_docker_compose() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose
|
||||||
;;
|
;;
|
||||||
|
nix-env)
|
||||||
|
"$PACKAGER" -iA nixpkgs.docker-compose
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -15,6 +15,8 @@ setupDWM() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" groupinstall -y "Development Tools"
|
"$ESCALATION_TOOL" "$PACKAGER" groupinstall -y "Development Tools"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel unzip flameshot lxappearance feh mate-polkit # no need to include git here as it should be already installed via "Development Tools"
|
"$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel unzip flameshot lxappearance feh mate-polkit # no need to include git here as it should be already installed via "Development Tools"
|
||||||
;;
|
;;
|
||||||
|
nix-env)
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -25,6 +25,11 @@ setup_flatpak() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak
|
||||||
;;
|
;;
|
||||||
|
nix-env)
|
||||||
|
"$PACKAGER" -iA nixpkgs.flatpak
|
||||||
|
"$ESCALATION_TOOL" sed -i'' -E '/^[[:space:]]*services\.flatpak\.enable/!b; s/^([[:space:]]*)services\.flatpak\.enable.*/\1services.flatpak.enable = true;/' "$NIXOS_CONFIG" || echo 'services.flatpak.enable = true;' | "$ESCALATION_TOOL" tee -a "$NIXOS_CONFIG"
|
||||||
|
"$ESCALATION_TOOL" nixos-rebuild switch
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
|
"$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -78,6 +78,16 @@ checkPackageManager() {
|
||||||
if command_exists "${pgm}"; then
|
if command_exists "${pgm}"; then
|
||||||
PACKAGER=${pgm}
|
PACKAGER=${pgm}
|
||||||
printf "%b\n" "${CYAN}Using ${pgm} as package manager${RC}"
|
printf "%b\n" "${CYAN}Using ${pgm} as package manager${RC}"
|
||||||
|
|
||||||
|
if [ $PACKAGER = 'nix-env' ] && [ -z "$NIXOS_CONFIG" ]; then
|
||||||
|
NIXOS_CONFIG="/etc/nixos/configuration.nix"
|
||||||
|
while [ ! -f "$NIXOS_CONFIG" ]; do
|
||||||
|
printf "%b\n" "${RED}configuration.nix not found.${RC}"
|
||||||
|
printf "%b" "${YELLOW}Enter the path manually: ${RC}"
|
||||||
|
read -r NIXOS_CONFIG
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -127,7 +137,7 @@ checkDistro() {
|
||||||
checkEnv() {
|
checkEnv() {
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkCommandRequirements "curl groups $ESCALATION_TOOL"
|
checkCommandRequirements "curl groups $ESCALATION_TOOL"
|
||||||
checkPackageManager 'nala apt-get dnf pacman zypper'
|
checkPackageManager 'nala apt-get dnf pacman zypper nix-env'
|
||||||
checkCurrentDirectoryWritable
|
checkCurrentDirectoryWritable
|
||||||
checkSuperUser
|
checkSuperUser
|
||||||
checkDistro
|
checkDistro
|
||||||
|
|
Loading…
Reference in New Issue
Block a user