Compare commits

...

2 commits

Author SHA1 Message Date
392d8034e4
fix: misc 2024-02-01 09:17:18 +01:00
588288aaad
feat: ubuntu support 2024-02-01 08:32:07 +01:00
2 changed files with 55 additions and 33 deletions

View file

@ -2,55 +2,77 @@
REPO_DIR=$(dirname $(readlink -f $0)) REPO_DIR=$(dirname $(readlink -f $0))
HOME_DIR=${HOME} 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() { workspace_link() {
mkdir -p $(dirname $HOME_DIR/$2) mkdir -p $(dirname $HOME_DIR/$2)
ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true
} }
# On host we only install minimal dependencies. if [ "$OS_RELEASE" = "fedora" ]; then
# Mostly just GUI applications. # We treat fedora install as gui. Think PC, Laptop etc.
echo "==[host] Installing rpm-os tree packages" echo_header "==[host] Detected Fedora"
rpm-ostree install --idempotent --apply-live --allow-inactive -y \ # On host we only install minimal dependencies.
git git-lfs \ # Mostly just GUI applications.
kitty zsh \ echo_header "==[host] Installing rpm-os tree packages"
podman-docker \ rpm-ostree install --idempotent --apply-live --allow-inactive -y \
gphoto2 v4l2loopback ffmpeg git git-lfs \
kitty zsh \
podman-docker \
gphoto2 v4l2loopback ffmpeg \
ddcutil
echo "==[host] Installing flatpaks" echo_header "==[host] Installing flatpaks"
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y --user \ flatpak install -y --user \
com.bitwarden.desktop \ com.bitwarden.desktop \
md.obsidian.Obsidian \ md.obsidian.Obsidian \
org.mozilla.firefox \ org.mozilla.firefox \
org.mozilla.Thunderbird \ org.mozilla.Thunderbird \
org.gnome.Builder \ org.gnome.Builder \
com.vscodium.codium com.vscodium.codium
echo "==[host] Installing Nix" 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 curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
echo "==[host] Installing Home Manager"
nix-channel --add https://nixos.org/channels/nixpkgs-unstable 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-channel --update
echo_header "==[host] Installing Home Manager"
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 nix-shell '<home-manager>' -A install
workspace_link nix/home.nix .config/home-manager/home.nix
echo "==[host] Installing Home Manager packages" echo_header "==[host] Installing Home Manager packages"
workspace_link nix/home.nix .config/home-manager/home.nix
home-manager switch home-manager switch
echo "==[host] Use zsh as default shell" echo_header "==[host] Use zsh as default shell"
sudo chsh $USER --shell=/bin/zsh sudo chsh $USER --shell=/bin/zsh
echo "==[host] Plug for neovim" echo_header "==[host] Plug for neovim"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ 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' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
nvim --headless +'PlugInstall --sync' +qa
echo "==[host] Installing fonts" nvim --headless +UpdateRemotePlugins +qa
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

View file

@ -127,7 +127,7 @@ require("mason-lspconfig").setup({
"bashls", -- bash "bashls", -- bash
"bufls", -- buf "bufls", -- buf
"cssls", -- css "cssls", -- css
"denols", -- deno -- "denols", -- deno
"dockerls", -- docker "dockerls", -- docker
"docker_compose_language_service", -- docker-compose "docker_compose_language_service", -- docker-compose
"eslint", -- eslint "eslint", -- eslint