diff --git a/home/.chezmoiexternal.toml b/home/.chezmoiexternal.toml index 6f87dbed..23c3253b 100644 --- a/home/.chezmoiexternal.toml +++ b/home/.chezmoiexternal.toml @@ -15,26 +15,6 @@ url = "https://github.com/wbthomason/packer.nvim.git" refreshPeriod = "168h" -[".oh-my-zsh"] - type = "archive" - url = "https://github.com/ohmyzsh/ohmyzsh/archive/master.tar.gz" - extact = true - stripComponents = 1 - refreshPeriod = "168h" - -[".oh-my-zsh/custom/themes/dracula"] - type = "archive" - url = "https://github.com/dracula/zsh/archive/master.zip" - exact = true - stripComponents = 1 - refreshPeriod = "168h" - include = ["*/dracula.zsh-theme", "*/lib/**"] - -[".oh-my-zsh/custom/plugins/zsh-syntax-highlighting"] - type = "git-repo" - url = "https://github.com/zsh-users/zsh-syntax-highlighting.git" - refreshPeriod = "168h" - [".config/xmonad/xmonad"] type = "git-repo" url = "https://github.com/xmonad/xmonad" @@ -49,11 +29,3 @@ type = "git-repo" url = "https://codeberg.org/xmobar/xmobar" refreshPeriod = "168h" - -[".config/nnn/plugins"] - type = "archive" - url = "https://github.com/jarun/nnn/archive/master.zip" - exact = true - stripComponents = 2 - refreshPeriod = "168h" - include = ["*/plugins/**"] diff --git a/home/.chezmoiscripts/run_onchange_add-non-steam.sh b/home/.chezmoiscripts/run_onchange_add-non-steam.sh new file mode 100644 index 00000000..9ee1fbfc --- /dev/null +++ b/home/.chezmoiscripts/run_onchange_add-non-steam.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Add non-steam games to steam + +apps=( + "dolphin-emu Dolphin" + "yuzu Yuzu" +) + +for app in "${apps[@]}" +do + set -- $app + steamtinkerlaunch addnonsteamgame -ep="$1" -an="$2" +done diff --git a/scripts/run_chmod-ssh-keys b/home/.chezmoiscripts/run_onchange_chmod-ssh-keys.sh similarity index 100% rename from scripts/run_chmod-ssh-keys rename to home/.chezmoiscripts/run_onchange_chmod-ssh-keys.sh diff --git a/home/bin/executable_linux-add-nonsteam b/home/bin/executable_linux-add-nonsteam new file mode 100644 index 00000000..e69de29b diff --git a/home/dot_aliases b/home/dot_aliases new file mode 100644 index 00000000..69ee93ab --- /dev/null +++ b/home/dot_aliases @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# https://github.com/starr-dusT/dotfiles + +# nixos +alias nixos-update="cd ~/.local/share/chezmoi/provision/nixos && \ + sudo nixos-rebuild switch --flake .#$(hostname) && \ + cd -" +# sway +alias s='sway' + +# tmuxinator +alias tsplat='tmuxinator start splat' +alias tdot='tmuxinator start dot' +alias ttask='tmuxinator start task' + +# chezmoi +alias cc="cd ~/.local/share/chezmoi" +alias cdr="chezmoi apply --verbose --dry-run" +alias ca="chezmoi apply" +alias ce='chezmoi edit' + +# trashcli +alias rm='echo "This is not the command you are looking for."; false' +alias tp='trash-put' +alias te='trash-empty' +alias tl='trash-list' +alias tre='trash-restore' +alias trm='trash-rm' +alias rofi='wayland-rofi' + +# zk +alias cz="cd ~/documents/zet" + +# nnn +alias n="nnn -e" diff --git a/home/dot_bash_profile b/home/dot_bash_profile index 49051350..63224ea0 100644 --- a/home/dot_bash_profile +++ b/home/dot_bash_profile @@ -1,15 +1,32 @@ -##⠀⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀ -#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT) -#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles -#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us -#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀ -# ⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀ -# -# ~/.bash_profile +# https://github.com/starr-dusT/dotfiles -# Get the aliases and functions -[ -f $HOME/.bashrc ] && . $HOME/.bashrc -export PS1="\u@\h \w> " +# Load the shell dotfiles (that are available) +for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do + [ -r "$file" ] && [ -f "$file" ] && source "$file"; +done; +unset file; + +# Case-insensitive globbing (used in pathname expansion) +shopt -s nocaseglob; + +# Append to the Bash history file, rather than overwriting it +shopt -s histappend; + +# Autocorrect typos in path names when using `cd` +shopt -s cdspell; + +# Enable some Bash 4 features when possible: +# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux` +# * Recursive globbing, e.g. `echo **/*.txt` +for option in autocd globstar; do + shopt -s "$option" 2> /dev/null; +done; + +if [ -f /etc/bash_completion ]; then + source /etc/bash_completion; +fi; + +# Enable tab completion for `g` by marking it as an alias for `git` +if type _git &> /dev/null; then + complete -o default -o nospace -F _git g; +fi; diff --git a/home/dot_bash_prompt b/home/dot_bash_prompt new file mode 100644 index 00000000..36832b65 --- /dev/null +++ b/home/dot_bash_prompt @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +# https://github.com/starr-dusT/dotfiles + +prompt_git() { + local s=''; + local branchName=''; + + # Check if the current directory is in a Git repository. + git rev-parse --is-inside-work-tree &>/dev/null || return; + + # Check for what branch we’re on. + # Get the short symbolic ref. If HEAD isn’t a symbolic ref, get a + # tracking remote branch or tag. Otherwise, get the + # short SHA for the latest commit, or give up. + branchName="$(git symbolic-ref --quiet --short HEAD 2> /dev/null || \ + git describe --all --exact-match HEAD 2> /dev/null || \ + git rev-parse --short HEAD 2> /dev/null || \ + echo '(unknown)')"; + + # Early exit for Chromium & Blink repo, as the dirty check takes too long. + # Thanks, @paulirish! + # https://github.com/paulirish/dotfiles/blob/dd33151f/.bash_prompt#L110-L123 + repoUrl="$(git config --get remote.origin.url)"; + if grep -q 'chromium/src.git' <<< "${repoUrl}"; then + s+='*'; + else + # Check for uncommitted changes in the index. + if ! $(git diff --quiet --ignore-submodules --cached); then + s+='+'; + fi; + # Check for unstaged changes. + if ! $(git diff-files --quiet --ignore-submodules --); then + s+='!'; + fi; + # Check for untracked files. + if [ -n "$(git ls-files --others --exclude-standard)" ]; then + s+='?'; + fi; + # Check for stashed files. + if $(git rev-parse --verify refs/stash &>/dev/null); then + s+='$'; + fi; + fi; + + [ -n "${s}" ] && s=" [${s}]"; + + echo -e "${1}${branchName}${2}${s}"; +} + +if tput setaf 1 &> /dev/null; then + tput sgr0; # reset colors + bold=$(tput bold); + reset=$(tput sgr0); + # Solarized colors, taken from http://git.io/solarized-colors. + black=$(tput setaf 0); + blue=$(tput setaf 33); + cyan=$(tput setaf 37); + green=$(tput setaf 64); + orange=$(tput setaf 166); + purple=$(tput setaf 125); + red=$(tput setaf 124); + violet=$(tput setaf 61); + white=$(tput setaf 15); + yellow=$(tput setaf 136); +else + bold=''; + reset="\e[0m"; + black="\e[1;30m"; + blue="\e[1;34m"; + cyan="\e[1;36m"; + green="\e[1;32m"; + orange="\e[1;33m"; + purple="\e[1;35m"; + red="\e[1;31m"; + violet="\e[1;35m"; + white="\e[1;37m"; + yellow="\e[1;33m"; +fi; + +# Highlight the user name when logged in as root. +if [[ "${USER}" == "root" ]]; then + userStyle="${red}"; +else + userStyle="${orange}"; +fi; + +# Highlight the hostname when connected via SSH. +if [[ "${SSH_TTY}" ]]; then + hostStyle="${bold}${red}"; +else + hostStyle="${yellow}"; +fi; + +# Set the terminal title and prompt. +PS1="\[\033]0;\W\007\]"; # working directory base name +PS1+="\[${bold}\]\n"; # newline +PS1+="\[${userStyle}\]\u"; # username +PS1+="\[${white}\] at "; +PS1+="\[${hostStyle}\]\h"; # host +PS1+="\[${white}\] in "; +PS1+="\[${green}\]\w"; # working directory full path +PS1+="\$(prompt_git \"\[${white}\] on \[${violet}\]\" \"\[${blue}\]\")"; # Git repository details +PS1+="\n"; +PS1+="\[${white}\]\$ \[${reset}\]"; # `$` (and reset color) +export PS1; + +PS2="\[${yellow}\]→ \[${reset}\]"; +export PS2; diff --git a/home/dot_bashrc b/home/dot_bashrc index f2f06200..731078b3 100644 --- a/home/dot_bashrc +++ b/home/dot_bashrc @@ -1,43 +1,3 @@ -##⠀⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀ -#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT) -#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles -#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us -#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀ -# ⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀ -# -# Bash config. - -# Source global definitions -if [ -f /etc/bashrc ]; then - . /etc/bashrc -fi - -export LC_COLLATE="C" - -# User specific environment -if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]] -then - PATH="$HOME/.local/bin:$HOME/bin:$PATH" -fi -export PATH - -export EDITOR="/usr/bin/nvim" - -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -export PATH="$HOME/.nimble/bin:$PATH" - -alias spl="tmux_splat" -alias n="nnn -d -e -H -r" -alias s="startx" - -# Chezmoi -alias cmc="chezmoi cd" -alias cmd="chezmoi apply --verbose --dry-run" -alias cma="chezmoi apply" +# https://github.com/starr-dusT/dotfiles +[ -n "$PS1" ] && source ~/.bash_profile; diff --git a/home/dot_config/mimeapps.list b/home/dot_config/mimeapps.list deleted file mode 100644 index 33a77b75..00000000 --- a/home/dot_config/mimeapps.list +++ /dev/null @@ -1,6 +0,0 @@ -[Default Applications] -inode/directory=pcmanfm.desktop; -text/html=firefox.desktop; -x-scheme-handler/http=firefox.desktop; -x-scheme-handler/https=firefox.desktop; -application/pdf=firefox.desktop diff --git a/home/dot_config/nnn/bookmarks/symlink_chezmoi b/home/dot_config/nnn/bookmarks/symlink_chezmoi new file mode 100644 index 00000000..d6ff3883 --- /dev/null +++ b/home/dot_config/nnn/bookmarks/symlink_chezmoi @@ -0,0 +1 @@ +/home/tstarr/.local/share/chezmoi diff --git a/home/dot_config/nnn/bookmarks/symlink_nvim b/home/dot_config/nnn/bookmarks/symlink_nvim new file mode 100644 index 00000000..1973f6da --- /dev/null +++ b/home/dot_config/nnn/bookmarks/symlink_nvim @@ -0,0 +1 @@ +/home/tstarr/.local/share/chezmoi/home/dot_config/nvim diff --git a/home/dot_config/nnn/bookmarks/symlink_zet b/home/dot_config/nnn/bookmarks/symlink_zet new file mode 100644 index 00000000..c46a34bd --- /dev/null +++ b/home/dot_config/nnn/bookmarks/symlink_zet @@ -0,0 +1 @@ +/home/tstarr/documents/zet diff --git a/home/dot_config/nnn/plugins/executable_getdrop b/home/dot_config/nnn/plugins/executable_getdrop new file mode 100755 index 00000000..b422779a --- /dev/null +++ b/home/dot_config/nnn/plugins/executable_getdrop @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if [ ! -e "$1" ] ; then + git annex get "$1" +else + git annex drop "$1" +fi diff --git a/home/dot_config/nvim/after/plugin/keymap/lazygit.lua b/home/dot_config/nvim/after/plugin/keymap/lazygit.lua deleted file mode 100644 index 1fcd3dce..00000000 --- a/home/dot_config/nvim/after/plugin/keymap/lazygit.lua +++ /dev/null @@ -1,8 +0,0 @@ -local wk = require("which-key") - -wk.register({ - g = { - name = "+git", - g = { "LazyGit", "Lazygit" }, - }, -}, { prefix = "" }) diff --git a/home/dot_config/nvim/after/plugin/keymap/remap.lua b/home/dot_config/nvim/after/plugin/keymap/remap.lua index c459a1c6..a0001ca5 100644 --- a/home/dot_config/nvim/after/plugin/keymap/remap.lua +++ b/home/dot_config/nvim/after/plugin/keymap/remap.lua @@ -1,5 +1,30 @@ local wk = require("which-key") +-- Move visual blocks up and down +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- Keep cursor in center while jumping half-pages +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") + +-- Keep cursor in center while searching +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- Change clipboard to clip to +vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +-- Quick fix controls +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +-- Replace word under cursor +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) + wk.register({ -- tab commands t = { diff --git a/home/dot_config/nvim/after/plugin/keymap/vimwiki.lua b/home/dot_config/nvim/after/plugin/keymap/vimwiki.lua deleted file mode 100644 index d62390b7..00000000 --- a/home/dot_config/nvim/after/plugin/keymap/vimwiki.lua +++ /dev/null @@ -1,19 +0,0 @@ -local wk = require("which-key") - -wk.register({ - w = { - name = "+vimwiki", - i = { "VimwikiDiaryIndex", "Diary Index" }, - s = { "VimwikiUISelect", "Select Index" }, - t = { "VimwikiTabIndex", "Index Tab" }, - w = { "VimwikiIndex", "Index" }, - [""] = { - name = "+diary", - i = { "VimwikiDiaryGenerateLinks", "Generate Links" }, - m = { "VimwikiMakeTomorrowDiaryNote", "Make Tomorrow Note" }, - t = { "VimwikiTabMakeDiaryNote", "Make Today Note" }, - w = { "VimwikiDiaryNote", "Today Note" }, - y = { "VimwikiMakeYesterdayDiaryNote", "Make Yesterday Note" } - } - }, -}, { prefix = "" }) diff --git a/home/dot_config/nvim/lua/tstarr/init.lua b/home/dot_config/nvim/lua/tstarr/init.lua index dec09f2e..03659f43 100644 --- a/home/dot_config/nvim/lua/tstarr/init.lua +++ b/home/dot_config/nvim/lua/tstarr/init.lua @@ -1,6 +1,4 @@ require("tstarr.set") require("tstarr.packer") require("tstarr.telescope") -require("tstarr.vimwiki") require("tstarr.which-key") -require("tstarr.iron") diff --git a/home/dot_config/nvim/lua/tstarr/iron.lua b/home/dot_config/nvim/lua/tstarr/iron.lua deleted file mode 100644 index 102674e9..00000000 --- a/home/dot_config/nvim/lua/tstarr/iron.lua +++ /dev/null @@ -1,88 +0,0 @@ -local iron = require("iron.core") -local wk = require("which-key") - -iron.setup { - config = { - -- Whether a repl should be discarded or not - scratch_repl = true, - -- Your repl definitions come here - repl_definition = { - sh = { - -- Can be a table or a function that - -- returns a table (see below) - command = {"zsh"} - }, - python = require("iron.fts.python").ipython - }, - -- How the repl window will be displayed - -- See below for more information - repl_open_cmd = require('iron.view').right("35%"), - }, - -- Iron doesn't set keymaps by default anymore. - -- You can set them here or manually add keymaps to the functions in iron.core - keymaps = { - send_motion = "rm", - visual_send = "rv", - send_file = "rf", - send_line = "rl", - send_mark = "rms", - mark_motion = "rmm", - mark_visual = "rmv", - remove_mark = "rmm", - cr = "r", - interrupt = "r", - exit = "rq", - clear = "rc", - }, - -- If the highlight is on, you can change how it looks - -- For the available options, check nvim_set_hl - highlight = { - italic = true - }, - ignore_blank_lines = true, -- ignore blank lines when sending visual select lines -} - --- Iron also has a list of commands, see :h iron-commands for all available commands -vim.keymap.set('n', 'rs', 'IronRepl') -vim.keymap.set('n', 'rr', 'IronRestart') -vim.keymap.set('n', 'rh', 'IronHide') - --- Define the function to exit terminal mode -local function exit_terminal_mode() - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('', true, false, true), 'n', true) -end - --- Map the Escape key to the exit_terminal_mode function in terminal mode -vim.keymap.set('t', '', function () exit_terminal_mode() end, {noremap = true}) - -wk.register({ - r = { - name = "+iron", - m = "Send Motion", - v = "Send Visual", - f = "Send File", - l = "Send Line", - [""] = "Send Enter", - [""] = "Send Interrupt", - q = "Exit", - c = "Clear REPL", - m = { - name = "+mark", - s = "Send Mark", - m = "Mark Motion", - v = "Mark Visual", - r = "Remove Mark" - } - }, -}, { prefix = "" }) - -wk.register({ - r = { - name = "+iron", - v = "Send Visual", - m = { - name = "+mark", - v = "Mark Visual", - } - }, -}, { prefix = "", mode = "v"}) diff --git a/home/dot_config/nvim/lua/tstarr/packer.lua b/home/dot_config/nvim/lua/tstarr/packer.lua index 0e00ae18..d7cf1b8d 100644 --- a/home/dot_config/nvim/lua/tstarr/packer.lua +++ b/home/dot_config/nvim/lua/tstarr/packer.lua @@ -4,8 +4,14 @@ return require('packer').startup(function(use) -- Packer can manage itself use 'wbthomason/packer.nvim' - -- Colors + -- Apperance use ('dracula/vim') + use('norcalli/nvim-colorizer.lua') + require("colorizer").setup() + + -- Syntax Hilight + use ('alker0/chezmoi.vim') + use ('nathangrigg/vim-beancount') -- IDE use('nvim-lua/plenary.nvim') @@ -15,15 +21,16 @@ return require('packer').startup(function(use) use ('nvim-telescope/telescope.nvim') use ('nvim-telescope/telescope-project.nvim') + -- Editing use ('ThePrimeagen/harpoon') use ('mbbill/undotree') - use ('kdheepak/lazygit.nvim') + use ('folke/which-key.nvim') + use("mickael-menu/zk-nvim") + + -- External + require("zk").setup() + use('mcchrish/nnn.vim') - use({ "iamcco/markdown-preview.nvim", - run = "cd app && npm install", - setup = function() vim.g.mkdp_filetypes = { "markdown" } end, - ft = { "markdown" }, - }) -- LSP use ('neovim/nvim-lspconfig') use ('hrsh7th/cmp-nvim-lsp') @@ -33,18 +40,5 @@ return require('packer').startup(function(use) use ('hrsh7th/nvim-cmp') use ('L3MON4D3/LuaSnip') use ('saadparwaiz1/cmp_luasnip') - use ('alker0/chezmoi.vim') - use ('nathangrigg/vim-beancount') - use ('vimwiki/vimwiki') - use ('folke/which-key.nvim') - use ('hkupty/iron.nvim') - use("mickael-menu/zk-nvim") - require("zk").setup() - use('norcalli/nvim-colorizer.lua') - require("colorizer").setup() - - use('loctvl842/monokai-pro.nvim') - require("monokai-pro").setup() - use('mcchrish/nnn.vim') end) diff --git a/home/dot_config/nvim/lua/tstarr/set.lua b/home/dot_config/nvim/lua/tstarr/set.lua index 2150ec23..bd5a4495 100644 --- a/home/dot_config/nvim/lua/tstarr/set.lua +++ b/home/dot_config/nvim/lua/tstarr/set.lua @@ -41,3 +41,6 @@ vim.opt.shortmess:append("c") vim.g.mapleader = " " vim.opt.colorcolumn = "80" + +-- Open web links with default system application +vim.g.netrw_browsex_viewer="gio open" diff --git a/home/dot_config/nvim/lua/tstarr/vimwiki.lua b/home/dot_config/nvim/lua/tstarr/vimwiki.lua deleted file mode 100644 index 69b1a831..00000000 --- a/home/dot_config/nvim/lua/tstarr/vimwiki.lua +++ /dev/null @@ -1,16 +0,0 @@ -vim.g.vimwiki_list = { - { - path = '~/documents/vimwiki/main', - syntax = 'markdown', - ext = '.md' - } -} - -vim.g.vimwiki_ext2syntax = { - ['.md'] = 'markdown', - ['.markdown'] = 'markdown', - ['.mdown'] = 'markdown', -} - -vim.g.vimwiki_global_ext = 0 -- don't treat all md files as vimwiki -vim.g.vimwiki_markdown_link_ext = 1 diff --git a/home/dot_config/sway/config.tmpl b/home/dot_config/sway/config.tmpl index 22f2d1ad..288f7930 100644 --- a/home/dot_config/sway/config.tmpl +++ b/home/dot_config/sway/config.tmpl @@ -21,7 +21,7 @@ set $tag3 "3:web" set $tag4 "4:dev" set $tag5 "5:web" set $tag6 "6:web" -set $tag7 "7:web" +set $tag7 "7:note" set $tag8 "8:comm" set $e exec swaymsg mode default @@ -104,9 +104,8 @@ for_window [app_id="file"] floating enable, \ #----- BINDING APPLICATIONS TO WORKSPACE #------------------------------------------------------------------------------- -assign [class="Steam"] "1:game" -for_window [class="Steam"] move container to workspace "1:game" -for_window [class="discord"] move container to workspace $tag8 +for_window [class="Steam"] move container to workspace "1:game" +for_window [class="discord"] move container to workspace $tag8 for_window [title="launcher"] floating enable #------------------------------------------------------------------------------- @@ -201,6 +200,8 @@ mode open { bindsym Escape mode default } +for_window [con_mark="SCRATCHPAD_jop"] border pixel 1 + # Scratchpads commands bindsym $mod+c mode scratch mode scratch { diff --git a/home/dot_config/zk/config.toml b/home/dot_config/zk/config.toml new file mode 100644 index 00000000..dafaf2bf --- /dev/null +++ b/home/dot_config/zk/config.toml @@ -0,0 +1,101 @@ +# NOTE SETTINGS +[note] + +# Language used when writing notes. +# This is used to generate slugs or with date formats. +language = "en" + +# The default title used for new note, if no `--title` flag is provided. +default-title = "Untitled" + +# Template used to generate a note's filename, without extension. +filename = "{{id}}-{{slug title}}" + +# The file extension used for the notes. +extension = "md" + +# Template used to generate a note's content. +# If not an absolute path, it is relative to .zk/templates/ +template = "default.md" + +# Length of the generated IDs. +id-length = 4 + +# Letter case for the random IDs, among lower, upper or mixed. +id-case = "lower" + +# EXTRA VARIABLES +[extra] +author = "tstarr" + +[group.daily] +# Directories listed here will automatically use this group when creating notes. +paths = ["journal/daily"] + +[group.daily.note] +# %Y-%m-%d is actually the default format, so you could use {{format-date now}} instead. +filename = "{{format-date now '%Y-%m-%d'}}" +extension = "md" +template = "daily.md" + +# MARKDOWN SETTINGS +[format.markdown] + +# Format used to generate links between notes. +link-format = "markdown" + +# Indicates whether a link's path will be percent-encoded. +link-encode-path = true + +# Indicates whether a link's path file extension will be removed. +link-drop-extension = true + +# Enable support for #hashtags. +hashtags = false + +# Enable support for :colon:separated:tags:. +colon-tags = true + +# EXTERNAL TOOLS +[tool] + +# Default editor used to open notes. When not set, the EDITOR or VISUAL +editor = "nvim" + +# Default shell used by aliases and commands. +shell = "/bin/bash" + +# Pager used to scroll through long output. +pager = "less -FIRX" + +# Command used to preview a note during interactive fzf mode. +fzf-preview = "bat -p --color always {-1}" + +# LSP +[lsp] +[lsp.diagnostics] + +# Warn for dead links between notes. +dead-link = "error" + +# NAMED FILTERS +[filter] +recents = "--sort created- --created-after 'last two weeks'" + +# COMMAND ALIASES +[alias] + +# Admin +commit = '~/.config/zk/scripts/commit.sh $ZK_NOTEBOOK_DIR' +push = 'git push origin master' +conf = 'chezmoi edit ~/.config/zk/config.toml"' + +# Note Creation/Deletion/Editing +ei = "zk edit --interactive && zk commit" +view = "zk list --interactive --format {{path}} | xargs bat --color always" +daily = 'zk new --no-input "journal/daily" && zk commit' +del = 'zk list --interactive --format "{{path}}" | xargs rm && zk commit' +bookmark = '~/.config/zk/scripts/bookmark.sh $ZK_NOTEBOOK_DIR && zk commit' + +# Note Searching +recipe = "zk edit --interactive --tag recipe" diff --git a/home/dot_config/zk/scripts/executable_bookmark.sh b/home/dot_config/zk/scripts/executable_bookmark.sh new file mode 100644 index 00000000..2b0ea0d3 --- /dev/null +++ b/home/dot_config/zk/scripts/executable_bookmark.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +cd "$1" +echo "Input bookmark name: " +read name +link=$(wl-paste) +echo "- [${name}](${link})" >> "$(zk list --match-strategy exact --match "title: 'Bookmarks'" --format "{{path}}")" +cd - diff --git a/home/dot_config/zk/scripts/executable_commit.sh b/home/dot_config/zk/scripts/executable_commit.sh new file mode 100644 index 00000000..e23fefbd --- /dev/null +++ b/home/dot_config/zk/scripts/executable_commit.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Usage: zk-commit + +something_changed=`git status --porcelain` +if [ -n "$something_changed" ]; then + git -C "$1" add . + message=$(git -c color.status=false status | sed -n -r -e '1,/Changes to be committed:/ d' \ + -e '1,3 d' \ + -e '/^Untracked files:/,$ d' \ + -e 's/^\s*//' \ + -e '/./p') + git -C "$1" commit -m "$message" + exit 0 +fi + +# If there are no changes exit with failure +exit 1 diff --git a/home/dot_config/zk/scripts/executable_hierarchy.sh b/home/dot_config/zk/scripts/executable_hierarchy.sh new file mode 100644 index 00000000..231f3905 --- /dev/null +++ b/home/dot_config/zk/scripts/executable_hierarchy.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo "TODO" diff --git a/home/dot_export b/home/dot_export new file mode 100644 index 00000000..7eaf9840 --- /dev/null +++ b/home/dot_export @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# https://github.com/starr-dusT/dotfiles + +# Make vim the default editor. +export EDITOR=nvim + +# Customize prompt +export PROMPT="%{$fg[red]%}%m $PROMPT" + +# NNN exports +export NNN_FCOLORS='0000E6310000000000000000' +export NNN_PLUG='g:getdrop' +export NNN_FIFO="/tmp/nnn.fifo" +export NNN_TRASH=1 diff --git a/home/dot_local/share/applications/SuperSlicer.desktop.tmpl b/home/dot_local/share/applications/SuperSlicer.desktop.tmpl deleted file mode 100644 index ff71cc4e..00000000 --- a/home/dot_local/share/applications/SuperSlicer.desktop.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Application -Terminal=false -Exec=/home/{{ .user }}/.local/bin/SuperSlicer -Name=SuperSlicer -Icon=/home/{{ .user }}/.local/share/icons/SuperSlicer.png diff --git a/home/dot_local/share/applications/Yuzu.desktop.tmpl b/home/dot_local/share/applications/Yuzu.desktop.tmpl deleted file mode 100644 index 47f3c69a..00000000 --- a/home/dot_local/share/applications/Yuzu.desktop.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Application -Terminal=false -Exec=/home/{{ .user }}/.local/bin/Yuzu -Name=Yuzu -Icon=/home/{{ .user }}/.local/share/icons/Yuzu.png diff --git a/home/dot_local/share/icons/SuperSlicer.png b/home/dot_local/share/icons/SuperSlicer.png deleted file mode 100644 index 47d2726a..00000000 Binary files a/home/dot_local/share/icons/SuperSlicer.png and /dev/null differ diff --git a/home/dot_local/share/icons/Yuzu.png b/home/dot_local/share/icons/Yuzu.png deleted file mode 100644 index 228a68f1..00000000 Binary files a/home/dot_local/share/icons/Yuzu.png and /dev/null differ diff --git a/home/dot_path b/home/dot_path new file mode 100644 index 00000000..1ed81769 --- /dev/null +++ b/home/dot_path @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# https://github.com/starr-dusT/dotfiles + +# Add `~/bin` to the `$PATH` +export PATH="$HOME/bin:$PATH"; + +if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then + PATH="$HOME/.local/bin:$HOME/bin:$PATH"; +fi + +if ! [[ "$PATH" =~ "$HOME/.nimble/bin:" ]]; then + PATH="$HOME/.nimble/bin:$PATH"; +fi + +if ! [[ "$PATH" =~ "$HOME/.cargo/bin:" ]]; then + PATH="$HOME/.cargo/bin:$PATH" ; +fi +export PATH diff --git a/home/dot_xinitrc b/home/dot_xinitrc deleted file mode 100644 index cd9618d4..00000000 --- a/home/dot_xinitrc +++ /dev/null @@ -1,3 +0,0 @@ -exec dbus-launch xmonad -#exec dbus-launch i3 -#exec dbus-launch qtile diff --git a/home/dot_zshrc b/home/dot_zshrc deleted file mode 100644 index 06bd8556..00000000 --- a/home/dot_zshrc +++ /dev/null @@ -1,75 +0,0 @@ -##⠀⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀ -#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT) -#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles -#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us -#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀ -# ⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀ -# -# Zsh config. - -# Zsh specific config -export ZSH="$HOME/.oh-my-zsh" - -DISABLE_AUTO_UPDATE="true" -plugins=(git zsh-syntax-highlighting fzf-dir-navigator) -ZSH_THEME="dracula/dracula" - -source $ZSH/oh-my-zsh.sh - -# Export PATHs -export EDITOR=nvim - -if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then PATH="$HOME/.local/bin:$HOME/bin:$PATH"; fi -if ! [[ "$PATH" =~ "$HOME/.nimble/bin:" ]]; then PATH="$HOME/.nimble/bin:$PATH"; fi -if ! [[ "$PATH" =~ "$HOME/.cargo/bin:" ]]; then PATH="$HOME/.cargo/bin:$PATH" ; fi - -export PATH -export PROMPT="%{$fg[red]%}%m $PROMPT" - -# Create Aliases - -# Nixos -alias nixos-update="cd ~/.local/share/chezmoi/provision/nixos && \ - sudo nixos-rebuild switch --flake .#$(hostname) && \ - cd -" - -# Sway -alias s='sway' - -# tmuxinator -alias tsplat='tmuxinator start splat' -alias tdot='tmuxinator start dot' -alias ttask='tmuxinator start task' - -# Chezmoi -alias cc="cd ~/.local/share/chezmoi" -alias cdr="chezmoi apply --verbose --dry-run" -alias ca="chezmoi apply" -alias ce='chezmoi edit' - -# trashcli -alias rm='echo "This is not the command you are looking for."; false' -alias tp='trash-put' -alias te='trash-empty' -alias tl='trash-list' -alias tre='trash-restore' -alias trm='trash-rm' -alias rofi='wayland-rofi' - -# Fedora -alias update-grub='sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg' - -# Void -alias xi="sudo xbps-install" -alias xr="sudo xbps-remove" -alias xl="void-list-packages" - -# nnn -alias n="nnn -e" -export NNN_FCOLORS='0000E6310000000000000000' -export NNN_PLUG='f:finder;o:fzopen;d:diffs;t:nmount;v:imgview;q:preview-tui' -export NNN_FIFO="/tmp/nnn.fifo" -export NNN_TRASH=1 diff --git a/provision/nixos/additional-setup.md b/provision/nixos/additional-setup.md index 47436310..efcd61fc 100644 --- a/provision/nixos/additional-setup.md +++ b/provision/nixos/additional-setup.md @@ -2,7 +2,7 @@ The following documents some NixOS setup that wasn't automated. -## Wireguard Client  +## Wireguard Client Wireguard is nice for a home vpn and [pivpn](https://pivpn.io/) makes it easy. Currently my scripts for controlling (and visualizing the state of the vpn) @@ -18,7 +18,7 @@ nmcli connection import type wireguard file 3. Use `nm-connection-editor` to disable automatic connection 4. Connect to vpn with `nmcli connection up -## Mount network drives  +## Mount network drives I find fstab messing about more trobule than it is worth. Credentials are stored in ~/.smb. Mount network drives when needed with the following command: @@ -37,36 +37,11 @@ These two folders are symlinked to the home folder where taskwarrior/timewarrior expects them. - `warrior` - contains text files associated with taskwarrior (mostly from taskopen). -- `phone photos` - personal photos synched from android. -- `phone screenshots` - personal screenshots synced from android. -- `ssh_keys` - contains ssh keys for git remotes (~/.ssh/keys) - `vimwiki` - contains text files associate with my personal vimwiki. -## Git SSH for personal and work +## Git-annex -- ~/.gitconfig - personal github configuration. -- ~/devel/work/.gitconfig - work gitlab configuration. - -Gitconfig files for SSH git push/pull are automaitcally placed. The only -additional configuration required is the transfer of SSH keys (see Syncthing -section). - -## Firefox  - -Transfer the `.mozilla` folder from install-to-install to maintain Firefox -settings and configurations. - -## Yuzu - -Copy over the `~/.config/yuzu` and `~/.local/share/yuzu` from prior install. - -## Themeing (is that a word?) - -### Alacritty -TODO - -### ZSH -TODO - -### Sway -TODO +I use [git-annex](https://git-annex.branchable.com/walkthrough/) to sync some +of the large files (mostly roms) that I don't want to have fill copies on each +machine. +- `roms` - `~/mnt/engi/media/roms` from Torus. diff --git a/provision/nixos/hosts/bulwark/home-configuration.nix b/provision/nixos/hosts/bulwark/home-configuration.nix index 3b5e7a48..aff8a7e3 100644 --- a/provision/nixos/hosts/bulwark/home-configuration.nix +++ b/provision/nixos/hosts/bulwark/home-configuration.nix @@ -8,8 +8,7 @@ chezmoi rbw zk - joplin - joplin-desktop + bat ]; home.stateVersion = "23.05"; diff --git a/provision/nixos/hosts/kestrel/configuration.nix b/provision/nixos/hosts/kestrel/configuration.nix index d35267bd..a50d7faf 100644 --- a/provision/nixos/hosts/kestrel/configuration.nix +++ b/provision/nixos/hosts/kestrel/configuration.nix @@ -40,11 +40,6 @@ time.timeZone = "America/Los_Angeles"; i18n.defaultLocale = "en_US.UTF-8"; - # Enable sound. - sound.enable = true; - hardware.pulseaudio.enable = true; - hardware.pulseaudio.support32Bit = true; - # Add fonts fonts.fonts = with pkgs; [ nerdfonts @@ -54,68 +49,18 @@ virtualisation.docker.enable = true; virtualisation.docker.storageDriver = "btrfs"; - # Enable zsh - programs.zsh.enable = true; - # Define user account. users.users.${user} = { isNormalUser = true; extraGroups = [ "wheel" "docker" "libvirtd" ]; # Enable ‘sudo’ for the user. - shell = pkgs.zsh; + shell = pkgs.bash; }; - xdg.portal = { - enable = true; - gtkUsePortal = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim - git - killall - pciutils - syncthing - pinentry-curses - trash-cli - unzip - nnn - advcpmv - ]; - - # Enable user services - services = { - gvfs.enable = true; # USB automount - blueman.enable = true; - printing.enable = true; - printing.drivers = [ pkgs.hplip ]; - avahi.enable = true; - avahi.nssmdns = true; - syncthing = { - enable = true; - user = "${user}"; - dataDir = "/home/${user}/sync"; - configDir = "/home/${user}/.config/syncthing"; - }; - }; - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - services.pcscd.enable = true; - programs.gnupg.agent = { - enable = true; - pinentryFlavor = "curses"; - enableSSHSupport = true; - }; - # Enable modules imports = [ ../../modules ]; modules = { - services = { - samba-client.enable = true; - virt-manager.enable = true; + desktop = { + sway.enable = true; }; devel = { tooling.enable = true; @@ -125,10 +70,17 @@ gaming = { steam.enable = true; }; - desktop = { - sway.enable = true; + services = { + samba-client.enable = true; + virt-manager.enable = true; + syncthing.enable = true; + peripherals.enable = true; + }; + system = { + terminal.enable = true; + ssh.enable = true; }; }; - - system.stateVersion = "23.05"; # Did you read the comment? + # Did you read the comment? + system.stateVersion = "23.05"; } diff --git a/provision/nixos/hosts/kestrel/home-configuration.nix b/provision/nixos/hosts/kestrel/home-configuration.nix index 39f0af52..c71f4772 100644 --- a/provision/nixos/hosts/kestrel/home-configuration.nix +++ b/provision/nixos/hosts/kestrel/home-configuration.nix @@ -15,8 +15,7 @@ chezmoi rbw zk - joplin - joplin-desktop + bat ]; home.stateVersion = "23.05"; diff --git a/provision/nixos/modules/default.nix b/provision/nixos/modules/default.nix index efa58c8d..72799026 100644 --- a/provision/nixos/modules/default.nix +++ b/provision/nixos/modules/default.nix @@ -1,4 +1,4 @@ { ... }: { - imports = [ ./desktop ./gaming ./devel ./services ]; + imports = [ ./desktop ./gaming ./devel ./services ./system ]; } diff --git a/provision/nixos/modules/desktop/sway.nix b/provision/nixos/modules/desktop/sway.nix index dc6fe217..201b3e50 100644 --- a/provision/nixos/modules/desktop/sway.nix +++ b/provision/nixos/modules/desktop/sway.nix @@ -71,11 +71,33 @@ in { # The portal interfaces include APIs for file access, opening URIs, # printing and others. services.dbus.enable = true; - xdg.portal = { - enable = true; - wlr.enable = true; - # gtk portal needed to make gtk apps happy - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + xdg = { + portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + mime = { + enable = true; + defaultApplications = { + "text/plain" = [ "nvim.desktop" ]; + "inode/directory" = [ "pcmanfm.desktop" ]; + "text/html" = [ "brave-browser.desktop" ]; + "x-scheme-handler/http" = [ "brave-browser.desktop" ]; + "x-scheme-handler/https" = [ "brave-browser.desktop" ]; + "x-scheme-handler/ftp" = [ "brave-browser.desktop" ]; + "x-scheme-handler/chrome" = [ "brave-browser.desktop" ]; + "x-scheme-handler/about" = [ "brave-browser.desktop" ]; + "x-scheme-handler/unknown" = [ "brave-browser.desktop" ]; + "application/x-extension-htm" = [ "brave-browser.desktop" ]; + "application/x-extension-html" = [ "brave-browser.desktop" ]; + "application/x-extension-shtml" = [ "brave-browser.desktop" ]; + "application/xhtml+xml" = [ "brave-browser.desktop" ]; + "application/x-extension-xhtml" = [ "brave-browser.desktop" ]; + "application/x-extension-xht" = [ "brave-browser.desktop" ]; + "application/pdf" = [ "brave-browser.desktop" ]; + }; + }; }; # enable sway window manager diff --git a/provision/nixos/modules/devel/tooling.nix b/provision/nixos/modules/devel/tooling.nix index 6db07d90..36276788 100644 --- a/provision/nixos/modules/devel/tooling.nix +++ b/provision/nixos/modules/devel/tooling.nix @@ -7,15 +7,15 @@ let in { options.modules.devel.tooling.enable = lib.mkEnableOption "tooling"; config = lib.mkIf cfg.enable { - # Install packages environment.systemPackages = with pkgs; [ - neovim - ripgrep - tmux - tmuxp - lazygit - git-annex + cmake + gcc + coreutils + gnumake + # TODO: Move somewhere else + pandoc + gollum ]; }; } diff --git a/provision/nixos/modules/gaming/steam.nix b/provision/nixos/modules/gaming/steam.nix index b3205f88..2020a057 100644 --- a/provision/nixos/modules/gaming/steam.nix +++ b/provision/nixos/modules/gaming/steam.nix @@ -16,6 +16,7 @@ in { environment.systemPackages = [ pkgs.steam + pkgs.steamtinkerlaunch pkgs-unstable.yuzu-early-access pkgs.dolphin-emu pkgs-unstable.sunshine diff --git a/provision/nixos/modules/services/default.nix b/provision/nixos/modules/services/default.nix index d8b18134..ecbd0763 100644 --- a/provision/nixos/modules/services/default.nix +++ b/provision/nixos/modules/services/default.nix @@ -1,4 +1,4 @@ { ... }: { - imports = [ ./samba-server.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ]; + imports = [ ./syncthing.nix ./samba-server.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ./peripherals.nix ]; } diff --git a/provision/nixos/modules/services/peripherals.nix b/provision/nixos/modules/services/peripherals.nix new file mode 100644 index 00000000..6648802b --- /dev/null +++ b/provision/nixos/modules/services/peripherals.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.modules.services.peripherals; +in { + options.modules.services.peripherals.enable = lib.mkEnableOption "peripherals"; + config = lib.mkIf cfg.enable { + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + hardware.pulseaudio.support32Bit = true; + + services = { + gvfs.enable = true; + blueman.enable = true; + printing.enable = true; + printing.drivers = [ pkgs.hplip ]; + avahi.enable = true; + avahi.nssmdns = true; + }; + }; +} diff --git a/provision/nixos/modules/services/syncthing.nix b/provision/nixos/modules/services/syncthing.nix new file mode 100644 index 00000000..8ea1ebec --- /dev/null +++ b/provision/nixos/modules/services/syncthing.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.modules.services.syncthing; +in { + options.modules.services.syncthing.enable = lib.mkEnableOption "syncthing"; + config = lib.mkIf cfg.enable { + # Install packages + environment.systemPackages = with pkgs; [ syncthing ]; + services.syncthing = { + enable = true; + user = "${user}"; + configDir = "/home/${user}/.config/syncthing"; + }; + }; +} diff --git a/provision/nixos/modules/system/default.nix b/provision/nixos/modules/system/default.nix new file mode 100644 index 00000000..3d1a89d9 --- /dev/null +++ b/provision/nixos/modules/system/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./terminal.nix ./ssh.nix ]; +} diff --git a/provision/nixos/modules/system/ssh.nix b/provision/nixos/modules/system/ssh.nix new file mode 100644 index 00000000..aa7f693c --- /dev/null +++ b/provision/nixos/modules/system/ssh.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, user, ... }: + +let cfg = config.modules.system.ssh; +in { + options.modules.system.ssh.enable = lib.mkEnableOption "ssh"; + config = lib.mkIf cfg.enable { + # Enable the OpenSSH daemon. + services.openssh.enable = true; + services.pcscd.enable = true; + programs.gnupg.agent = { + enable = true; + pinentryFlavor = "curses"; + enableSSHSupport = true; + }; + }; +} diff --git a/provision/nixos/modules/system/terminal.nix b/provision/nixos/modules/system/terminal.nix new file mode 100644 index 00000000..6416305b --- /dev/null +++ b/provision/nixos/modules/system/terminal.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, user, ... }: + +let cfg = config.modules.system.terminal; +in { + options.modules.system.terminal.enable = lib.mkEnableOption "terminal"; + config = lib.mkIf cfg.enable { + # Install packages + environment.systemPackages = with pkgs; [ + bash + bash-completion + neovim + ripgrep + tmux + tmuxp + git + git-annex + killall + pciutils + pinentry-curses + trash-cli + unzip + nnn + advcpmv + ]; + }; +}