From 8cd3ca08d1548455465beabaf65ad8b5e90cd8fa Mon Sep 17 00:00:00 2001 From: James Walker Date: Tue, 28 Sep 2021 21:37:26 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20major=20cleanup.=20re-thinking?= =?UTF-8?q?=20this=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/.default-gems | 6 - config/.default-npm-packages | 2 - config/.default-python-packages | 6 - config/.gemrc | 1 - config/.mackup.cfg | 18 -- config/.mackup/asdf.cfg | 6 - config/.mackup/emacs-org.cfg | 5 - config/.mackup/exercism.cfg | 5 - config/.psqlrc | 3 - config/.railsrc | 1 - config/.screenrc | 15 -- config/.ssh/.gitignore | 4 - config/.timetrap.yml | 13 -- config/.zsh/custom/plugins/gh/_gh | 284 ---------------------------- config/.zsh/custom/walkah.zsh | 1 - config/.zsh/custom/walkah.zsh-theme | 18 -- darwin/homebrew.nix | 3 +- home.nix | 53 ++---- modules/elixir.nix | 7 - modules/golang.nix | 22 --- modules/haskell.nix | 15 -- modules/nodejs.nix | 10 - modules/python.nix | 12 -- modules/ruby.nix | 7 - modules/rust.nix | 6 - 25 files changed, 17 insertions(+), 506 deletions(-) delete mode 100644 config/.default-gems delete mode 100644 config/.default-npm-packages delete mode 100644 config/.default-python-packages delete mode 100644 config/.gemrc delete mode 100644 config/.mackup.cfg delete mode 100644 config/.mackup/asdf.cfg delete mode 100644 config/.mackup/emacs-org.cfg delete mode 100644 config/.mackup/exercism.cfg delete mode 100644 config/.psqlrc delete mode 100644 config/.railsrc delete mode 100644 config/.screenrc delete mode 100644 config/.ssh/.gitignore delete mode 100644 config/.timetrap.yml delete mode 100644 config/.zsh/custom/plugins/gh/_gh delete mode 100644 config/.zsh/custom/walkah.zsh delete mode 100644 config/.zsh/custom/walkah.zsh-theme delete mode 100644 modules/elixir.nix delete mode 100644 modules/golang.nix delete mode 100644 modules/haskell.nix delete mode 100644 modules/nodejs.nix delete mode 100644 modules/python.nix delete mode 100644 modules/ruby.nix delete mode 100644 modules/rust.nix diff --git a/config/.default-gems b/config/.default-gems deleted file mode 100644 index e5413a6..0000000 --- a/config/.default-gems +++ /dev/null @@ -1,6 +0,0 @@ -bundler -cocoapods -jekyll -homesick -rails -rubocop diff --git a/config/.default-npm-packages b/config/.default-npm-packages deleted file mode 100644 index 8fbcf1e..0000000 --- a/config/.default-npm-packages +++ /dev/null @@ -1,2 +0,0 @@ -expo-cli -yarn diff --git a/config/.default-python-packages b/config/.default-python-packages deleted file mode 100644 index e80fb01..0000000 --- a/config/.default-python-packages +++ /dev/null @@ -1,6 +0,0 @@ -flake8 -pipenv -pylint -pytest -pytest-cache -wakatime diff --git a/config/.gemrc b/config/.gemrc deleted file mode 100644 index 6153a6e..0000000 --- a/config/.gemrc +++ /dev/null @@ -1 +0,0 @@ -gem: --no-ri --no-rdoc diff --git a/config/.mackup.cfg b/config/.mackup.cfg deleted file mode 100644 index 0d4f314..0000000 --- a/config/.mackup.cfg +++ /dev/null @@ -1,18 +0,0 @@ -[storage] -engine = file_system -path = Sync - -directory = Config - -[applications_to_sync] -asdf -aws -emacs-org -exercism -myrepos -ngrok -npm -ssh - -[applications_to_ignore] -gnupg diff --git a/config/.mackup/asdf.cfg b/config/.mackup/asdf.cfg deleted file mode 100644 index df7bf99..0000000 --- a/config/.mackup/asdf.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[application] -name = asdf - -[configuration_files] -.asdfrc -.tool-versions diff --git a/config/.mackup/emacs-org.cfg b/config/.mackup/emacs-org.cfg deleted file mode 100644 index a3b5d11..0000000 --- a/config/.mackup/emacs-org.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[application] -name = emacs-org - -[configuration_files] -.org diff --git a/config/.mackup/exercism.cfg b/config/.mackup/exercism.cfg deleted file mode 100644 index 2a2fa66..0000000 --- a/config/.mackup/exercism.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[application] -name = Exercism - -[configuration_files] -.config/exercism/user.json diff --git a/config/.psqlrc b/config/.psqlrc deleted file mode 100644 index 2a9e523..0000000 --- a/config/.psqlrc +++ /dev/null @@ -1,3 +0,0 @@ -\x auto -\pset null 'NULL' - diff --git a/config/.railsrc b/config/.railsrc deleted file mode 100644 index 9a34b2e..0000000 --- a/config/.railsrc +++ /dev/null @@ -1 +0,0 @@ ---database=postgresql diff --git a/config/.screenrc b/config/.screenrc deleted file mode 100644 index bb95702..0000000 --- a/config/.screenrc +++ /dev/null @@ -1,15 +0,0 @@ -# walkah's screenrc -# -# $Id: .screenrc,v 1.8 2007-03-30 02:31:27 walkah Exp $ - -# no startup message -startup_message off - -# i like the caption at the bottom, so i know what screen i'm on -caption always "%w %-= %m/%d/%y %C%a" - -# i use ctrl-a waay too much in emacs/readline remap to ctrl-o -escape ^Oo - -hardstatus off -hardstatus string "%H:%t [%n]" diff --git a/config/.ssh/.gitignore b/config/.ssh/.gitignore deleted file mode 100644 index 5215752..0000000 --- a/config/.ssh/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -environment* -id_dsa -known_hosts -*.pem \ No newline at end of file diff --git a/config/.timetrap.yml b/config/.timetrap.yml deleted file mode 100644 index 9340ff4..0000000 --- a/config/.timetrap.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -database_file: <%= File.expand_path("~/.timetrap/timetrap.db") %> -round_in_seconds: 900 -append_notes_delimiter: ", " -formatter_search_paths: -- <%= File.expand_path("~/.timetrap/formatters") %> -default_formatter: text -auto_sheet: dotfiles -auto_sheet_search_paths: -- <%= File.expand_path("~/.timetrap/auto_sheets") %> -default_command: -auto_checkout: false -require_note: false diff --git a/config/.zsh/custom/plugins/gh/_gh b/config/.zsh/custom/plugins/gh/_gh deleted file mode 100644 index 15d071b..0000000 --- a/config/.zsh/custom/plugins/gh/_gh +++ /dev/null @@ -1,284 +0,0 @@ -#compdef _gh gh - - -function _gh { - local -a commands - - _arguments -C \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' \ - '--version[Show gh version]' \ - "1: :->cmnds" \ - "*::arg:->args" - - case $state in - cmnds) - commands=( - "completion:Generate shell completion scripts" - "help:Help about any command" - "issue:Create and view issues" - "pr:Create, view, and checkout pull requests" - "repo:Create, clone, fork, and view repositories" - ) - _describe "command" commands - ;; - esac - - case "$words[1]" in - completion) - _gh_completion - ;; - help) - _gh_help - ;; - issue) - _gh_issue - ;; - pr) - _gh_pr - ;; - repo) - _gh_repo - ;; - esac -} - -function _gh_completion { - _arguments \ - '(-s --shell)'{-s,--shell}'[Shell type: {bash|zsh|fish|powershell}]:' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_help { - _arguments \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - - -function _gh_issue { - local -a commands - - _arguments -C \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' \ - "1: :->cmnds" \ - "*::arg:->args" - - case $state in - cmnds) - commands=( - "create:Create a new issue" - "list:List and filter issues in this repository" - "status:Show status of relevant issues" - "view:View an issue" - ) - _describe "command" commands - ;; - esac - - case "$words[1]" in - create) - _gh_issue_create - ;; - list) - _gh_issue_list - ;; - status) - _gh_issue_status - ;; - view) - _gh_issue_view - ;; - esac -} - -function _gh_issue_create { - _arguments \ - '(-b --body)'{-b,--body}'[Supply a body. Will prompt for one otherwise.]:' \ - '(-t --title)'{-t,--title}'[Supply a title. Will prompt for one otherwise.]:' \ - '(-w --web)'{-w,--web}'[Open the browser to create an issue]' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_issue_list { - _arguments \ - '(-a --assignee)'{-a,--assignee}'[Filter by assignee]:' \ - '(-A --author)'{-A,--author}'[Filter by author]:' \ - '(*-l *--label)'{\*-l,\*--label}'[Filter by label]:' \ - '(-L --limit)'{-L,--limit}'[Maximum number of issues to fetch]:' \ - '(-s --state)'{-s,--state}'[Filter by state: {open|closed|all}]:' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_issue_status { - _arguments \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_issue_view { - _arguments \ - '(-w --web)'{-w,--web}'[Open issue in browser]' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - - -function _gh_pr { - local -a commands - - _arguments -C \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' \ - "1: :->cmnds" \ - "*::arg:->args" - - case $state in - cmnds) - commands=( - "checkout:Check out a pull request in Git" - "create:Create a pull request" - "list:List and filter pull requests in this repository" - "status:Show status of relevant pull requests" - "view:View a pull request in the browser" - ) - _describe "command" commands - ;; - esac - - case "$words[1]" in - checkout) - _gh_pr_checkout - ;; - create) - _gh_pr_create - ;; - list) - _gh_pr_list - ;; - status) - _gh_pr_status - ;; - view) - _gh_pr_view - ;; - esac -} - -function _gh_pr_checkout { - _arguments \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_pr_create { - _arguments \ - '(-B --base)'{-B,--base}'[The branch into which you want your code merged]:' \ - '(-b --body)'{-b,--body}'[Supply a body. Will prompt for one otherwise.]:' \ - '(-d --draft)'{-d,--draft}'[Mark pull request as a draft]' \ - '(-f --fill)'{-f,--fill}'[Do not prompt for title/body and just use commit info]' \ - '(-t --title)'{-t,--title}'[Supply a title. Will prompt for one otherwise.]:' \ - '(-w --web)'{-w,--web}'[Open the web browser to create a pull request]' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_pr_list { - _arguments \ - '(-a --assignee)'{-a,--assignee}'[Filter by assignee]:' \ - '(-B --base)'{-B,--base}'[Filter by base branch]:' \ - '(*-l *--label)'{\*-l,\*--label}'[Filter by label]:' \ - '(-L --limit)'{-L,--limit}'[Maximum number of items to fetch]:' \ - '(-s --state)'{-s,--state}'[Filter by state: {open|closed|merged|all}]:' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_pr_status { - _arguments \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_pr_view { - _arguments \ - '(-w --web)'{-w,--web}'[Open pull request in browser]' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - - -function _gh_repo { - local -a commands - - _arguments -C \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' \ - "1: :->cmnds" \ - "*::arg:->args" - - case $state in - cmnds) - commands=( - "clone:Clone a repository locally" - "create:Create a new repository" - "fork:Create a fork of a repository" - "view:View a repository in the browser" - ) - _describe "command" commands - ;; - esac - - case "$words[1]" in - clone) - _gh_repo_clone - ;; - create) - _gh_repo_create - ;; - fork) - _gh_repo_fork - ;; - view) - _gh_repo_view - ;; - esac -} - -function _gh_repo_clone { - _arguments \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_repo_create { - _arguments \ - '(-d --description)'{-d,--description}'[Description of repository]:' \ - '--enable-issues[Enable issues in the new repository]' \ - '--enable-wiki[Enable wiki in the new repository]' \ - '(-h --homepage)'{-h,--homepage}'[Repository home page URL]:' \ - '--public[Make the new repository public]' \ - '(-t --team)'{-t,--team}'[The name of the organization team to be granted access]:' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_repo_fork { - _arguments \ - '--clone[Clone fork: {true|false|prompt}]' \ - '--remote[Add remote for fork: {true|false|prompt}]' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - -function _gh_repo_view { - _arguments \ - '(-w --web)'{-w,--web}'[Open repository in browser]' \ - '--help[Show help for command]' \ - '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' -} - diff --git a/config/.zsh/custom/walkah.zsh b/config/.zsh/custom/walkah.zsh deleted file mode 100644 index d01ec84..0000000 --- a/config/.zsh/custom/walkah.zsh +++ /dev/null @@ -1 +0,0 @@ -# oh-my-zsh complains without a .zsh file in here diff --git a/config/.zsh/custom/walkah.zsh-theme b/config/.zsh/custom/walkah.zsh-theme deleted file mode 100644 index 47a7c13..0000000 --- a/config/.zsh/custom/walkah.zsh-theme +++ /dev/null @@ -1,18 +0,0 @@ -# walkah ZSH Theme - -if [ -z $SSH_CONNECTION ]; then HCOLOR="green"; else HCOLOR="blue"; fi -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -function asdf_prompt() { - echo $(asdf current $1|awk '{print $2}') -} - -PROMPT='%{$fg[$HCOLOR]%}%m%{$reset_color%}:$(shrink_path -f) $(git_prompt_info)%{$fg[red]%}%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -if (( $+commands[asdf] )); then - RPS1='%{$fg[cyan]%}(%{$fg[red]%}$(asdf_prompt ruby) %{$fg[green]%}$(asdf_prompt nodejs) %{$fg[blue]%}$(asdf_prompt python)%{$fg[cyan]%}) %{$reset_color%}${return_code}' -fi -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}±%{$fg[yellow]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}✗%{$reset_color%}" diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index 000dbfe..6831407 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -44,9 +44,7 @@ "iterm2" "keybase" "logitech-options" - "microsoft-auto-update" "microsoft-edge" - "microsoft-office" "minecraft" "obsidian" "plexamp" @@ -70,6 +68,7 @@ Magnet = 441258766; Parcel = 639968404; Reeder = 1529448980; + Tailscale = 1475387142; Todoist = 585829637; UlyssesMac = 1225570693; Xcode = 497799835; diff --git a/home.nix b/home.nix index 7af280e..19f68ff 100644 --- a/home.nix +++ b/home.nix @@ -1,14 +1,4 @@ { config, pkgs, ... }: { - imports = [ - ./modules/elixir.nix - ./modules/golang.nix - ./modules/haskell.nix - ./modules/nodejs.nix - ./modules/python.nix - ./modules/ruby.nix - ./modules/rust.nix - ]; - # Let Home Manager install and manage itself. programs.home-manager.enable = true; @@ -17,27 +7,21 @@ # home.username = builtins.getEnv "USER"; # home.homeDirectory = builtins.getEnv "HOME"; - home.sessionPath = [ "$HOME/.local/bin" "$HOME/.emacs.d/bin" ]; + home.sessionPath = + [ "$HOME/.local/bin" "$HOME/.emacs.d/bin" "$HOME/.cargo/bin" ]; home.packages = with pkgs; [ - aws - cmake direnv - docker - docker-compose + exercism fd git gitAndTools.gh - google-cloud-sdk - heroku htop jq mr niv nixfmt - pinentry ripgrep - sqlite wakatime ]; @@ -54,6 +38,10 @@ recursive = true; }; + home.file.".ghci".text = '' + :set prompt "λ> " + ''; + programs = { zsh = { enable = true; @@ -62,17 +50,22 @@ oh-my-zsh = { enable = true; plugins = [ - "asdf" + "bundler" "direnv" "docker" "docker-compose" - "gcloud" "git" + "golang" + "mix" + "rails" "ssh-agent" "tmux" ]; }; - sessionVariables = { EDITOR = "vim"; }; + sessionVariables = { + EDITOR = "vim"; + GOPATH = "$HOME/.go"; + }; }; dircolors = { enable = true; @@ -145,27 +138,13 @@ emacs = { enable = true; - package = if (pkgs.stdenv.isLinux) then pkgs.emacs else pkgs.emacsMacport; + package = pkgs.emacs-nox; extraPackages = epkgs: [ epkgs.vterm ]; }; vim = { enable = true; }; }; - services = if (pkgs.stdenv.isLinux) then { - lorri.enable = true; - syncthing.enable = true; - gpg-agent = { - enable = true; - enableSshSupport = true; - extraConfig = '' - allow-emacs-pinentry - allow-loopback-pinentry - ''; - }; - } else - { }; - # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new Home Manager release introduces backwards diff --git a/modules/elixir.nix b/modules/elixir.nix deleted file mode 100644 index d5a2789..0000000 --- a/modules/elixir.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ elixir elixir_ls ]; - - programs.zsh.oh-my-zsh.plugins = [ "mix" ]; -} diff --git a/modules/golang.nix b/modules/golang.nix deleted file mode 100644 index 235df2c..0000000 --- a/modules/golang.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: - -{ - home.sessionPath = [ "$HOME/.go/bin" ]; - - home.packages = with pkgs; [ - go - gocode - golangci-lint - gomodifytags - gopls - gotests - gore - ]; - - programs = { - zsh = { - oh-my-zsh = { plugins = [ "golang" ]; }; - sessionVariables = { GOPATH = "$HOME/.go"; }; - }; - }; -} diff --git a/modules/haskell.nix b/modules/haskell.nix deleted file mode 100644 index 0956979..0000000 --- a/modules/haskell.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - ghc - stack - stylish-haskell - haskellPackages.ghcide - haskellPackages.hoogle - ]; - - home.file.".ghci".text = '' - :set prompt "λ> " - ''; -} diff --git a/modules/nodejs.nix b/modules/nodejs.nix deleted file mode 100644 index 6db8b53..0000000 --- a/modules/nodejs.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - nodejs - nodePackages.js-beautify - nodePackages.prettier - yarn - ]; -} diff --git a/modules/python.nix b/modules/python.nix deleted file mode 100644 index 8b0f5e7..0000000 --- a/modules/python.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ - pipenv - python3 - python38Packages.black - python38Packages.isort - python38Packages.pyflakes - python38Packages.pytest - ]; -} diff --git a/modules/ruby.nix b/modules/ruby.nix deleted file mode 100644 index d201a14..0000000 --- a/modules/ruby.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ ruby_2_7 solargraph ]; - - programs.zsh.oh-my-zsh.plugins = [ "bundler" "rails" ]; -} diff --git a/modules/rust.nix b/modules/rust.nix deleted file mode 100644 index 2d13650..0000000 --- a/modules/rust.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.sessionPath = [ "$HOME/.cargo/bin" ]; - home.packages = with pkgs; [ cargo rustc rust-analyzer ]; -}