use custom deployment configuration loop
This commit is contained in:
parent
7fbd22f8bf
commit
2ade25061f
1 changed files with 23 additions and 4 deletions
|
|
@ -16,14 +16,14 @@ while getopts ":a:r:p:u:U:f:F:hq" o; do case "${o}" in
|
||||||
F) progsfile=${OPTARG} && exclusiveprogsfile=true ;;
|
F) progsfile=${OPTARG} && exclusiveprogsfile=true ;;
|
||||||
t) targetdeployment=${OPTARG} ;;
|
t) targetdeployment=${OPTARG} ;;
|
||||||
u) targetuser=${OPTARG} ;;
|
u) targetuser=${OPTARG} ;;
|
||||||
U) targetpassword=${OPTARG} ;;
|
U) targetuser=${OPTARG} && forceuser=true ;;
|
||||||
|
p) targetpassword=${OPTARG} ;;
|
||||||
q) quietmode=true;;
|
q) quietmode=true;;
|
||||||
*) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;;
|
*) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;;
|
||||||
esac done
|
esac done
|
||||||
|
|
||||||
# DEFAULTS:
|
# DEFAULTS:
|
||||||
[ -z "$dotfilesrepo" ] && dotfilesrepo="https://gitlab.com/marty-oehme/dotfiles.git"
|
[ -z "$dotfilesrepo" ] && dotfilesrepo="https://gitlab.com/marty-oehme/dotfiles.git"
|
||||||
[ ! "$exclusiveprogsfile" ] && progsfile="$(curl -Ls https://gitlab.com/marty-oehme/dotfiles/snippets/1828258/raw | cat ) $progsfile"
|
|
||||||
[ -z "$aurhelper" ] && aurhelper="yay"
|
[ -z "$aurhelper" ] && aurhelper="yay"
|
||||||
|
|
||||||
### FUNCTIONS ###
|
### FUNCTIONS ###
|
||||||
|
|
@ -109,6 +109,16 @@ aurinstall() { \
|
||||||
sudo -u "$name" $aurhelper -S --noconfirm "$1" >/dev/null 2>&1
|
sudo -u "$name" $aurhelper -S --noconfirm "$1" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get the link to the package collection
|
||||||
|
getpackagegrouplink() {
|
||||||
|
case "$1" in
|
||||||
|
"none") pkggroup="";;
|
||||||
|
"desktop") pkggroup="https://gitlab.com/marty-oehme/dotfiles/snippets/1828258/raw" ;;
|
||||||
|
"laptop") pkggroup="https://gitlab.com/marty-oehme/dotfiles/snippets/1828258/raw" ;;
|
||||||
|
"headless") pkggroup="https://gitlab.com/marty-oehme/dotfiles/snippets/1828258/raw" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
# can be called with as many csv files filled with packages as necessary
|
# can be called with as many csv files filled with packages as necessary
|
||||||
# appends them all to one temporary file for the installation
|
# appends them all to one temporary file for the installation
|
||||||
gatherpackages() {
|
gatherpackages() {
|
||||||
|
|
@ -223,11 +233,20 @@ sed -i "s/-j2/-j$(nproc)/;s/^#MAKEFLAGS/MAKEFLAGS/" /etc/makepkg.conf
|
||||||
|
|
||||||
manualinstall $aurhelper || error "Failed to install AUR helper."
|
manualinstall $aurhelper || error "Failed to install AUR helper."
|
||||||
|
|
||||||
|
# the command that sets the correct link to gather our package files from
|
||||||
|
getpackagegrouplink $targetdeployment
|
||||||
|
|
||||||
|
# append the default packages to whatever custom package csv links were passed in or
|
||||||
|
# only use the custom packages if forced with -F
|
||||||
|
[ ! "$exclusiveprogsfile" ] && progsfile="$(curl -Ls $pkggroup | cat ) $progsfile"
|
||||||
|
|
||||||
|
# actually gather the individual package installation lines from the various links and files
|
||||||
|
gatherpackages $progsfile
|
||||||
|
|
||||||
# The command that does all the installing. Reads the progs.csv file and
|
# The command that does all the installing. Reads the progs.csv file and
|
||||||
# installs each needed program the way required. Be sure to run this only after
|
# installs each needed program the way required. Be sure to run this only after
|
||||||
# the user has been created and has priviledges to run sudo without a password
|
# the user has been created and has privileges to run sudo without a password
|
||||||
# and all build dependencies are installed.
|
# and all build dependencies are installed.
|
||||||
gatherpackages $progsfile
|
|
||||||
installationloop
|
installationloop
|
||||||
|
|
||||||
# Install the dotfiles in the user's home directory
|
# Install the dotfiles in the user's home directory
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue