From c20fda8e0dba1c4938582d79d23597a377b5ff45 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Nov 2020 22:12:56 -0600 Subject: [PATCH 01/12] Some nixos changes --- bin/lyte-nixos-cleanup | 4 ++-- env/common/machines/laptop/sway/main | 2 ++ env/nix/modules/de/gnome.nix | 1 + env/nix/modules/de/sway.nix | 1 + env/nix/modules/users/daniel.nix | 3 ++- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/lyte-nixos-cleanup b/bin/lyte-nixos-cleanup index 5fc33cb..91a4f8c 100755 --- a/bin/lyte-nixos-cleanup +++ b/bin/lyte-nixos-cleanup @@ -1,4 +1,4 @@ #!/usr/bin/env bash -# TODO: use nix-shell because it's cool? -nix-collect-garbage -d +sudo nix-collect-garbage -d +sudo nixos-rebuild switch diff --git a/env/common/machines/laptop/sway/main b/env/common/machines/laptop/sway/main index d3fc88e..a408e6e 100644 --- a/env/common/machines/laptop/sway/main +++ b/env/common/machines/laptop/sway/main @@ -1,4 +1,6 @@ exec libinput-gestures -c $HOME/.config/lytedev-dotfiles/apps/de/libinput/sway-gestures.conf +exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK DBUS_SESSION_BUS_ADDRESS +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK DBUS_SESSION_BUS_ADDRESS bindswitch lid:toggle exec swaylock input type:keyboard { xkb_options ctrl:nocaps diff --git a/env/nix/modules/de/gnome.nix b/env/nix/modules/de/gnome.nix index 4fcb58a..02893fd 100644 --- a/env/nix/modules/de/gnome.nix +++ b/env/nix/modules/de/gnome.nix @@ -9,6 +9,7 @@ in { services = { pipewire.enable = true; xserver = { + desktopManager.gnome3.enable = true; libinput = { enable = true; tapping = true; diff --git a/env/nix/modules/de/sway.nix b/env/nix/modules/de/sway.nix index 2c2d381..832c709 100644 --- a/env/nix/modules/de/sway.nix +++ b/env/nix/modules/de/sway.nix @@ -11,6 +11,7 @@ in { sway = { enable = true; extraPackages = with pkgs; [ + unstable.pipewire swaylock swayidle unstable.mako unstable.libnotify diff --git a/env/nix/modules/users/daniel.nix b/env/nix/modules/users/daniel.nix index 85d1f28..4de9e0d 100644 --- a/env/nix/modules/users/daniel.nix +++ b/env/nix/modules/users/daniel.nix @@ -36,12 +36,13 @@ mpd # music player daemon ncmpcpp # ncurses music player client vlc # video player + google-chrome # sometimes ya gotta screenshare # TODO: work module? google-cloud-sdk # gcloud kubectl # kubernetes cli awscli # aws cli - zoom # video conferencing + zoom-us # video conferencing lastpass-cli # TODO: move this one to just laptop? From 2d279c511efa29ac38f4fbca486280b10add48a8 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Nov 2020 22:16:18 -0600 Subject: [PATCH 02/12] Have init script run the setup script --- bin/init-dotfiles | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/init-dotfiles b/bin/init-dotfiles index bfc777f..9925e40 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -58,6 +58,11 @@ setup_home_manager() { nix-shell '' -A install } +setup_dotfiles() { + cd "$daniel_home$dotfiles" + ./bin/setup-dotfiles +} + init_for_root() { clone_dotfiles "$root_home$dotfiles" symlink_nixos "$root_home$dotfiles/env/nix/" @@ -77,6 +82,7 @@ init_for_daniel() { # TODO: setup ssh/gpg keys # TODO: setup password store fix_dotfiles_origin + setup_dotfiles } if [ "$EUID" -eq 0 ]; then From 14a29db6099e8643d04223dcf3ab9c69c9592131 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Nov 2020 22:17:50 -0600 Subject: [PATCH 03/12] Add to dos --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 414752a..ab3464a 100644 --- a/readme.md +++ b/readme.md @@ -13,6 +13,8 @@ curl -s -L https://git.lyte.dev/lytedev/dotfiles/raw/branch/master/bin/init-dotf ## To Do ++ Fix sway workspaces on desktop ++ Neovim LSP + Setup `nnn` + Move to NixOS (WIP) or Guix? Declarative is the future! + Custom Iosevka font with kitty-compatible ligatures? From 9a24e6c2304fbc7def9e5fbfa223b14f2aa1f170 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Nov 2020 22:24:55 -0600 Subject: [PATCH 04/12] Add todos for init script --- bin/init-dotfiles | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/init-dotfiles b/bin/init-dotfiles index 9925e40..1166982 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -83,6 +83,8 @@ init_for_daniel() { # TODO: setup password store fix_dotfiles_origin setup_dotfiles + # TODO: fetch password store + # TODO: fetch notes database } if [ "$EUID" -eq 0 ]; then From ffc6d4074138577e143c00293e581e3b34344e78 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 00:23:20 -0600 Subject: [PATCH 05/12] Clean up neovim config --- apps/neovim/.gitignore | 7 -- apps/neovim/airline.vim | 28 ----- apps/neovim/bindings.vim | 260 --------------------------------------- apps/neovim/commands.vim | 84 ------------- apps/neovim/init.vim | 132 +++++++++++++++++--- apps/neovim/plugins.vim | 68 ---------- apps/neovim/settings.vim | 165 ------------------------- env/common/colors/vim | 4 - 8 files changed, 117 insertions(+), 631 deletions(-) delete mode 100644 apps/neovim/airline.vim delete mode 100644 apps/neovim/bindings.vim delete mode 100644 apps/neovim/commands.vim delete mode 100644 apps/neovim/plugins.vim delete mode 100644 apps/neovim/settings.vim diff --git a/apps/neovim/.gitignore b/apps/neovim/.gitignore index e705a23..0b1d95b 100644 --- a/apps/neovim/.gitignore +++ b/apps/neovim/.gitignore @@ -1,10 +1,3 @@ /* -!/scripts/ -!/ftplugin/ !/.gitignore !/init.vim -!/settings.vim -!/bindings.vim -!/plugins.vim -!/airline.vim -!/commands.vim diff --git a/apps/neovim/airline.vim b/apps/neovim/airline.vim deleted file mode 100644 index 90f63db..0000000 --- a/apps/neovim/airline.vim +++ /dev/null @@ -1,28 +0,0 @@ -let g:airline_powerline_fonts = 1 -let g:airline#extensions#tabline#enabled = 1 " automatically displays all buffers when there's only one tab open -let g:airline#extensions#tabline#fnamemod = ':t' - -let g:airline#extensions#tabline#left_sep = '' -let g:airline#extensions#tabline#left_alt_sep = '' -let g:airline_right_alt_sep = '' -let g:airline_right_sep = '' -let g:airline_left_alt_sep= '' -let g:airline_left_sep = '' -let g:airline#extensions#tabline#buffers_label = '' - -let g:airline_mode_map = { - \ '__' : '-', - \ 'n' : 'N', - \ 'i' : 'I', - \ 'R' : 'R', - \ 'T' : 'T', - \ 't' : 'T', - \ 'c' : 'C', - \ 'v' : 'V', - \ 'V' : 'V', - \ '' : 'V', - \ 's' : 'S', - \ 'S' : 'S', - \ '' : 'S', - \ } - diff --git a/apps/neovim/bindings.vim b/apps/neovim/bindings.vim deleted file mode 100644 index e979fef..0000000 --- a/apps/neovim/bindings.vim +++ /dev/null @@ -1,260 +0,0 @@ -" common typo fixes -command! WQ wq -command! Wq wq -command! Wqa wqa -command! W w -command! Q q - -" best leader -let mapleader = "\" - -" enter insert mode when entering a terminal buffer -augroup InsertModeOnBlankTerminal - autocmd BufWinEnter,WinEnter term://* startinsert -augroup END - -" terminal mappings -nnoremap t :split term://$SHELL:resize 24i -nnoremap :split term://$SHELL:resize 24i -nnoremap t :vsplit term://$SHELL:vertical resize 120i -" nnoremap :vsplit term://$SHELL:vertical resize 120i -nnoremap :vsplit term://$SHELL:vertical resize 120i - -" close the terminal -tnoremap :q! -tnoremap w :q! -" tnoremap -tnoremap - -" moving between terminal splits -tnoremap :TmuxNavigateLeft -tnoremap :TmuxNavigateDown -tnoremap :TmuxNavigateUp -tnoremap :TmuxNavigateRight - -" Jump to the next or previous line that has the same level or a lower -" level of indentation than the current line. -" -" exclusive (bool): true: Motion is exclusive -" false: Motion is inclusive -" fwd (bool): true: Go to next line -" false: Go to previous line -" lowerlevel (bool): true: Go to line with lower indentation level -" false: Go to line with the same indentation level -" skipblanks (bool): true: Skip blank lines -" false: Don't skip blank lines -function! NextIndent(exclusive, fwd, lowerlevel, skipblanks) - let line = line('.') - let column = col('.') - let lastline = line('$') - let indent = indent(line) - let stepvalue = a:fwd ? 1 : -1 - while (line > 0 && line <= lastline) - let line = line + stepvalue - if ( a:lowerlevel == 0 && indent(line) == indent || - \ a:lowerlevel == 1 && indent(line) < indent || - \ a:lowerlevel == -1 && indent(line) > indent) - if (! a:skipblanks || strlen(getline(line)) > 0) - if (a:exclusive) - let line = line - stepvalue - endif - exe line - exe 'normal ' (column+1) . '|' - return - endif - endif - endwhile -endfunction - -" moving back and forth between lines of same or lower indentation should be sane -nnoremap [l :call NextIndent(0, 0, 0, 1) -nnoremap ]l :call NextIndent(0, 1, 0, 1) -nnoremap [L :call NextIndent(0, 0, 1, 1) -nnoremap ]L :call NextIndent(0, 1, 1, 1) -nnoremap [ :call NextIndent(0, 0, -1, 1) -nnoremap ] :call NextIndent(0, 1, -1, 1) -vnoremap [l :call NextIndent(0, 0, 0, 1)m'gv'' -vnoremap ]l :call NextIndent(0, 1, 0, 1)m'gv'' -vnoremap [L :call NextIndent(0, 0, 1, 1)m'gv'' -vnoremap ]L :call NextIndent(0, 1, 1, 1)m'gv'' -onoremap [l :call NextIndent(0, 0, 0, 1) -onoremap ]l :call NextIndent(0, 1, 0, 1) -onoremap [L :call NextIndent(1, 0, 1, 1) -onoremap ]L :call NextIndent(1, 1, 1, 1) - -" run make with leader,m -nnoremap m :call RunMake() - -" NERDTree bindings -" show file manager in current directory -nnoremap :NERDTreeToggle -" show file manager in git repo root -nnoremap n :call NERDProjectViewer() -" focus the current file in NERDTree -nnoremap gn :NERDTreeFind - -" don't kill vim -" REBIND -nnoremap K -nnoremap - -" quick paragraph formatting -vmap Q gq -nmap Q gqap - -" launch fzf for the current git repo -nnoremap :GitFiles - -" launch fzf for files in the current directory -nnoremap :Files - -" launch fzf for files modified or not in git -nnoremap :GFiles? - -" launch fzf for open buffers (files) -nnoremap :Buffers - -" launch fzf for open buffers (files) -nnoremap l :Buffers - -if has("nvim") - au FileType fzf tnoremap -endif - -" switch to previous buffer -nnoremap h :b# - -" use leader j and k to switch buffers as well -nnoremap k :bnext -nnoremap j :bprevious - -" window/pane navigation -nnoremap :TmuxNavigateLeft -nnoremap :TmuxNavigateDown -nnoremap :TmuxNavigateUp -nnoremap :TmuxNavigateRight - -if has('nvim') - nnoremap r :source $vimdir/init.vim -else - nnoremap r :source $HOME/.vimrc -endif - -" change buffers with leader,tab -nnoremap :bnext -nnoremap :bprevious - -" fast word change -nnoremap c ciw -nnoremap C ciW - -" fast splits -nnoremap s :split -nnoremap v :vsplit - -" fast split closing -nnoremap q q - -" fast force quit -nnoremap Q :qall! - -" clear search higlight -nnoremap / :let @/ = "": - -" remap jk/jj and its variants to escape -inoremap jj -inoremap Jj -inoremap Jj -inoremap JJ -inoremap jk -inoremap Jk -inoremap jK -inoremap JK - -" use hjkl-movement between rows when soft wrapping: -nnoremap j gj -nnoremap k gk -vnoremap j gj -vnoremap k gk - -" camel case motions -map ,w CamelCaseMotion_w -map ,b CamelCaseMotion_b -map ,e CamelCaseMotion_e -map ,ge CamelCaseMotion_ge - -" inner _ objects -omap ib CamelCaseMotion_ib -xmap ib CamelCaseMotion_ib -omap ie CamelCaseMotion_ie -xmap ie CamelCaseMotion_ie - -" remove trailing whitespace -map mw:%s/\s\+$//:let @/ = ""'w - -" close buffer with leader-w -nnoremap w :bd - -" toggle spell checking: -map :setlocal spell! - -" open urls, files, etc. example: http://google.com: -noremap o :!xdg-open - -" insert newline -" NOTE: doesn't work in terminals? -" noremap i -" noremap i - -" prevent wildmenu -map q: :q -noremap qqq: q: - -" sane n/N behavior -nnoremap n 'Nn'[v:searchforward] -nnoremap N 'nN'[v:searchforward] - -" better command history navigation -cnoremap -cnoremap - -" keep selection after indenting visual selection -xnoremap < >gv - -" distraction-free mode -nnoremap df :DistractionFreeMode - -" recalc syntax highlighting -nnoremap gs :syntax sync fromstart - -" lsp bindings - -" coc - -" open coc config -nnoremap c :CocConfig - -" smart jumps -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -nmap g[ (coc-diagnostic-prev) -nmap g] (coc-diagnostic-next) - -nmap ac (coc-codeaction) -nmap qf (coc-fix-current) -nmap f (coc-format) -vmap f (coc-format-selected) - -" ale - -" go to definitions -" nnoremap gd :ALEGoToDefinition -" nnoremap gh :ALEGoToDefinitionInSplit -" nnoremap gv :ALEGoToDefinitionInVSplit - -" misc plugins -nmap aa :%ArrangeColumn! diff --git a/apps/neovim/commands.vim b/apps/neovim/commands.vim deleted file mode 100644 index 395db29..0000000 --- a/apps/neovim/commands.vim +++ /dev/null @@ -1,84 +0,0 @@ -" TODO: need a way to toggle this and maybe make it on by default except in -" files where space indentation is expected -fun! ShowSpaceIndentation() - hi LeadingWhiteSpaces ctermfg=black ctermbg=8 -endfunction -fun! HideSpaceIndentation() - hi LeadingWhiteSpaces ctermfg=black ctermbg=black -endfunction -hi LeadingWhiteSpaces ctermfg=black ctermbg=black - -:command! SpaceIndents call ShowSpaceIndentation() -:command! ShowSpaceIndents call ShowSpaceIndentation() -:command! HideSpaceIndents call HideSpaceIndentation() - -" jump to last opened position in file except in git commits -let jump_to_pos_blacklist = ['gitcommit'] -if has("autocmd") - au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") && index(jump_to_pos_blacklist, &ft) | exe "normal! g'\"" | endif -endif - -" make any necessary directories in the path when saving a file -fun! AutoMakeDirectory() - let s:directory = expand(":p:h") - if !isdirectory(s:directory) - call mkdir(s:directory, "p") - endif -endfun -autocmd BufWritePre,FileWritePre * :call AutoMakeDirectory() - -" run make from vim smartly -if !exists("g:make_args") - let g:make_args="default" -endif -fun! RunMake() - split - if has('nvim') - " run from the root of the current git repository - let path = system("git rev-parse --show-toplevel | tr -d '\\n'") - " TODO: handle non-git situations - execute 'terminal cd ' . path . ' && make ' . g:make_args - startinsert - else - execute '!make ' . g:make_args - endif -endfun - -" kill the terminal buffer when the process exits -autocmd TermClose * call feedkeys('') - -fun! NERDProjectViewer() - let path = system("git rev-parse --show-toplevel | tr -d '\\n'") - execute 'NERDTree' path -endfun - -" a toggle-able minimalistic distraction-free text editing mode -let s:distractionFreeMode = 0 -fun! DistractionFreeModeFunc() - if s:distractionFreeMode == 0 - let s:distractionFreeMode = 1 - AirlineToggle - Goyo - else - let s:distractionFreeMode = 0 - Goyo! - AirlineToggle - AirlineRefresh - endif -endfunction - -" prevents normal window navigation and closing while in DistractionFreeMode -fun! CheckCloseDistractionFreeMode() - if s:distractionFreeMode == 1 - call DistractionFreeModeFunc() - endif -endfunction - -" run the previous checking function every time we leave a window -if has('autocmd') - " autocmd WinLeave * call CheckCloseDistractionFreeMode() -endif - -" AddTabularPattern! ssv /\s/r0c0l0 - -command! DistractionFreeMode call DistractionFreeModeFunc() diff --git a/apps/neovim/init.vim b/apps/neovim/init.vim index 84651a1..b7cfd4b 100644 --- a/apps/neovim/init.vim +++ b/apps/neovim/init.vim @@ -1,28 +1,130 @@ scriptencoding utf-8 set fileencoding=utf8 -let $vimdir = $HOME.'/.vim' -if has('nvim') - let $vimdir = $XDG_CONFIG_HOME.'/nvim' +let $vimdir = $XDG_CONFIG_HOME.'/nvim' + +if empty(glob($vimdir.'/autoload/plug.vim')) + silent !curl -fLo $vimdir/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $vimdir.'init.vim' endif -if filereadable("$ENV_PATH/vim") - source "$ENV_PATH/vim" -endif +let g:indent_guide_auto_colors = 1 +let g:indent_guides_enable_on_vim_startup = 1 +let g:prosession_dir = $vimdir."/session/" +let g:jsonnet_fmt_on_save = 0 -call plug#begin($vimdir.'/bundle') -source $vimdir/plugins.vim -source $vimdir/airline.vim +call plug#begin($vimdir.'/plugged') + Plug 'junegunn/vim-plug' " plugin manager should manage itself + Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } + Plug 'junegunn/fzf.vim' " helpers for using fzf in vim + Plug 'nathanaelkane/vim-indent-guides' " indentation guides + Plug 'bkad/CamelCaseMotion' " camel case and underscore word movements + Plug 'vim-scripts/LargeFile' " gracefully handle very large files + Plug 'tpope/vim-commentary' " toggle comments in code easily + Plug 'tpope/vim-repeat' " better vim repeating for plugin-provided actions + Plug 'christoomey/vim-tmux-navigator' " allow window navigation to play nicely with tmux + Plug 'machakann/vim-sandwich' " quickly modify text surrounding objects + Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object + Plug 'wellle/targets.vim' " adds some more handy text objects + Plug 'junegunn/goyo.vim' " better distraction-free editing + Plug 'tpope/vim-sleuth' " try and detect indent method + Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings + Plug 'google/vim-jsonnet', {'for': ['jsonnet', 'libsonnet']} + Plug 'calviken/vim-gdscript3', {'for': ['gdscript']} call plug#end() filetype on filetype indent on filetype plugin on -source $vimdir/settings.vim -source $vimdir/commands.vim -source $vimdir/bindings.vim +" use :h option-list if you need to know what these do +set encoding=utf8 +set tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab +set autoindent smartindent +set list nostartofline listchars=trail:·,tab:\ \ ,trail:~ +set linebreak formatoptions=crql1jn " TODO: anything else useful? :h fo-table +set synmaxcol=200 +set lazyredraw +set scrolloff=8 sidescrolloff=15 +set mouse=a +set splitright splitbelow +set noerrorbells visualbell t_vb= +set nobackup nowritebackup noswapfile +set timeout ttimeoutlen=100 timeoutlen=150 +set hidden shortmess+=Ia +set history=1000 +set undofile undodir=$vimdir/undo undolevels=1000 undoreload=10000 +set spellfile=$vimdir/spell/en.utf-8.add +set ignorecase smartcase incsearch wrapscan hlsearch +set foldmethod=syntax foldlevel=99 foldnestmax=10 foldlevelstart=99 " TODO: get good at folding +set noautowrite autochdir autoread +set nomodeline noshowmode noshowcmd laststatus=0 " TODO: custom modeline and buffer list? +set clipboard+=unnamedplus +set t_Co=256 -if filereadable("$ENV_PATH/vim-after") - source "$ENV_PATH/vim-after" -endif +syntax enable +colorscheme base16-donokai + +call matchadd('ColorColumn', '\%81v', 100) + +hi Search cterm=NONE ctermbg=blue ctermfg=black +hi LineNr ctermbg=none ctermfg=8 +hi CursorLineNr ctermbg=18 ctermfg=gray +hi IndentGuidesEven ctermbg=18 +hi Normal ctermbg=NONE +hi ColorColumn ctermbg=7 ctermfg=0 + +" jump to last opened position in file except in git commits +au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") && index(['gitcommit'], &ft) | exe "normal! g'\"" | endif + +inoremap jj +inoremap jk + +nnoremap :GitFiles +nnoremap :Files +nnoremap :GFiles? +nnoremap :Buffers +au FileType fzf tnoremap + +nnoremap :TmuxNavigateLeft +nnoremap :TmuxNavigateDown +nnoremap :TmuxNavigateUp +nnoremap :TmuxNavigateRight +tnoremap :TmuxNavigateLeft +tnoremap :TmuxNavigateDown +tnoremap :TmuxNavigateUp +tnoremap :TmuxNavigateRight + +map ,w CamelCaseMotion_w +map ,b CamelCaseMotion_b +map ,e CamelCaseMotion_e +map ,ge CamelCaseMotion_ge +omap ib CamelCaseMotion_ib +xmap ib CamelCaseMotion_ib +omap ie CamelCaseMotion_ie +xmap ie CamelCaseMotion_ie + +map mw:%s/\s\+$//:let @/ = ""'w +map :setlocal spell! + +nnoremap n 'Nn'[v:searchforward] +nnoremap N 'nN'[v:searchforward] + +cnoremap +cnoremap + +xnoremap < >gv + +let mapleader = "\" +nnoremap w :bd +nnoremap h :b# +nnoremap k :bnext +nnoremap j :bprevious +nnoremap / :let @/ = "": + +nnoremap t :split:term:resize 24:startinsert +tnoremap :q! + +" TODO: learn about the wildmenu `q:` diff --git a/apps/neovim/plugins.vim b/apps/neovim/plugins.vim deleted file mode 100644 index 9f0172a..0000000 --- a/apps/neovim/plugins.vim +++ /dev/null @@ -1,68 +0,0 @@ -" install plugin manager if needed -augroup PluginManagerInstaller - if empty(glob("$vimdir/autoload/plug.vim")) - silent !curl -fLo "$vimdir/autoload/plug.vim" --create-dirs 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - autocmd VimEnter * PlugInstall - endif -augroup End - -let g:indent_guide_auto_colors = 1 -let g:indent_guides_enable_on_vim_startup = 1 -let g:prosession_dir = $vimdir."/session/" -let g:polyglot_disabled = ['cue', 'cuesheet'] -let g:jsonnet_fmt_on_save = 0 - -" let g:fzf_layout = { 'window': 'enew' } - -" check if we're using vim as the manpage viewer before loading session plugins -if exists('asmanviewer') || exists('nosession') - let g:prosession_dir = '/dev/null' -else - Plug 'tpope/vim-obsession' " session ease-of-use - Plug 'dhruvasagar/vim-prosession' " more session ease-of-use -endif - -Plug 'junegunn/vim-plug' " plugin manager should manage itself -Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} " fuzzy file finding -Plug 'junegunn/fzf.vim' " helpers for using fzf in vim -Plug 'vim-airline/vim-airline' " status line -Plug 'vim-airline/vim-airline-themes' " more minimal status line -Plug 'nathanaelkane/vim-indent-guides' " indentation guides -" Plug 'SirVer/ultisnips' " snippet manager -Plug 'bkad/CamelCaseMotion' " camel case and underscore word movements -Plug 'vim-scripts/LargeFile' " gracefully handle very large files -Plug 'tpope/vim-commentary' " toggle comments in code easily -Plug 'tpope/vim-repeat' " better vim repeating for plugin-provided actions -Plug 'vim-scripts/SyntaxRange' " define syntax ranges -Plug 'tmux-plugins/vim-tmux-focus-events' " allow transitions from tmux -Plug 'christoomey/vim-tmux-navigator' " allow transitions to tmux -Plug 'godlygeek/tabular' " commands for aligning text -Plug 'lytedev/vim-superman' " view man pages with vim -Plug 'machakann/vim-sandwich' " quickly modify text surrounding objects -Plug 'tpope/vim-speeddating' " date-like text objects -Plug 'tpope/vim-fugitive' " git commands -Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object -Plug 'wellle/targets.vim' " adds some more handy text objects -Plug 'dbakker/vim-projectroot' " adds helper functions for getting to a project's root directory -Plug 'junegunn/goyo.vim' " better distraction-free editing -Plug 'junegunn/limelight.vim' " dim inactive blocks of code -Plug 'tpope/vim-sleuth' " try and detect indent method -Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings -Plug 'tpope/vim-eunuch' " unix helper commands -Plug 'mbbill/undotree' " undo tree visualizer -" Plug 'junegunn/vim-peekaboo' " preview registers - -" language support -Plug 'sheerun/vim-polyglot' " vim plugin loader for many languages -Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language -Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} " moonscript language -Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language -" Plug 'neoclide/coc.nvim', {'branch': 'release'} " language server interface -Plug 'tpope/vim-dadbod' " vim database functions -Plug 'lytedev/elm-vim', {'for': ['elm']} " elm lang -Plug 'google/vim-jsonnet', {'for': ['jsonnet', 'libsonnet']} " jsonnet -Plug 'sirtaj/vim-openscad', {'for': ['scad']} " openscad -Plug 'jjo/vim-cue' " cuelang -Plug 'calviken/vim-gdscript3', {'for': ['gdscript']} " godot scripts -" Plug 'chrisbra/csv.vim' -" Plug 'ssh://git@git.lyte.dev:2222/lytedev/vim-lytlang.git' diff --git a/apps/neovim/settings.vim b/apps/neovim/settings.vim deleted file mode 100644 index fa83f5d..0000000 --- a/apps/neovim/settings.vim +++ /dev/null @@ -1,165 +0,0 @@ -scriptencoding utf-8 -set fileencoding=utf8 -set encoding=utf8 - -" ALE completeopt recommendation -set completeopt=menu,menuone,preview,noselect,noinsert - -" line number defaults -set nonumber -set norelativenumber - -" different settings if using vim as a manpage viewer -" if exists('asmanviewer') -" set nonumber " no line numbers when viewing a man page -" set norelativenumber " no line numbers when viewing a man page -" else -" set nonumber " line numbers -" set norelativenumber " line numbers -" endif - -" use tabs at a two-space width like God intended -set tabstop=2 -set shiftwidth=2 -set softtabstop=2 -set noexpandtab - -" auto/smart indent -set autoindent smartindent - -" show certain whitespace characters -set list -set nostartofline -set listchars=trail:·,tab:\ \ ,trail:~ -" set listchars=eol:\ ,tab:>-,trail:~,extends:>,precedes:<,space:· - -" try and keep text (and code) to a width of 80 characters -set wrap -set linebreak -set breakindent -set textwidth=80 -set formatoptions=crql1j " :h fo-table - -" handle window title -set title - -" limit syntax highlighting line length -set synmaxcol=500 - -" don't highlight the current line -set nocursorline - -" don't highlight the current column -" set nocursorcolumn - -" OBSOLETE: colors columns past 80 -" let &colorcolumn=join(range(81,400),",") - -" highlight the 81st character in a line where it exists -highlight ColorColumn ctermbg=magenta ctermfg=7 -call matchadd('ColorColumn', '\%81v', 100) - -" set noshowcmd -" set nowildmenu -" set wildmode=longest,list,full -set cpoptions-=$ " make buffer options more global -set noshowmatch " don't briefly highlight matching brackets -set mouse=a " enable mouse use -set mousehide " hide mouse when typing -set backspace=indent,eol,start " sane backspace -set noruler " hide the ruler - we have airline -set lazyredraw " don't draw during macros and other such things -set scrolloff=8 " keep lines above and below cursor (padding) -set sidescrolloff=15 " same but for columns -set splitright " don't split left -set splitbelow " don't split top -set noerrorbells " shhhh, vim -set visualbell " but visual noise for alerts is ok -set nobackup " sessions handle this quite nicely -set nowritebackup " no, but really, they do -set noswapfile " no, seriously, sessions are cool -set timeout " key combo mapping timeout -set ttimeoutlen=100 " ms delay for tapping key combos -set timeoutlen=150 " ms for key combo mapping timeout -set isfname+=32 " allow filenames to show them 32s -set updatetime=300 " recommended for coc.nvim - -" no freakin' bell -set visualbell t_vb= -if has('autocmd') - augroup DisableVisualBell - autocmd GUIEnter * set visualbell t_vb= - augroup END -endif - -syntax enable -colorscheme base16-donokai - -" hide stuff -highlight SignColumn ctermbg=black guibg=black -highlight GitGutterAdd ctermbg=black guibg=black -highlight GitGutterDelete ctermbg=black guibg=black -highlight GitGutterChange ctermbg=black guibg=black -highlight GitGutterChangeDelete ctermbg=black guibg=black - -hi NonText ctermfg=black guifg=black - -hi DiffAdd ctermfg=black ctermbg=2 -hi DiffChange ctermfg=black ctermbg=4 -hi DiffDelete ctermfg=black ctermbg=10 -hi DiffText ctermfg=white ctermbg=10 - -set hidden " allows buffer switching without saving -set shortmess+=Ia " hide vim intro, skip lots of file messages/prompts -set history=1000 - -" undo files -set undofile -set undodir=$vimdir/undo -set undolevels=1000 -set undoreload=10000 - -" spell file -set spellfile=$vimdir/spell/en.utf-8.add - -" more sane search settings -set ignorecase -set smartcase -set incsearch -set wrapscan - -" highlight search matches -set hlsearch - -" enable syntax folding -set foldmethod=syntax -set foldlevel=99 -set foldnestmax=10 -set foldlevelstart=99 - -set noautowrite " let me do the writing -set autochdir " `:e` all day -set autoread " this is fine with `u` -set nomodeline " airline wins -set noshowmode " airline is really good -set noshowcmd " be clean - -set laststatus=0 " be clean - -" yank to OS clipboard by default -set clipboard+=unnamedplus - -" no empty buffer on startup -augroup DisableEmptyBuffer - autocmd VimEnter * nested if bufname('')=='' && line('$') == 1 && col('$')==1 && !&modified | bd % | endif -augroup END - -" modify higlight colors -hi Search cterm=NONE ctermbg=blue ctermfg=black -highlight LineNr ctermbg=none ctermfg=8 -highlight CursorLineNr ctermbg=18 ctermfg=gray -hi IndentGuidesEven ctermbg=18 - -hi Normal ctermbg=NONE - -let b:csv_arrange_align = 'l*' diff --git a/env/common/colors/vim b/env/common/colors/vim index 9bea0ce..f05d312 100644 --- a/env/common/colors/vim +++ b/env/common/colors/vim @@ -1,7 +1,3 @@ -" Base16 Donokai (https://github.com/chriskempson/base16) -" Scheme: Daniel Flanagan(https://lytedev.io) - -" GUI color definitions let s:gui00 = "111111" let s:gui01 = "383830" let s:gui02 = "49483e" From 1bbdf01a2eae8159ab7d7c024d3fc8bf9b2484d9 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 00:47:32 -0600 Subject: [PATCH 06/12] Fixes for neovim things --- apps/neovim/init.vim | 1 + env/nix/modules/users/daniel.nix | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/neovim/init.vim b/apps/neovim/init.vim index b7cfd4b..6f4aba7 100644 --- a/apps/neovim/init.vim +++ b/apps/neovim/init.vim @@ -39,6 +39,7 @@ filetype indent on filetype plugin on " use :h option-list if you need to know what these do +set fcs=eob:\+ set encoding=utf8 set tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab set autoindent smartindent diff --git a/env/nix/modules/users/daniel.nix b/env/nix/modules/users/daniel.nix index 4de9e0d..5084c30 100644 --- a/env/nix/modules/users/daniel.nix +++ b/env/nix/modules/users/daniel.nix @@ -1,4 +1,7 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +let + unstable = import { config = { allowUnfree = true; }; }; +in { fonts.fonts = with pkgs; [ # helvetica # needed by zoom ]; @@ -13,7 +16,7 @@ pulsemixer # audio file # identify file types kitty # terminal emulator - fzf # fuzzy finder + unstable.fzf # fuzzy finder dmenu # TODO: currently only using this for dmenu_path in `bin/launch` ranger # tui for file management pass # the standard unix password manager From aa2dda3bf749a6faf8a655e359939e7d04fe6c88 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 21:56:10 -0600 Subject: [PATCH 07/12] Working on the init script for setting up the remote backup server --- bin/init-dotfiles | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/bin/init-dotfiles b/bin/init-dotfiles index 1166982..4ccd4bc 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -1,5 +1,8 @@ #!/usr/bin/env sh +head /etc/os-release -n 1 | grep 'NixOS$'; test $? -eq 1; is_nixos=$? +head /etc/os-release -n 1 | grep 'Arch Linux'; test $? -eq 1; is_arch_linux=$? + set -e # NOTE: run this from inside a Linux installation, not from the live USB/CD @@ -63,11 +66,28 @@ setup_dotfiles() { ./bin/setup-dotfiles } +distro_specific_root_setup() { + if test $is_nixos -eq 1 then + symlink_nixos "$root_home$dotfiles/env/nix/" + add_unstable_channel + nixos-rebuild switch + elif test $is_arch_linux -eq 1 + # TODO: install any necessary packages for remaining setup portion + fi +} + +distro_specific_user_setup() { + if test $is_nixos -eq 1 then + FUNC=$(declare -f symlink_nixos) + sudo sh -c "$FUNC; symlink_nixos \"$daniel_home$dotfiles/env/nix/\"" + elif test $is_arch_linux -eq 1 + # TODO: setup all the things + fi +} + init_for_root() { clone_dotfiles "$root_home$dotfiles" - symlink_nixos "$root_home$dotfiles/env/nix/" - add_unstable_channel - nixos-rebuild switch + distro_specific_setup chown daniel:users "$daniel_home" echo "Re-running as user daniel..." sudo --user daniel "$root_home$dotfiles/init.sh" @@ -76,8 +96,7 @@ init_for_root() { init_for_daniel() { clone_dotfiles "$daniel_home$dotfiles" generate_ssh_key - FUNC=$(declare -f symlink_nixos) - sudo sh -c "$FUNC; symlink_nixos \"$daniel_home$dotfiles/env/nix/\"" + distro_specific_user_setup setup_wallpaper # TODO: setup ssh/gpg keys # TODO: setup password store From 165400b69e30665fe25b342027c7653809a56615 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 21:57:54 -0600 Subject: [PATCH 08/12] Fix if statements --- bin/init-dotfiles | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/init-dotfiles b/bin/init-dotfiles index 4ccd4bc..bce59cd 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -67,20 +67,20 @@ setup_dotfiles() { } distro_specific_root_setup() { - if test $is_nixos -eq 1 then + if test $is_nixos -eq 1; then symlink_nixos "$root_home$dotfiles/env/nix/" add_unstable_channel nixos-rebuild switch - elif test $is_arch_linux -eq 1 + elif test $is_arch_linux -eq 1; then # TODO: install any necessary packages for remaining setup portion fi } distro_specific_user_setup() { - if test $is_nixos -eq 1 then + if test $is_nixos -eq 1; then FUNC=$(declare -f symlink_nixos) sudo sh -c "$FUNC; symlink_nixos \"$daniel_home$dotfiles/env/nix/\"" - elif test $is_arch_linux -eq 1 + elif test $is_arch_linux -eq 1; then # TODO: setup all the things fi } From b59a70e0ec875203a8f1cfb440d48aa1c1ce3f8b Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 21:58:26 -0600 Subject: [PATCH 09/12] Fix empty elif blocks --- bin/init-dotfiles | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/init-dotfiles b/bin/init-dotfiles index bce59cd..7b6a3c5 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -73,6 +73,7 @@ distro_specific_root_setup() { nixos-rebuild switch elif test $is_arch_linux -eq 1; then # TODO: install any necessary packages for remaining setup portion + printf '' fi } @@ -82,6 +83,7 @@ distro_specific_user_setup() { sudo sh -c "$FUNC; symlink_nixos \"$daniel_home$dotfiles/env/nix/\"" elif test $is_arch_linux -eq 1; then # TODO: setup all the things + printf '' fi } From 0c250a0b172bf057765d0d8d7ea685cc54cbd912 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 21:58:55 -0600 Subject: [PATCH 10/12] Fix bad function call --- bin/init-dotfiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/init-dotfiles b/bin/init-dotfiles index 7b6a3c5..481d401 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -89,7 +89,7 @@ distro_specific_user_setup() { init_for_root() { clone_dotfiles "$root_home$dotfiles" - distro_specific_setup + distro_specific_root_setup chown daniel:users "$daniel_home" echo "Re-running as user daniel..." sudo --user daniel "$root_home$dotfiles/init.sh" From 40edd8d3c9e6f8f3bbef64a010c03be008e8abc1 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 22:23:52 -0600 Subject: [PATCH 11/12] Overhaul provisioning script system --- bin/init-dotfiles | 3 +- env/arch-linux/provision.d/00-add-user.bash | 17 +++++++ .../provision.d/10-install-yay.bash | 11 ++++ .../20-install-packages.bash} | 51 +++++++++++++++++-- .../50-install-tmux-plugins.bash} | 2 +- .../optional}/amd.bash | 0 env/arch-linux/provision.sh | 2 + env/arch-linux/provisioning/0-adduser.bash | 15 ------ env/arch-linux/provisioning/1-pacaur.bash | 36 ------------- env/arch-linux/provisioning/2-essentials.bash | 47 ----------------- env/arch-linux/provisioning/4-comms.bash | 13 ----- 11 files changed, 79 insertions(+), 118 deletions(-) create mode 100755 env/arch-linux/provision.d/00-add-user.bash create mode 100755 env/arch-linux/provision.d/10-install-yay.bash rename env/arch-linux/{provisioning/3-extras.bash => provision.d/20-install-packages.bash} (50%) rename env/arch-linux/{provisioning/tmux-plugins.bash => provision.d/50-install-tmux-plugins.bash} (92%) rename env/arch-linux/{provisioning => provision.d/optional}/amd.bash (100%) create mode 100755 env/arch-linux/provision.sh delete mode 100755 env/arch-linux/provisioning/0-adduser.bash delete mode 100755 env/arch-linux/provisioning/1-pacaur.bash delete mode 100755 env/arch-linux/provisioning/2-essentials.bash delete mode 100755 env/arch-linux/provisioning/4-comms.bash diff --git a/bin/init-dotfiles b/bin/init-dotfiles index 481d401..f402da8 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -70,9 +70,10 @@ distro_specific_root_setup() { if test $is_nixos -eq 1; then symlink_nixos "$root_home$dotfiles/env/nix/" add_unstable_channel - nixos-rebuild switch + nixos-rebuild switch # this should create the `daniel` user elif test $is_arch_linux -eq 1; then # TODO: install any necessary packages for remaining setup portion + "$root_home$dotfiles/env/arch-linux/provision.d/00-add-user.bash" printf '' fi } diff --git a/env/arch-linux/provision.d/00-add-user.bash b/env/arch-linux/provision.d/00-add-user.bash new file mode 100755 index 0000000..ddecd05 --- /dev/null +++ b/env/arch-linux/provision.d/00-add-user.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +u=daniel +ud="/home/$u" + +# user exists - we will assume setup has already run +if getent passwd "$u"; then exit 0; fi + +groupadd admin 2>/dev/null +mkdir --parents "$ud/.home" "$ud/dl" +useradd --home-dir "$ud/.home" \ + --groups "admin,users" \ + --shell "/bin/bash" \ + "$u" +chown --recursive "$u:$u" "$ud" +echo "Setting password for user '$u'" +passwd "$u" diff --git a/env/arch-linux/provision.d/10-install-yay.bash b/env/arch-linux/provision.d/10-install-yay.bash new file mode 100755 index 0000000..1b40b67 --- /dev/null +++ b/env/arch-linux/provision.d/10-install-yay.bash @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +REPOSITORY_PATH="/tmp/provisioning" +pacman -S --needed git base-devel +mkdir -p "$REPOSITORY_PATH" +rm -rf "$REPOSITORY_PATH/yay" +git clone https://aur.archlinux.org/yay.git +cd yay +makepkg -si +yay -S yay +rm -rf "$REPOSITORY_PATH/yay" diff --git a/env/arch-linux/provisioning/3-extras.bash b/env/arch-linux/provision.d/20-install-packages.bash similarity index 50% rename from env/arch-linux/provisioning/3-extras.bash rename to env/arch-linux/provision.d/20-install-packages.bash index b7fc06f..fb355d2 100755 --- a/env/arch-linux/provisioning/3-extras.bash +++ b/env/arch-linux/provision.d/20-install-packages.bash @@ -5,10 +5,9 @@ if egrep -q '^\[multilib\]$' /etc/pacman.conf; then else echo "Enabling Multilib Repository (with sudo)..." sudo sh -c 'echo -e "\n\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf' - yay -Sy fi -yay -S \ +yay -Sy \ xf86-input-libinput \ bluez bluez-libs bluez-utils bluez-tools `# Bluetooth` \ pigz `# Multi-core gzipping` \ @@ -44,6 +43,48 @@ yay -S \ libinput libinput-gestures `# Trackpad Control` \ efibootmgr efivar `# UEFI Boot CLI Stuff` \ glu mesa wxgtk2 libpng `# Various` \ - gammastep `# Redshift for Wayland` - -curl -L -o "$HOME/.emoji.txt" https://lyte.dev/uploads/emoji.txt + gammastep `# Redshift for Wayland` \ + weechat `# IRC Client` \ + aria2 `# Downloads Manager` \ + tree `# Handy Filesystem Viewing Utility` \ + dmenu `# Application Launcher` \ + ripgrep `# Code Search Utilities` \ + fd `# File Search` \ + sd `# Easy Find/Replace` \ + fzf `# Fuzzy File Finder` \ + htop `# Process Management and System Resources Monitoring` \ + openssh mosh `# Remote Access` \ + openssl `# Crypto` \ + asdf-vm `# Runtime Version Manager` \ + python python-pip `# Python 3 Language` \ + pass `# Password Management` \ + firefox-developer-edition `# Default Web Browser` \ + rsync `# File Transfer` \ + alsa-utils `# Audio Utilities` \ + alsa-plugins `# Plugins for ALSA` \ + pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \ + neovim `# Text Editors` \ + unzip `# Simple Unzipping` \ + tmux `# Terminal Multiplexer` \ + kitty `# Almost Better Terminal Emulator` \ + feh `# Image Viewer & Wallpaper Manager` \ + wlroots-git sway-git `# Wayland Compositor` \ + swaylock-git swayidle-git `# Auto-Locking for Sway` \ + kanshi-git `# Monitor Management for Sway` \ + waybar-git mako-git `# Sway Bar & Notifications` \ + slurp grim wl-clipboard `# Sway Screen Selection & Clipping` \ + ttf-iosevka `# Primary Fonts` \ + ttf-font-awesome `# Icon Font` \ + curl `# HTTP Utility` \ + w3m `# Viewing Images in Terminals` \ + jq `# CLI for Interacting with JSON` \ + ranger `# CLI File Manager` \ + httpie `# httpie and neovim dependencies` \ + docker docker-compose `# Yummy containers` \ + inotify-tools `# Watching` \ + fish `# Shell` \ + time `# GNU time` \ + fortune-mod fortune-mod-archlinux `# Fortune` \ + diff-so-fancy `# Fancy Diffs` \ + oath-toolkit `# One-Time Passwords` \ + sysstat `# System Statistics` diff --git a/env/arch-linux/provisioning/tmux-plugins.bash b/env/arch-linux/provision.d/50-install-tmux-plugins.bash similarity index 92% rename from env/arch-linux/provisioning/tmux-plugins.bash rename to env/arch-linux/provision.d/50-install-tmux-plugins.bash index 95a3041..51c07af 100755 --- a/env/arch-linux/provisioning/tmux-plugins.bash +++ b/env/arch-linux/provision.d/50-install-tmux-plugins.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -mkdir -p "$HOME/.config/systemd/user" +mkdir -p "$XDG_CONFIG_HOME/systemd/user" [ ! -d "$XDG_CONFIG_HOME/tmux/plugins/tpm" ] && \ git clone https://github.com/tmux-plugins/tpm "$XDG_CONFIG_HOME/tmux/plugins/tpm" diff --git a/env/arch-linux/provisioning/amd.bash b/env/arch-linux/provision.d/optional/amd.bash similarity index 100% rename from env/arch-linux/provisioning/amd.bash rename to env/arch-linux/provision.d/optional/amd.bash diff --git a/env/arch-linux/provision.sh b/env/arch-linux/provision.sh new file mode 100755 index 0000000..ac6fb46 --- /dev/null +++ b/env/arch-linux/provision.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +for file in "$(dirname "$0")/provision.d"/*; do "$file"; done diff --git a/env/arch-linux/provisioning/0-adduser.bash b/env/arch-linux/provisioning/0-adduser.bash deleted file mode 100755 index f6866f9..0000000 --- a/env/arch-linux/provisioning/0-adduser.bash +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -USERNAME=daniel -GROUPS="admin,users" - -groupadd admin 2>/dev/null -mkdir --parents "/home/$USERNAME/.home" -mkdir --parents "/home/$USERNAME/dl" -useradd --home-dir "/home/$USERNAME/.home" \ - --groups "${GROUPS}" \ - --shell "/bin/bash" \ - "$USERNAME" -chown --recursive "$USERNAME:$USERNAME" "/home/$USERNAME" -echo "Setting password for user '$USERNAME'" -passwd "$USERNAME" diff --git a/env/arch-linux/provisioning/1-pacaur.bash b/env/arch-linux/provisioning/1-pacaur.bash deleted file mode 100755 index 1080282..0000000 --- a/env/arch-linux/provisioning/1-pacaur.bash +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -# TODO: this script is out of date! - -# installs pacaur on a fresh arch install - -# install the dependencies -sudo pacman -S git curl openssl perl expac yajl meson gmock gtest jq make pkginfo --noconfirm - -# setup a temporary place to install the packages from -REPOSITORY_PATH="/tmp/provisioning" -mkdir -p "$REPOSITORY_PATH" - -# clone the repositories -rm -rf "$REPOSITORY_PATH/auracle-git" -rm -rf "$REPOSITORY_PATH/pacaur" -git clone https://aur.archlinux.org/auracle-git.git "$REPOSITORY_PATH/auracle-git" -git clone https://aur.archlinux.org/pacaur.git "$REPOSITORY_PATH/pacaur" - -# build and install auracle -cd "$REPOSITORY_PATH/auracle-git" -makepkg -i --noconfirm -cd - - -# build and install pacaur -cd "$REPOSITORY_PATH/pacaur" -makepkg -i --noconfirm -cd - - -# cleanup -rm -rf "$REPOSITORY_PATH/auracle-git" -rm -rf "$REPOSITORY_PATH/pacaur" - -# once installed, let the package manager manage itself and its dependencies -pacaur -S auracle-git pacaur --noconfirm --noedit - diff --git a/env/arch-linux/provisioning/2-essentials.bash b/env/arch-linux/provisioning/2-essentials.bash deleted file mode 100755 index 0949e52..0000000 --- a/env/arch-linux/provisioning/2-essentials.bash +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env sh - -yay -S \ - weechat `# IRC Client` \ - aria2 `# Downloads Manager` \ - tree `# Handy Filesystem Viewing Utility` \ - dmenu `# Application Launcher` \ - ripgrep `# Code Search Utilities` \ - fd `# File Search` \ - sd `# Easy Find/Replace` \ - fzf `# Fuzzy File Finder` \ - htop `# Process Management and System Resources Monitoring` \ - openssh mosh `# Remote Access` \ - openssl `# Crypto` \ - asdf-vm `# Runtime Version Manager` \ - python python-pip `# Python 3 Language` \ - pass `# Password Management` \ - firefox-developer-edition `# Default Web Browser` \ - rsync `# File Transfer` \ - alsa-utils `# Audio Utilities` \ - alsa-plugins `# Plugins for ALSA` \ - pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \ - neovim `# Text Editors` \ - unzip `# Simple Unzipping` \ - tmux `# Terminal Multiplexer` \ - kitty `# Almost Better Terminal Emulator` \ - feh `# Image Viewer & Wallpaper Manager` \ - wlroots-git sway-git `# Wayland Compositor` \ - swaylock-git swayidle-git `# Auto-Locking for Sway` \ - kanshi-git `# Monitor Management for Sway` \ - waybar-git mako-git `# Sway Bar & Notifications` \ - slurp grim wl-clipboard `# Sway Screen Selection & Clipping` \ - ttf-iosevka `# Primary Fonts` \ - ttf-font-awesome `# Icon Font` \ - curl `# HTTP Utility` \ - w3m `# Viewing Images in Terminals` \ - jq `# CLI for Interacting with JSON` \ - ranger `# CLI File Manager` \ - httpie `# httpie and neovim dependencies` \ - docker docker-compose `# Yummy containers` \ - inotify-tools `# Watching` \ - fish `# Shell` \ - time `# GNU time` \ - fortune-mod fortune-mod-archlinux `# Fortune` \ - diff-so-fancy `# Fancy Diffs` \ - oath-toolkit `# One-Time Passwords` \ - sysstat `# System Statistics` diff --git a/env/arch-linux/provisioning/4-comms.bash b/env/arch-linux/provisioning/4-comms.bash deleted file mode 100755 index 2750941..0000000 --- a/env/arch-linux/provisioning/4-comms.bash +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -yay -S weechat-poljar-matrix-git weechat-discord-git wee-slack - -wcpm="/usr/lib/weechat/python/matrix" -hwcp="${HOME}/.weechat/python" -ln -s "${wcpm}/" "${hwcp}/" -ln -s "${wcpm}.py" "${hwcp}/" -ln -s "${wcpm}.py" "${hwcp}/autoload/" -ln -s "/usr/lib/weechat/python/wee_slack.py" "${hwcp}/" -ln -s "/usr/lib/weechat/python/wee_slack.py" "${hwcp}/autoload/" - -# Scripts are in /usr/lib/weechat/python/matrix/contrib/ From 2519a7424f59d73b352f9213cf928386032e2ffc Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 7 Nov 2020 22:27:33 -0600 Subject: [PATCH 12/12] Install git if needed for arch --- bin/init-dotfiles | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/init-dotfiles b/bin/init-dotfiles index f402da8..e61ce9f 100755 --- a/bin/init-dotfiles +++ b/bin/init-dotfiles @@ -19,11 +19,13 @@ add_unstable_channel() { } clone_dotfiles() { + if test $is_arch_linux -eq 1; then + pacman -S --needed git + fi echo "Setting up dotfiles for $USER..." mkdir --parents "$1" - set +e - git clone "https://git.lyte.dev/lytedev/dotfiles" "$1" &>/dev/null - set -e + rm -r "$1" + git clone "https://git.lyte.dev/lytedev/dotfiles" "$1" } symlink_nixos() {