diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ef17247..58916fb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,14 +3,14 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "weekly" - package-ecosystem: "terraform" directory: "/terraform/module" schedule: - interval: "daily" + interval: "weekly" - package-ecosystem: "docker" directory: "/" schedule: - interval: "daily" + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fadc92..33d63a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,4 +10,4 @@ jobs: # Run the tests - name: 'Run tests' - run: ./scripts/test.sh + run: ./script/test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 0cd4d19..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Dotfiles publisher -on: - push: - branches: - - master - -jobs: - publish-installer: - name: Publish setup script - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.1.0 - - # Set up the gcloud auth credentials - - name: 'Set up auth' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} - - # Set up the gcloud CLI - - name: 'Set up Cloud SDK' - uses: google-github-actions/setup-gcloud@v1.1.0 - - # Publish the setup script - - name: 'Run publish script' - run: scripts/publish diff --git a/Dockerfile b/Dockerfile index cda6fad..1a9e8a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # # debian-base: Base Debian image with sudo user # -FROM debian:buster AS debian-base +FROM debian:bullseye AS debian-base RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections ENV DEBIAN_FRONTEND noninteractive @@ -25,7 +25,7 @@ RUN mkdir ${DOTFILES_DIR} RUN chown test-user ${DOTFILES_DIR} ADD --chown="test-user" files "$DOTFILES_DIR/files" -ADD --chown="test-user" scripts "$DOTFILES_DIR/scripts" +ADD --chown="test-user" script "$DOTFILES_DIR/script" WORKDIR "$DOTFILES_DIR" @@ -37,7 +37,7 @@ FROM source AS install USER test-user ENV USER=test-user ARG UUID="docker" -RUN ./scripts/install.sh +RUN ./script/install # diff --git a/README.md b/README.md index b14d730..aea43a2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # andrejusk/dotfiles -Collection of my dotfiles and supporting install scripts +[![Dotfiles CI](https://github.com/andrejusk/dotfiles/actions/workflows/ci.yml/badge.svg)](https://github.com/andrejusk/dotfiles/actions/workflows/ci.yml) + +Collection of dotfiles and supporting install scripts +to set up a reproducible development environment ## Installer -[![Dotfiles publisher](https://github.com/andrejusk/dotfiles/actions/workflows/publish.yml/badge.svg?branch=master)](https://github.com/andrejusk/dotfiles/actions/workflows/publish.yml) - Each push to master publishes the setup script, allowing the repo to be installed by running: @@ -15,27 +16,24 @@ to be installed by running: uuid-runtime \ wget + # Inspect source - wget http://dots.andrejus.dev/setup.sh -qO - | less + wget https://raw.githubusercontent.com/andrejusk/dotfiles/HEAD/script/setup -qO - | less # One-liner install if running on Ubuntu - wget http://dots.andrejus.dev/setup.sh -qO - | bash + wget https://raw.githubusercontent.com/andrejusk/dotfiles/HEAD/script/setup -qO - | bash ## The Stack -[![Dotfiles CI](https://github.com/andrejusk/dotfiles/actions/workflows/ci.yml/badge.svg)](https://github.com/andrejusk/dotfiles/actions/workflows/ci.yml) +Tested and maintained against Debian bullseye -Tested and maintained against Debian buster - -### Shells +### Shell - 🐟 fish (+ fisher) -### Editors +### Editor - vscode -- neovim (+ vim-plug) -- spacemacs ### Languages diff --git a/files/home/.config/.gitignore b/files/config/.gitignore similarity index 100% rename from files/home/.config/.gitignore rename to files/config/.gitignore diff --git a/files/home/.config/fish/.gitignore b/files/config/fish/.gitignore similarity index 100% rename from files/home/.config/fish/.gitignore rename to files/config/fish/.gitignore diff --git a/files/home/.config/fish/config.fish b/files/config/fish/config.fish similarity index 100% rename from files/home/.config/fish/config.fish rename to files/config/fish/config.fish diff --git a/files/home/.config/fish/fish_plugins b/files/config/fish/fish_plugins similarity index 100% rename from files/home/.config/fish/fish_plugins rename to files/config/fish/fish_plugins diff --git a/files/home/.config/fish/functions/.gitignore b/files/config/fish/functions/.gitignore similarity index 100% rename from files/home/.config/fish/functions/.gitignore rename to files/config/fish/functions/.gitignore diff --git a/files/home/.config/fish/functions/nvm.fish b/files/config/fish/functions/nvm.fish similarity index 100% rename from files/home/.config/fish/functions/nvm.fish rename to files/config/fish/functions/nvm.fish diff --git a/files/home/.config/alacritty/alacritty.yml b/files/home/.config/alacritty/alacritty.yml deleted file mode 100644 index daa2955..0000000 --- a/files/home/.config/alacritty/alacritty.yml +++ /dev/null @@ -1,55 +0,0 @@ -env: - TERM: xterm-256color - -window: - dynamic_title: true - dynamic_padding: true - decorations: None - startup_mode: Windowed - - dimensions: - columns: 120 - lines: 32 - - padding: - x: 12 - y: 7 - -scrolling: - history: 10000 - multiplier: 3 - -font: - size: 10.0 - normal: - family: FiraCode Nerd Font Mono - style: Regular - - bold: - family: FiraCode Nerd Font Mono - style: Bold - - italic: - family: FiraSansCondensed NF - style: Italic - - bold_italic: - family: FiraSansCondensed NF - style: Bold Italic - -draw_bold_text_with_bright_colors: false -background_opacity: 0.95 - -cursor: - style: Beam - unfocused_hollow: true - -live_config_reload: true - -key_bindings: - - { key: V, mods: Control|Shift, action: Paste } - - { key: C, mods: Control|Shift, action: Copy } - - { key: Insert, mods: Shift, action: PasteSelection } - - { key: Key0, mods: Control, action: ResetFontSize } - - { key: Plus, mods: Control, action: IncreaseFontSize } - - { key: Minus, mods: Control, action: DecreaseFontSize } diff --git a/files/home/.config/nvim/.gitignore b/files/home/.config/nvim/.gitignore deleted file mode 100644 index ed0e3f9..0000000 --- a/files/home/.config/nvim/.gitignore +++ /dev/null @@ -1 +0,0 @@ -plugged diff --git a/files/home/.config/nvim/base.vim b/files/home/.config/nvim/base.vim deleted file mode 100644 index 12509ac..0000000 --- a/files/home/.config/nvim/base.vim +++ /dev/null @@ -1,111 +0,0 @@ -" ============================================================================ " -" === EDITING OPTIONS === " -" ============================================================================ " -" -" Leader key -let g:mapleader=' ' - -" Use posix-compliant shell -set shell=sh - -" Enable syntax highlighting -syntax enable -filetype on -filetype plugin on - -" Hides buffers instead of closing them -set hidden - -" do not wrap long lines by default -set nowrap - -" default encoding -set encoding=utf-8 -set fileencoding=utf-8 -set fileformat=unix - -" Yank and paste with the system clipboard -set clipboard=unnamedplus - -" et = expandtab (spaces instead of tabs) -" ts = tabstop (the number of spaces that a tab equates to) -" sw = shiftwidth (the number of spaces to use when indenting -" -- or de-indenting -- a line) -" sts = softtabstop (the number of spaces to use when expanding tabs) -set et sts=4 sw=4 ts=4 -set showtabline=4 - -set foldenable -set foldmethod=indent -set foldlevel=99 - -set conceallevel=0 - -set scrolloff=10 - -" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable -" delays and poor user experience. -set updatetime=100 -set timeoutlen=300 - -" Don't pass messages to |ins-completion-menu|. -set shortmess=atT - -" Always show the signcolumn, otherwise it would shift the text each time -" diagnostics appear/become resolved. -if has("patch-8.1.1564") - " Recently vim can merge signcolumn and number column into one - set signcolumn=number -else - set signcolumn=yes -endif - -" coc.nvim recommendations -set nobackup -set nowritebackup - -" ============================================================================ " -" === UI === " -" ============================================================================ " - -" Support italics -hi Comment cterm=italic - -" Enable true color support -if (has("termguicolors")) - set termguicolors - hi LineNr ctermbg=NONE guibg=NONE -endif - -" Set preview window to appear at bottom and right -set splitbelow -set splitright - -" Don't dispay mode in command line (airilne already shows it) -set noshowmode - -" Set floating window to be slightly transparent -set winbl=10 - -" Enable ruler -set ruler -set number -set relativenumber - -" Pop-up menu -set pumheight=10 - -" two lines for command line -set cmdheight=2 - -" no visual bell -set visualbell t_vb= - -" if the search string has an upper case letter in it, the search will be case sensitive -set smartcase - -" Redraw on resize -autocmd VimResized * redraw! - -" Redraw on writing buffer -autocmd BufWritePost * redraw! diff --git a/files/home/.config/nvim/coc-settings.json b/files/home/.config/nvim/coc-settings.json deleted file mode 100644 index 7679161..0000000 --- a/files/home/.config/nvim/coc-settings.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "coc.preferences.extensionUpdateCheck": "daily", - - "list.source.files.args": ["--hidden", "--files"], - - "suggest.echodocSupport": true, - - "python.pythonPath": "python3", - "python.jediEnabled": false, - "python.linting.flake8Enabled": true, - "python.linting.pylintEnabled": false, - - "languageserver": { - "terraform": { - "command": "terraform-ls", - "args": ["serve"], - "filetypes": ["tf", "terraform"], - "initializationOptions": {}, - "settings": {} - }, - "elmLS": { - "command": "elm-language-server", - "filetypes": ["elm"], - "rootPatterns": ["elm.json"], - "initializationOptions": { - "elmPath": "elm", - "elmFormatPath": "elm-format", - "elmTestPath": "elm-test", - "elmAnalyseTrigger": "change" - } - } - }, - - "explorer.width": 30, - "explorer.file.root.template": "[icon] [git] [hidden & 1][root]", - "explorer.icon.enableNerdfont": true, - "explorer.previewAction.onHover": false, - "explorer.icon.enableVimDevicons": false, - "explorer.file.showHiddenFiles": true, - "explorer.file.autoReveal": true, - "explorer.keyMappings.global": { - "i": false, - - "gk": "expandablePrev", - "gj": "expandableNext", - - "*": "toggleSelection", - "": "actionMenu", - - "h": "collapse", - "l": ["expandable?", "expand", "open"], - "J": ["toggleSelection", "nodeNext"], - "K": ["toggleSelection", "nodePrev"], - "gl": "expandRecursive", - "gh": "collapseRecursive", - - "o": ["expanded?", "collapse", "expand"], - "": ["expandable?", "cd", "open"], - "e": "open", - "s": "open:split", - "v": "open:vsplit", - "t": "open:tab", - "": "gotoParent", - "gp": "preview:labeling", - - "y": "copyFilepath", - "Y": "copyFilename", - "c": "copyFile", - "x": "cutFile", - "p": "pasteFile", - "d": "delete", - "D": "deleteForever", - - "a": "addFile", - "A": "addDirectory", - "r": "rename", - - ".": "toggleHidden", - "R": "refresh", - - "?": "help", - "q": "quit", - "": "esc", - "X": "systemExecute", - "gd": "listDrive", - - "f": "search", - "F": "searchRecursive", - - "gf": "gotoSource:file", - "gb": "gotoSource:buffer", - - "[[": "sourcePrev", - "]]": "sourceNext", - - "[d": "diagnosticPrev", - "]d": "diagnosticNext", - - "[c": "gitPrev", - "]c": "gitNext", - "<<": "gitStage", - ">>": "gitUnstage" - } -} diff --git a/files/home/.config/nvim/init.vim b/files/home/.config/nvim/init.vim deleted file mode 100644 index 66514fc..0000000 --- a/files/home/.config/nvim/init.vim +++ /dev/null @@ -1,6 +0,0 @@ -runtime base.vim - -runtime plugins.vim -runtime plugins-config.vim - -runtime mappings.vim diff --git a/files/home/.config/nvim/mappings.vim b/files/home/.config/nvim/mappings.vim deleted file mode 100644 index 4153599..0000000 --- a/files/home/.config/nvim/mappings.vim +++ /dev/null @@ -1,155 +0,0 @@ -" Disable arrow keys -noremap -noremap -noremap -noremap -inoremap -inoremap -inoremap -inoremap - - -" Disable manual and ex mode -nnoremap -nnoremap Q - - -" Quick escape -inoremap jk -inoremap kj - - -" Quick save -nnoremap :w - - -" Better tabbing -" When indenting, reselect previous selection -" if in visual mode -vnoremap < >gv - - -" Quick window switching -" Ctrl-[hjkl] -nnoremap h -nnoremap j -nnoremap k -nnoremap l - - -" Quick window resizing -" Alt-[hjkl] -nnoremap :resize -2 -nnoremap :resize +2 -nnoremap :vertical resize -2 -nnoremap :vertical resize +2 - - -" Quicker omni complete nav -" Ctrl-[jk] -inoremap ("\") -inoremap ("\") - - -" Distraction free typing -" l - Toggle Goyo and Limelight -nnoremap l :Goyo -autocmd! User GoyoEnter Limelight -autocmd! User GoyoLeave Limelight! - - -" Strip whitespace -" y - Remove all trailing whitespace -nnoremap y :StripWhitespace - - -" fzf -" p - Search files in current workdir -" P - Search files in $HOME -" g - Search commits for current buffer -" G - Search commits in current workdir -" f - Search source in current workdir -" ; - Search buffers -nnoremap p :Files -nnoremap P :Files ~ -nnoremap g :BCommits -nnoremap G :Commits -nnoremap f :Rg -nnoremap ; :Buffers - - -" coc.nvim explorer -" e - Toggle explorer on/off -" E - Open current file location -nmap e :CocCommand explorer -nmap E :CocCommand explorer --reveal expand('') - - -" coc.nvim -" Ctrl-n - Go to next diagnostic -" Ctrl-p - Go to previous diagnostic -" a - Open action list -" c - Open command list -" d - Jump to definition of current symbol -" r - Jump to references of current symbol -" j - Jump to implementation of current symbol -" s - Fuzzy search current project symbols -" n - Symbol renaming -" k - Symbol renaming -nmap (coc-diagnostic-next) -nmap (coc-diagnostic-prev) -nmap a (coc-codeaction-line) -nmap d (coc-definition) -nmap r (coc-references) -nmap j (coc-implementation) -nmap s :CocList -I -N --top symbols -nmap n (coc-rename) -nmap c :CocCommand - -" Search shorcuts -" h - Find and replace -" / - Clear highlighted search terms while preserving history -nnoremap h :%s/// -nnoremap / :nohlsearch - - -" - trigger completion -" - trigger completion and navigate to next complete item -inoremap coc#refresh() -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - - - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~ '\s' -endfunction - -" K - show documentation in preview window -nnoremap K :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -" Highlight the symbol and its references when holding the cursor. -autocmd CursorHold * silent call CocActionAsync('highlight') - -augroup mygroup - autocmd! - " Setup formatexpr specified filetype(s). - autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') - " Update signature help on jump placeholder. - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') -augroup end diff --git a/files/home/.config/nvim/plugins-config.vim b/files/home/.config/nvim/plugins-config.vim deleted file mode 100644 index 1a59c64..0000000 --- a/files/home/.config/nvim/plugins-config.vim +++ /dev/null @@ -1,27 +0,0 @@ -" Colourscheme -set background=dark -colorscheme base16-seti - -" Close preview window when completion is done. -autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif - -" Disable deprecated python2 provider -let g:loaded_python_provider = 0 - -" " Call method on window enter -" augroup WindowManagement -" autocmd! -" autocmd WinEnter * call Handle_Win_Enter() -" augroup END - -" " Change highlight group of preview window when open -" function! Handle_Win_Enter() -" if &previewwindow -" setlocal winhighlight=Normal:MarkdownError -" endif -" endfunction -" -" {{{ - let g:startify_custom_header = - \ startify#pad(split(system('fortune | cowsay -f tux'), '\n')) -" }}} diff --git a/files/home/.config/nvim/plugins.vim b/files/home/.config/nvim/plugins.vim deleted file mode 100644 index d4bf0fc..0000000 --- a/files/home/.config/nvim/plugins.vim +++ /dev/null @@ -1,190 +0,0 @@ -call plug#begin('~/.config/nvim/plugged') - -" sensible defaults -Plug 'tpope/vim-sensible' - -" colorscheme -Plug 'chriskempson/base16-vim' - -" dev icons -Plug 'ryanoasis/vim-devicons' -" {{{ - let g:webdevicons_enable_airline_tabline = 1 - let g:webdevicons_enable_airline_statusline = 1 - - let g:webdevicons_enable_startify = 1 -" }}} - -" status line -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -" {{{ - " Theme - let g:airline_theme = 'base16_seti' - - " Enable extensions - let g:airline_extensions = ['branch', 'coc', 'hunks', 'tabline', 'whitespace', 'fzf'] - - " Do not draw separators for empty sections (only for the active window) > - let g:airline_skip_empty_sections = 0 - - " Custom setup that removes filetype/whitespace from default vim airline bar - let g:airline#extensions#default#layout = [['a', 'b', 'c'], ['x', 'z', 'warning', 'error']] - - " Customize vim airline per filetype - " 'list' - Only show file type plus current line number out of total - let g:airline_filetype_overrides = { - \ 'coc-explorer': [ ' Explore', '' ], - \ 'fugitive': ['fugitive', '%{airline#util#wrap(airline#extensions#branch#get_head(),80)}'], - \ 'help': [ 'Help', '%f' ], - \ 'startify': [ 'startify', '' ], - \ 'vim-plug': [ 'Plugins', '' ], - \ 'list': [ '%y', '%l/%L'], - \ } - - " Enable powerline fonts - let g:airline_powerline_fonts = 1 - let g:airline_left_sep = '' - let g:airline_right_sep = '' - let g:airline_right_alt_sep = '' - - " Enable caching of syntax highlighting groups - let g:airline_highlighting_cache = 1 - - " Enable tabline - let g:airline#extensions#tabline#enabled = 1 - let g:airline#extensions#tabline#left_sep = ' ' - let g:airline#extensions#tabline#left_alt_sep = '|' - let g:airline#extensions#tabline#formatter = 'unique_tail_improved' -" }}} - -" start screen -Plug 'mhinz/vim-startify' - -" distraction-free typing -Plug 'junegunn/goyo.vim' -Plug 'junegunn/limelight.vim' - -" DOcumentation GEneraton -Plug 'kkoomen/vim-doge', { 'do': { -> doge#install({ 'headless': 1 }) } } - -" auto-close plugins -Plug 'tpope/vim-endwise' - -" easier commentary -Plug 'tpope/vim-commentary' - -" easier alignment -Plug 'godlygeek/tabular' - -" extra visual feedback -Plug 'junegunn/rainbow_parentheses.vim' -" {{{ - let g:rainbow_active = 1 - let g:rainbow#pairs = [['(', ')'], ['[', ']'], ['{', '}']] - let g:rainbow_conf = {'guis': ['bold']} -" }}} -Plug 'unblevable/quick-scope' -Plug 'ntpeters/vim-better-whitespace' - -" heuristic whitepsace -Plug 'tpope/vim-sleuth' - -" better motion -Plug 'tpope/vim-surround' -Plug 'justinmk/vim-sneak' -" {{{ - let g:sneak#label = 1 - let g:sneak#prompt = ' ' - - " case insensitive - let g:sneak#use_ic_scs = 1 - - " move to next search if cursor hasn't moved - let g:sneak#s_next = 1 -" }}} - -" git tools -Plug 'mhinz/vim-signify' -" {{{ - let g:signify_sign_add = '+' - let g:signify_sign_delete = '-' - let g:signify_sign_change = '~' - - let g:signify_sign_show_count = 0 - let g:signify_sign_show_text = 1 -" }}} -Plug 'tpope/vim-fugitive' - -" fzf -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plug 'junegunn/fzf.vim' -" {{{ - let g:fzf_layout = { 'down': '~40%' } - let g:fzf_preview_window = ['right:50%', 'ctrl-/'] - let g:fzf_buffers_jump = 1 -" }}} -Plug 'antoinemadec/coc-fzf' -Plug 'airblade/vim-rooter' - -" coc -Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} -" {{{ - let g:coc_global_extensions = [ - \ 'coc-actions', - \ 'coc-clangd', - \ 'coc-css', - \ 'coc-docker', - \ 'coc-emmet', - \ 'coc-emoji', - \ 'coc-eslint', - \ 'coc-explorer', - \ 'coc-fish', - \ 'coc-fzf-preview', - \ 'coc-git', - \ 'coc-go', - \ 'coc-groovy', - \ 'coc-highlight', - \ 'coc-html', - \ 'coc-json', - \ 'coc-lists', - \ 'coc-marketplace', - \ 'coc-perl', - \ 'coc-prettier', - \ 'coc-python', - \ 'coc-react-refactor', - \ 'coc-rust-analyzer', - \ 'coc-sh', - \ 'coc-snippets', - \ 'coc-styled-components', - \ 'coc-svg', - \ 'coc-swagger', - \ 'coc-tabnine', - \ 'coc-toml', - \ 'coc-tslint', - \ 'coc-tslint-plugin', - \ 'coc-tsserver', - \ 'coc-vimlsp', - \ 'coc-xml', - \ 'coc-yaml', - \ ] -" }}} - -" ts -Plug 'HerringtonDarkholme/yats.vim' -Plug 'maxmellon/vim-jsx-pretty' - -" elm -Plug 'andys8/vim-elm-syntax' - - -" debugger -Plug 'puremourning/vimspector' -" {{{ - let g:vimspector_enable_mappings = 'HUMAN' -" }}} - -" Terminal -Plug 'kassio/neoterm' - -call plug#end() diff --git a/files/home/.spacemacs b/files/home/.spacemacs deleted file mode 100644 index 2c6c8d4..0000000 --- a/files/home/.spacemacs +++ /dev/null @@ -1,234 +0,0 @@ -;; -*- mode: emacs-lisp; lexical-binding: t -*- -(defun dotspacemacs/layers () - "Layer configuration: -This function should only modify configuration layer settings." - (setq-default - dotspacemacs-distribution 'spacemacs - - dotspacemacs-enable-lazy-installation 'unused - dotspacemacs-ask-for-lazy-installation t - - dotspacemacs-configuration-layer-path '() - dotspacemacs-configuration-layers '( - (typescript :variables - typescript-backend 'lsp - typescript-fmt-tool 'prettier) - react - javascript - auto-completion - better-defaults - emacs-lisp - git - helm - lsp - markdown - multiple-cursors - org - (shell :variables - shell-default-height 30 - shell-default-position 'bottom - shell-default-shell 'multi-term) - spell-checking - syntax-checking - version-control - treemacs) - - dotspacemacs-additional-packages '() - dotspacemacs-frozen-packages '() - dotspacemacs-excluded-packages '() - - dotspacemacs-install-packages 'used-only)) - -(defun dotspacemacs/init () - "Initialization: -This function is called at the very beginning of Spacemacs startup, -before layer configuration. -It should only modify the values of Spacemacs settings." - (setq-default - dotspacemacs-enable-emacs-pdumper nil - dotspacemacs-emacs-pdumper-executable-file "emacs" - dotspacemacs-emacs-dumper-dump-file (format "spacemacs-%s.pdmp" emacs-version) - - dotspacemacs-elpa-https t - dotspacemacs-elpa-timeout 5 - dotspacemacs-elpa-subdirectory 'emacs-version - - dotspacemacs-gc-cons '(100000000 0.1) - - dotspacemacs-read-process-output-max (* 1024 1024) - - dotspacemacs-use-spacelpa nil - dotspacemacs-verify-spacelpa-archives t - - dotspacemacs-check-for-update nil - - - dotspacemacs-editing-style 'hybrid - - dotspacemacs-startup-buffer-show-version t - dotspacemacs-startup-banner 'random - dotspacemacs-startup-lists '((recents . 5) - (projects . 7)) - dotspacemacs-startup-buffer-responsive t - dotspacemacs-startup-buffer-multi-digit-delay 0.4 - - dotspacemacs-new-empty-buffer-major-mode 'text-mode - - dotspacemacs-scratch-mode 'text-mode - dotspacemacs-scratch-buffer-persistent nil - dotspacemacs-scratch-buffer-unkillable nil - dotspacemacs-initial-scratch-message nil - - dotspacemacs-themes '(spacemacs-dark - spacemacs-light) - - dotspacemacs-mode-line-theme '(spacemacs :separator wave :separator-scale 1.5) - - dotspacemacs-colorize-cursor-according-to-state t - - dotspacemacs-default-font '("Source Code Pro" - :size 10.0 - :weight normal - :width normal) - - dotspacemacs-leader-key "SPC" - dotspacemacs-emacs-command-key "SPC" - - dotspacemacs-ex-command-key ":" - dotspacemacs-emacs-leader-key "M-m" - - dotspacemacs-major-mode-leader-key "," - dotspacemacs-major-mode-emacs-leader-key (if window-system "" "C-M-m") - - dotspacemacs-distinguish-gui-tab nil - - dotspacemacs-default-layout-name "Default" - - dotspacemacs-display-default-layout nil - - dotspacemacs-auto-resume-layouts nil - - dotspacemacs-auto-generate-layout-names nil - - dotspacemacs-large-file-size 1 - - dotspacemacs-auto-save-file-location 'cache - - dotspacemacs-max-rollback-slots 5 - - dotspacemacs-enable-paste-transient-state nil - - dotspacemacs-which-key-delay 0.4 - - dotspacemacs-which-key-position 'bottom - - dotspacemacs-switch-to-buffer-prefers-purpose nil - - dotspacemacs-loading-progress-bar nil - - dotspacemacs-fullscreen-at-startup t - dotspacemacs-fullscreen-use-non-native nil - - dotspacemacs-maximized-at-startup nil - - dotspacemacs-undecorated-at-startup nil - - dotspacemacs-active-transparency 90 - - dotspacemacs-inactive-transparency 90 - - dotspacemacs-show-transient-state-title t - - dotspacemacs-show-transient-state-color-guide t - - dotspacemacs-mode-line-unicode-symbols t - - dotspacemacs-smooth-scrolling t - - dotspacemacs-scroll-bar-while-scrolling t - - dotspacemacs-line-numbers 'relative - - dotspacemacs-folding-method 'evil - - dotspacemacs-smartparens-strict-mode nil - - dotspacemacs-activate-smartparens-mode t - - dotspacemacs-smart-closing-parenthesis t - - dotspacemacs-highlight-delimiters 'all - - dotspacemacs-enable-server nil - dotspacemacs-server-socket-dir nil - dotspacemacs-persistent-server nil - - dotspacemacs-search-tools '("rg" "ag" "pt" "ack" "grep") - - dotspacemacs-frame-title-format "%I@%S" - dotspacemacs-icon-title-format nil - - dotspacemacs-show-trailing-whitespace t - dotspacemacs-whitespace-cleanup 'changed - - dotspacemacs-use-clean-aindent-mode t - - dotspacemacs-swap-number-row nil - - dotspacemacs-zone-out-when-idle nil - - dotspacemacs-pretty-docs nil - - dotspacemacs-home-shorten-agenda-source nil - - dotspacemacs-byte-compile nil)) - -(defun dotspacemacs/user-env () - "Environment variables setup. -This function defines the environment variables for your Emacs session. By -default it calls `spacemacs/load-spacemacs-env' which loads the environment -variables declared in `~/.spacemacs.env' or `~/.spacemacs.d/.spacemacs.env'. -See the header of this file for more information." - (spacemacs/load-spacemacs-env)) - -(defun dotspacemacs/user-init () - "Initialization for user code: -This function is called immediately after `dotspacemacs/init', before layer -configuration. -It is mostly for variables that should be set before packages are loaded. -If you are unsure, try setting them in `dotspacemacs/user-config' first.") - - -(defun dotspacemacs/user-load () - "Library to load while dumping. -This function is called only while dumping Spacemacs configuration. You can -`require' or `load' the libraries of your choice that will be included in the -dump.") - - -(defun dotspacemacs/user-config () - "Configuration for user code: -This function is called at the very end of Spacemacs startup, after layer -configuration. -Put your configuration code here, except for variables that should be set -before packages are loaded.") - - -(defun dotspacemacs/emacs-custom-settings () - "Emacs custom settings. -This is an auto-generated function, do not modify its content directly, use -Emacs customize menu instead. -This function is called at the very end of Spacemacs initialization." -(custom-set-variables - '(ansi-color-faces-vector - [default default default italic underline success warning error]) - '(custom-enabled-themes '(spacemacs-dark)) - '(custom-safe-themes - '("bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" default)) - '(evil-want-Y-yank-to-eol nil) - '(package-selected-packages - '(yasnippet-snippets xterm-color vterm unfill treemacs-magit terminal-here smeargle shell-pop orgit-forge orgit org-rich-yank org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download org-cliplink org-brain mwim multi-term mmm-mode markdown-toc magit-section lsp-ui lsp-origami origami helm-org-rifle helm-lsp helm-gitignore helm-git-grep helm-company helm-c-yasnippet gnuplot gitignore-templates gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe+ fringe-helper git-gutter+ gh-md fuzzy forge magit ghub closql emacsql-sqlite emacsql treepy git-commit with-editor transient flyspell-correct-helm flyspell-correct flycheck-pos-tip pos-tip evil-org eshell-z eshell-prompt-extras esh-help browse-at-remote auto-yasnippet auto-dictionary ac-ispell auto-complete tide web-mode typescript-mode rjsx-mode emmet-mode web-beautify tern prettier-js npm-mode nodejs-repl livid-mode skewer-mode js2-refactor yasnippet multiple-cursors js2-mode js-doc import-js grizzl impatient-mode htmlize simple-httpd helm-gtags ggtags dap-mode lsp-treemacs bui lsp-mode markdown-mode counsel-gtags counsel swiper ivy company add-node-modules-path ws-butler writeroom-mode winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package undo-tree treemacs-projectile treemacs-persp treemacs-icons-dired treemacs-evil toc-org symon symbol-overlay string-inflection string-edit spaceline-all-the-icons restart-emacs request rainbow-delimiters quickrun popwin pcre2el password-generator paradox overseer org-superstar open-junk-file nameless multi-line macrostep lorem-ipsum link-hint indent-guide hybrid-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org helm-mode-manager helm-make helm-ls-git helm-flx helm-descbinds helm-ag google-translate golden-ratio font-lock+ flycheck-package flycheck-elsa flx-ido fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-easymotion evil-collection evil-cleverparens evil-args evil-anzu eval-sexp-fu emr elisp-slime-nav editorconfig dumb-jump drag-stuff dotenv-mode dired-quick-sort diminish devdocs define-word column-enforce-mode clean-aindent-mode centered-cursor-mode auto-highlight-symbol auto-compile aggressive-indent ace-link ace-jump-helm-line)) - '(show-paren-mode t)) -(custom-set-faces - ) -) diff --git a/files/home/.ssh/config b/files/ssh/config similarity index 100% rename from files/home/.ssh/config rename to files/ssh/config diff --git a/scripts/_utils.sh b/script/_utils.sh similarity index 92% rename from scripts/_utils.sh rename to script/_utils.sh index ac68224..ef722fb 100755 --- a/scripts/_utils.sh +++ b/script/_utils.sh @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Utility functions for common tasks # @arg $1 URL to download @@ -79,6 +78,14 @@ function stow_package { rm -f $HOME/.profile target=$HOME ;; + CONFIG) + mkdir $HOME/.config + target=$HOME/.config + ;; + SSH) + mkdir $HOME/.ssh + target=$HOME/.ssh + ;; *) ;; esac diff --git a/scripts/install.sh b/script/install similarity index 99% rename from scripts/install.sh rename to script/install index bd0ac49..b8f4cfd 100755 --- a/scripts/install.sh +++ b/script/install @@ -12,7 +12,7 @@ HOST=${HOST:-$(hostname)} NAME=$(basename "$0") REL_DIR=$(dirname "$0") -ABS_DIR=$(readlink -f $REL_DIR/../) # Scripts are nested inside of /scripts +ABS_DIR=$(readlink -f $REL_DIR/../) # Scripts are nested inside of /script UTILS="${REL_DIR}/_utils.sh" CONFIG="${REL_DIR}/install_config.json" diff --git a/scripts/install.d/00-apt.sh b/script/install.d/00-apt.sh similarity index 100% rename from scripts/install.d/00-apt.sh rename to script/install.d/00-apt.sh diff --git a/scripts/install.d/03-ssh.sh b/script/install.d/01-ssh.sh similarity index 100% rename from scripts/install.d/03-ssh.sh rename to script/install.d/01-ssh.sh diff --git a/scripts/install.d/02-fish.sh b/script/install.d/02-fish.sh similarity index 100% rename from scripts/install.d/02-fish.sh rename to script/install.d/02-fish.sh diff --git a/scripts/install.d/10-pyenv-pkglist b/script/install.d/10-pyenv-pkglist similarity index 100% rename from scripts/install.d/10-pyenv-pkglist rename to script/install.d/10-pyenv-pkglist diff --git a/scripts/install.d/10-pyenv.sh b/script/install.d/10-pyenv.sh similarity index 68% rename from scripts/install.d/10-pyenv.sh rename to script/install.d/10-pyenv.sh index d14fda1..f1afff3 100755 --- a/scripts/install.d/10-pyenv.sh +++ b/script/install.d/10-pyenv.sh @@ -5,14 +5,16 @@ if ! bin_in_path "pyenv"; then install_file "$pyenv_list_file" # see https://github.com/pyenv/pyenv-installer - download_run "https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \ + download_run \ + "https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \ bash - fi virtualenv_path="$(pyenv root)/plugins/pyenv-virtualenv" if [ ! -d "$virtualenv_path" ]; then - git clone https://github.com/pyenv/pyenv-virtualenv.git $virtualenv_path + git clone \ + https://github.com/pyenv/pyenv-virtualenv.git \ + $virtualenv_path fi eval "$(pyenv init --path)" diff --git a/scripts/install.d/11-python.sh b/script/install.d/11-python.sh similarity index 100% rename from scripts/install.d/11-python.sh rename to script/install.d/11-python.sh diff --git a/scripts/install.d/13-nvm.sh b/script/install.d/12-node.sh similarity index 72% rename from scripts/install.d/13-nvm.sh rename to script/install.d/12-node.sh index edcca7c..d3cff76 100755 --- a/scripts/install.d/13-nvm.sh +++ b/script/install.d/12-node.sh @@ -13,3 +13,10 @@ nvm install lts/fermium nvm use lts/fermium node --version + +yarn --version + +for dep in $(jq -r ".node_dependencies[]" $CONFIG); do + yarn global add $dep + yarn global upgrade $dep +done diff --git a/scripts/install.d/30-docker.sh b/script/install.d/20-docker.sh similarity index 100% rename from scripts/install.d/30-docker.sh rename to script/install.d/20-docker.sh diff --git a/scripts/install.d/98-apt-clean.sh b/script/install.d/98-apt-clean.sh similarity index 100% rename from scripts/install.d/98-apt-clean.sh rename to script/install.d/98-apt-clean.sh diff --git a/scripts/install.d/99-screenfetch.sh b/script/install.d/99-screenfetch.sh similarity index 100% rename from scripts/install.d/99-screenfetch.sh rename to script/install.d/99-screenfetch.sh diff --git a/scripts/install_config.json b/script/install_config.json similarity index 94% rename from scripts/install_config.json rename to script/install_config.json index e0582de..e07410c 100644 --- a/scripts/install_config.json +++ b/script/install_config.json @@ -91,9 +91,17 @@ "pyvim" ], "stow_packages": [ + { + "name": "config", + "target": "CONFIG" + }, { "name": "home", "target": "HOME" + }, + { + "name": "ssh", + "target": "SSH" } ] } \ No newline at end of file diff --git a/scripts/run.sh b/script/run similarity index 85% rename from scripts/run.sh rename to script/run index edaefcc..3ddf244 100755 --- a/scripts/run.sh +++ b/script/run @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -tag=$(uuidgen) +tag=$(cat /proc/sys/kernel/random/uuid) docker build . \ --build-arg UUID=$tag \ --tag dotfiles:$tag \ diff --git a/scripts/setup.sh b/script/setup similarity index 95% rename from scripts/setup.sh rename to script/setup index 2a8aeff..93c3639 100755 --- a/scripts/setup.sh +++ b/script/setup @@ -30,5 +30,5 @@ tar -C $tmp_dir -zxf $tmp_dest mv $tmp_dir/$repository-$branch/* $setup_dir rm -rf $tmp_dir -echo "Done!" -$setup_dir/scripts/install.sh +# Run installer +$setup_dir/script/install diff --git a/scripts/test.sh b/script/test similarity index 100% rename from scripts/test.sh rename to script/test diff --git a/scripts/install.d/00-apt-pkglist b/scripts/install.d/00-apt-pkglist deleted file mode 100644 index 2bc2679..0000000 --- a/scripts/install.d/00-apt-pkglist +++ /dev/null @@ -1,2 +0,0 @@ -bat -ripgrep diff --git a/scripts/install.d/14-yarn.sh b/scripts/install.d/14-yarn.sh deleted file mode 100755 index d12e319..0000000 --- a/scripts/install.d/14-yarn.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -yarn --version - -for dep in $(jq -r ".node_dependencies[]" $CONFIG); do - yarn global add $dep - yarn global upgrade $dep -done diff --git a/scripts/publish b/scripts/publish deleted file mode 100755 index ff4b735..0000000 --- a/scripts/publish +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -BUCKET=${BUCKET:-"dots.andrejus.dev"} - -NAME=$(basename "$0") -REL_DIR=$(dirname "$0") -ABS_DIR=$(readlink -f $REL_DIR/../) # Scripts are nested inside of /scripts - -# Publish setup script to public bucket -gsutil cp "$ABS_DIR/scripts/setup.sh" "gs://$BUCKET/setup.sh" diff --git a/terraform/module/main.tf b/terraform/module/main.tf deleted file mode 100644 index a355829..0000000 --- a/terraform/module/main.tf +++ /dev/null @@ -1,65 +0,0 @@ -locals { - fqdn = "${var.domain}." -} - -# ================================================================= -# Public bucket for static content with uploader service account -# ================================================================= -resource "google_project_service" "storage" { - disable_on_destroy = false - service = "storage.googleapis.com" -} - -resource "google_service_account" "uploader_sa" { - account_id = "${var.prefix}-uploader-sa" - display_name = "Uploader Service Account" -} - -resource "google_storage_bucket" "bucket" { - name = var.domain - depends_on = [google_project_service.storage] - - location = var.gcs_location - uniform_bucket_level_access = false - website { - main_page_suffix = "index.html" - not_found_page = "index.html" - } -} - -resource "google_storage_bucket_acl" "bucket_acl" { - bucket = google_storage_bucket.bucket.name - - role_entity = [ - "OWNER:project-owners-${var.project_number}", - "OWNER:project-editors-${var.project_number}", - "READER:project-viewers-${var.project_number}", - "OWNER:user-${google_service_account.uploader_sa.email}", - ] -} - -resource "google_storage_default_object_acl" "default_acl" { - bucket = google_storage_bucket.bucket.name - - role_entity = [ - "READER:allUsers", - "OWNER:project-owners-${var.project_number}", - "OWNER:project-editors-${var.project_number}", - "READER:project-viewers-${var.project_number}", - ] -} - -resource "google_storage_bucket_object" "index" { - name = "index.html" - source = "${path.module}/public/index.html" - bucket = google_storage_bucket.bucket.name -} - -resource "google_dns_record_set" "dns_cname_record" { - name = local.fqdn - managed_zone = var.dns_zone - - type = "CNAME" - ttl = var.dns_ttl - rrdatas = ["c.storage.googleapis.com."] -} diff --git a/terraform/module/outputs.tf b/terraform/module/outputs.tf deleted file mode 100644 index d7b9c3b..0000000 --- a/terraform/module/outputs.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "bucket_url" { - value = "storage.googleapis.com/${var.domain}" -} - -output "bucket_link" { - value = google_storage_bucket.bucket.self_link -} diff --git a/terraform/module/public/index.html b/terraform/module/public/index.html deleted file mode 100644 index b64b87f..0000000 --- a/terraform/module/public/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - andrejus.dev - - - - - - - - - -
-

Redirecting to GitHub repo...

-
- - diff --git a/terraform/module/variables.tf b/terraform/module/variables.tf deleted file mode 100644 index fda4a3d..0000000 --- a/terraform/module/variables.tf +++ /dev/null @@ -1,36 +0,0 @@ -variable "prefix" { - description = "Resource prefix" - default = "dots" -} - -variable "project" { - type = string - description = "Google Cloud project to host resources in" -} - -variable "project_number" { - type = string - description = "The numeric project ID" -} - -variable "domain" { - description = "DNS name to serve static content" - type = string -} - -variable "dns_zone" { - description = "Cloud DNS zone to use" - type = string -} - -variable "gcs_location" { - type = string - description = "Google Stoage location to provision resources in" - default = "EU" # Multi-region, Europe -} - -variable "dns_ttl" { - type = number - description = "DNS TTL to use for records" - default = 3600 -}