Merge branch 'main' of github.com:DannyDannyDanny/dotfiles
This commit is contained in:
commit
c23c4a5a0c
4 changed files with 99 additions and 40 deletions
54
README.md
54
README.md
|
|
@ -1,14 +1,8 @@
|
||||||
# dotfiles
|
# dotfiles
|
||||||
|
|
||||||
This repo is an extension of [dannydannydanny/methodology](https://github.com/DannyDannyDanny/methodology/)
|
[`nixos`](https://nixos.org/) + [`tmux`](https://github.com/tmux/tmux/?tab=readme-ov-file#welcome-to-tmux) + [`fish`](https://fishshell.com/) + [`neovim`](https://neovim.io/)
|
||||||
|
|
||||||
1. Debian Setup (+ customizations)
|
This repo is an extension of [dannydannydanny/methodology](https://github.com/DannyDannyDanny/methodology/)
|
||||||
* pure see [issue 3]([url](https://github.com/DannyDannyDanny/dotfiles/issues/3))
|
|
||||||
* [wsl](#wsl)
|
|
||||||
* codespaces
|
|
||||||
* github actions
|
|
||||||
2. Core Tool Chain (fish, tmux, nvim, fzf)
|
|
||||||
3. Customizations (github via ssh, ...)
|
|
||||||
|
|
||||||
## Roadmap:
|
## Roadmap:
|
||||||
|
|
||||||
|
|
@ -60,35 +54,19 @@ This repo is an extension of [dannydannydanny/methodology](https://github.com/Da
|
||||||
|
|
||||||
### WSL
|
### WSL
|
||||||
|
|
||||||
```
|
Install via [nix-community/NixOS-WSL Quickstart](https://github.com/nix-community/NixOS-WSL?tab=readme-ov-file#quick-start) :white_check_mark:
|
||||||
wsl --install --web-download -d Debian
|
Setup dotfiles / config via github:
|
||||||
# <set username>
|
```bash
|
||||||
# <set password
|
# git and github CLI tool in a temp shell
|
||||||
# debian launches automatically
|
nix-shell -p gh git
|
||||||
|
# authenticate
|
||||||
# set Debian as default (equivalent to `wsl -s Debian`)
|
gh auth login
|
||||||
wsl --set-default Debian
|
# clone dotfiles
|
||||||
|
gh repo clone dannydannydanny/dotfiles
|
||||||
# update wsl
|
# checkout the appropriate branch
|
||||||
wsl --update --web-download
|
git checkout feat/wsl-neovim-update
|
||||||
|
# rebuild system with
|
||||||
# launch debian in the home directory
|
sudo nixos-rebuild switch --flake ~/dotfiles/nixos/
|
||||||
wsl ~
|
|
||||||
|
|
||||||
# stabilize wsl.conf (so it doesn't overwrite `resolv.conf` in next step)
|
|
||||||
sudo touch /etc/wsl.conf
|
|
||||||
echo [network] | sudo tee -a /etc/wsl.conf > /dev/null
|
|
||||||
echo generateResolvConf = false | sudo tee -a /etc/wsl.conf > /dev/null
|
|
||||||
|
|
||||||
# fix WSL nameserver
|
|
||||||
echo 'nameserver 8.8.8.8' | sudo tee -a /etc/resolv.conf > /dev/null
|
|
||||||
sudo apt update && sudo apt upgrade -y
|
|
||||||
|
|
||||||
# install dependencies for dotfiles installation
|
|
||||||
sudo apt install -y git curl
|
|
||||||
|
|
||||||
# install dependencies for tmux
|
|
||||||
sudo apt install -y build-essential ncurses-dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Clone repo SSH method
|
### Clone repo SSH method
|
||||||
|
|
@ -119,6 +97,8 @@ cd dotfiles
|
||||||
git config user.name "DannyDannyDanny"
|
git config user.name "DannyDannyDanny"
|
||||||
git config user.email "dth@taiga.ai"
|
git config user.email "dth@taiga.ai"
|
||||||
git config pull.rebase false
|
git config pull.rebase false
|
||||||
|
git config push.autoSetupRemote true
|
||||||
|
# more git config: https://blog.gitbutler.com/how-git-core-devs-configure-git/
|
||||||
|
|
||||||
# install dotfiles
|
# install dotfiles
|
||||||
bash install.sh
|
bash install.sh
|
||||||
|
|
|
||||||
52
bashscripts/wsl_theme.sh
Normal file
52
bashscripts/wsl_theme.sh
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
color_scheme=$1
|
||||||
|
|
||||||
|
# write a file with the current theme here:
|
||||||
|
nvim_color_theme_path=~/.local/share/nvim_color_scheme
|
||||||
|
|
||||||
|
# validate user input
|
||||||
|
if [[ "$color_scheme" != "dark" && "$color_scheme" != "light" ]]; then
|
||||||
|
echo "Error: Color scheme must be 'dark' or 'light'" >&2
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo $color_scheme > $nvim_color_theme_path
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check that all relevant files exist
|
||||||
|
windows_username=$(powershell.exe '$env:UserName' | tr -d '\r\n')
|
||||||
|
dark_mode_config_path=~/python-projects/24_alacritty_windows_setup/gruvbox_material_medium_dark.toml
|
||||||
|
light_mode_config_path=~/python-projects/24_alacritty_windows_setup/gruvbox_material_medium_light.toml
|
||||||
|
if [ ! -f $light_mode_config_path ]; then
|
||||||
|
echo "error: light_mode_config_path missing"
|
||||||
|
echo "expected: $light_mode_config_path"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $dark_mode_config_path ]; then
|
||||||
|
echo "error: dark_mode_config_path missing"
|
||||||
|
echo "expected: $dark_mode_config_path"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
windows_alacritty_config_path="/mnt/c/Users/${windows_username}/AppData/Roaming/alacritty/alacritty.toml"
|
||||||
|
echo 'overwriting windows alacritty config'
|
||||||
|
|
||||||
|
if [ $color_scheme = 'dark' ]; then
|
||||||
|
echo "going dark"
|
||||||
|
cp $dark_mode_config_path $windows_alacritty_config_path
|
||||||
|
|
||||||
|
# explorer, browser etc
|
||||||
|
powershell.exe -Command "Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0"
|
||||||
|
# taskbar and start menu
|
||||||
|
powershell.exe -Command "Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $color_scheme = 'light' ]; then
|
||||||
|
echo "going light"
|
||||||
|
cp $light_mode_config_path $windows_alacritty_config_path
|
||||||
|
|
||||||
|
# explorer, browser etc
|
||||||
|
powershell.exe -Command "Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 1"
|
||||||
|
# taskbar and start menu
|
||||||
|
powershell.exe -Command "Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
@ -3,11 +3,13 @@
|
||||||
{
|
{
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
shellAliases = {
|
||||||
|
theme = "bash ~/dotfiles/bashscripts/wsl_theme.sh";
|
||||||
|
};
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
fish_vi_key_bindings
|
fish_vi_key_bindings
|
||||||
set fish_greeting 🐟: (set_color yellow; date +%T; set_color green; date --iso-8601; set_color normal)
|
set fish_greeting 🐟: (set_color yellow; date +%T; set_color green; date --iso-8601; set_color normal)
|
||||||
|
|
||||||
|
|
||||||
# name: Default
|
# name: Default
|
||||||
# author: Lily Ballard
|
# author: Lily Ballard
|
||||||
# edits: DannyDannyDanny
|
# edits: DannyDannyDanny
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,29 @@
|
||||||
set go=a
|
set go=a
|
||||||
set mouse=a
|
set mouse=a
|
||||||
set nohlsearch
|
set nohlsearch
|
||||||
|
let mapleader=","
|
||||||
|
|
||||||
set bg=dark
|
lua << EOF
|
||||||
" set bg=light
|
local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme'
|
||||||
|
local f=io.open(config_file, "r")
|
||||||
|
if f~=nil then
|
||||||
|
local system_theme = f:read()
|
||||||
|
-- f:close()
|
||||||
|
io.close(f)
|
||||||
|
if system_theme == 'dark' then
|
||||||
|
vim.cmd("set bg=dark")
|
||||||
|
elseif system_theme == 'light' then
|
||||||
|
vim.cmd("set bg=light")
|
||||||
|
else
|
||||||
|
print('warning: expected value "light" or "dark"')
|
||||||
|
print(' got:', system_theme)
|
||||||
|
print(' expected path:', file)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print('warning: nvim color scheme not found')
|
||||||
|
print(' expected path:', file)
|
||||||
|
end
|
||||||
|
EOF
|
||||||
|
|
||||||
colorscheme gruvbox
|
colorscheme gruvbox
|
||||||
|
|
||||||
|
|
@ -34,6 +54,9 @@
|
||||||
" Replace-all is aliased to S.
|
" Replace-all is aliased to S.
|
||||||
nnoremap S :%s//g<Left><Left>
|
nnoremap S :%s//g<Left><Left>
|
||||||
|
|
||||||
|
" save file with ,w
|
||||||
|
map <leader>w :w<cr><Space>
|
||||||
|
|
||||||
" spellcheck
|
" spellcheck
|
||||||
set spell spelllang=en_us
|
set spell spelllang=en_us
|
||||||
setlocal spell! spelllang=en_us
|
setlocal spell! spelllang=en_us
|
||||||
|
|
@ -43,6 +66,8 @@
|
||||||
packages.nix = with pkgs.vimPlugins; {
|
packages.nix = with pkgs.vimPlugins; {
|
||||||
start = [
|
start = [
|
||||||
vim-surround # shortcuts for setting () {} etc.
|
vim-surround # shortcuts for setting () {} etc.
|
||||||
|
vim-gitgutter # git diff in sign column
|
||||||
|
# vim-airline # nice and light status bar # doesn't work nicely with tmux
|
||||||
# coc-nvim coc-git coc-highlight coc-python coc-rls coc-vetur coc-vimtex coc-yaml coc-html coc-json # auto completion
|
# coc-nvim coc-git coc-highlight coc-python coc-rls coc-vetur coc-vimtex coc-yaml coc-html coc-json # auto completion
|
||||||
vim-nix # nix highlight
|
vim-nix # nix highlight
|
||||||
vimtex # latex stuff
|
vimtex # latex stuff
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue