mirror of
https://github.com/mentos1386/dotfiles.git
synced 2024-11-25 16:55:43 +00:00
feat: ubuntu support
This commit is contained in:
parent
91960cfc78
commit
588288aaad
1 changed files with 52 additions and 32 deletions
68
install.sh
68
install.sh
|
@ -2,22 +2,33 @@
|
|||
|
||||
REPO_DIR=$(dirname $(readlink -f $0))
|
||||
HOME_DIR=${HOME}
|
||||
OS_RELEASE=$(cat /etc/os-release | grep -E "^ID=" | cut -d= -f2)
|
||||
|
||||
echo_header() {
|
||||
bold=$(tput bold)
|
||||
normal=$(tput sgr0)
|
||||
red=$(tput setaf 1)
|
||||
echo "${bold}${red}$1${normal}"
|
||||
}
|
||||
|
||||
workspace_link() {
|
||||
mkdir -p $(dirname $HOME_DIR/$2)
|
||||
ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true
|
||||
}
|
||||
|
||||
if [ "$OS_RELEASE" = "fedora" ]; then
|
||||
# We treat fedora install as gui. Think PC, Laptop etc.
|
||||
echo_header "==[host] Detected Fedora"
|
||||
# On host we only install minimal dependencies.
|
||||
# Mostly just GUI applications.
|
||||
echo "==[host] Installing rpm-os tree packages"
|
||||
echo_header "==[host] Installing rpm-os tree packages"
|
||||
rpm-ostree install --idempotent --apply-live --allow-inactive -y \
|
||||
git git-lfs \
|
||||
kitty zsh \
|
||||
podman-docker \
|
||||
gphoto2 v4l2loopback ffmpeg
|
||||
|
||||
echo "==[host] Installing flatpaks"
|
||||
echo_header "==[host] Installing flatpaks"
|
||||
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install -y --user \
|
||||
com.bitwarden.desktop \
|
||||
|
@ -27,30 +38,39 @@ flatpak install -y --user \
|
|||
org.gnome.Builder \
|
||||
com.vscodium.codium
|
||||
|
||||
echo "==[host] Installing Nix"
|
||||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
|
||||
|
||||
echo "==[host] Installing Home Manager"
|
||||
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
nix-channel --update
|
||||
|
||||
nix-shell '<home-manager>' -A install
|
||||
workspace_link nix/home.nix .config/home-manager/home.nix
|
||||
|
||||
echo "==[host] Installing Home Manager packages"
|
||||
home-manager switch
|
||||
|
||||
echo "==[host] Use zsh as default shell"
|
||||
sudo chsh $USER --shell=/bin/zsh
|
||||
|
||||
echo "==[host] Plug for neovim"
|
||||
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
|
||||
echo "==[host] Installing fonts"
|
||||
echo_header "==[host] Installing fonts"
|
||||
HOME_FONTS_DIR="${HOME_DIR}/.local/share/fonts"
|
||||
mkdir -p ${HOME_FONTS_DIR}
|
||||
rm -rf ${HOME_FONTS_DIR}/dotfiles-fonts
|
||||
git clone --depth 1 git@github.com:mentos1386/dotfiles-fonts.git ${HOME_FONTS_DIR}/dotfiles-fonts
|
||||
fc-cache
|
||||
elif [ "$OS_RELEASE" = "ubuntu" ]; then
|
||||
# We treat ubuntu install as non gui. Think WSL, VM etc.
|
||||
echo_header "==[host] Detected Ubuntu"
|
||||
sudo apt update
|
||||
sudo apt install -y \
|
||||
git git-lfs zsh
|
||||
fi
|
||||
|
||||
echo_header "==[host] Installing Nix"
|
||||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
|
||||
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
|
||||
nix-channel --update
|
||||
|
||||
echo_header "==[host] Installing Home Manager"
|
||||
workspace_link nix/home.nix .config/home-manager/home.nix
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
nix-channel --update
|
||||
nix-shell '<home-manager>' -A install
|
||||
|
||||
echo_header "==[host] Installing Home Manager packages"
|
||||
home-manager switch
|
||||
|
||||
echo_header "==[host] Use zsh as default shell"
|
||||
sudo chsh $USER --shell=/bin/zsh
|
||||
|
||||
echo_header "==[host] Plug for neovim"
|
||||
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
nvim --headless +'PlugInstall --sync' +qa
|
||||
nvim --headless +UpdateRemotePlugins +qa
|
||||
|
|
Loading…
Reference in a new issue