huge update

This commit is contained in:
Michael Thomson 2024-09-04 09:14:29 -04:00
parent d468f20e0a
commit bfcf03de3b
No known key found for this signature in database
19 changed files with 486 additions and 123 deletions

24
flake.lock generated
View File

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1717931644,
"narHash": "sha256-Sz8Wh9cAiD5FhL8UWvZxBfnvxETSCVZlqWSYWaCPyu0=",
"lastModified": 1725180166,
"narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3d65009effd77cb0d6e7520b68b039836a7606cf",
"rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb",
"type": "github"
},
"original": {
@ -27,11 +27,11 @@
]
},
"locked": {
"lastModified": 1716993688,
"narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=",
"lastModified": 1725189302,
"narHash": "sha256-IhXok/kwQqtusPsoguQLCHA+h6gKvgdCrkhIaN+kByA=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4",
"rev": "7c4b53a7d9f3a3df902b3fddf2ae245ef20ebcda",
"type": "github"
},
"original": {
@ -42,11 +42,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1717828156,
"narHash": "sha256-YvstO0lobf3JWQuAfZCLYRTROC2ZDEgtWeQtWbO49p4=",
"lastModified": 1724878143,
"narHash": "sha256-UjpKo92iZ25M05kgSOw/Ti6VZwpgdlOa73zHj8OcaDk=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "057a7996d012f342a38a26261ee529cebb1755ef",
"rev": "95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef",
"type": "github"
},
"original": {
@ -58,11 +58,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1717786204,
"narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=",
"lastModified": 1725103162,
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "051f920625ab5aabe37c920346e3e69d7d34400e",
"rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
"type": "github"
},
"original": {

View File

@ -6,7 +6,9 @@
inputs.home-manager.darwinModules.default
];
nixpkgs.hostPlatform = "aarch64-darwin";
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowBroken = true;
networking.hostName = "macbook";
@ -41,15 +43,7 @@
skhd = {
enable = true;
skhdConfig = ''
cmd - return : kitty
'';
};
postgresql = {
enable = true;
ensureDatabases = [ "todos" ];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method
local all all trust
cmd - return : wezterm
'';
};
};

View File

@ -3,13 +3,12 @@
{
imports = [
../../modules/home-manager/neovim
../../modules/home-manager/emacs
../../modules/home-manager/wezterm
../../modules/home-manager/kitty
../../modules/home-manager/zsh
../../modules/home-manager/tmux
../../modules/home-manager/zoxide
../../modules/home-manager/eza
../../modules/home-manager/bat
../../modules/home-manager/eza ../../modules/home-manager/bat
../../modules/home-manager/irssi
../../modules/home-manager/email
];
@ -43,7 +42,6 @@
tintin
nb
w3m
lua
kubectl
k9s
kubeseal
@ -57,6 +55,8 @@
devenv
_1password
calcurse
glow
gcc
];
programs.home-manager.enable = true;

View File

@ -0,0 +1,16 @@
{ pkgs, config, ... }:
{
home.packages = with pkgs; [
emacs
fzf
ripgrep
emacs-lsp-booster
(nerdfonts.override { fonts = [ "Iosevka" ]; })
];
home.file.".emacs.d" = {
source = ./emacs.d;
recursive = true;
};
}

View File

@ -0,0 +1,3 @@
(setq package-enable-at-startup nil)
(setenv "LSP_USE_PLISTS" "true")

View File

@ -0,0 +1,225 @@
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
"straight/repos/straight.el/bootstrap.el"
(or (bound-and-true-p straight-base-dir)
user-emacs-directory)))
(bootstrap-version 7))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
;; Turn off unwanted GUI elements.
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)
;; Set the default font.
;; Append a size -NN to the font name.
(add-to-list 'default-frame-alist
'(font . "Iosevka Nerd Font-16"))
;; garbage collect when not in focus
(if (boundp 'after-focus-change-function)
(add-function :after after-focus-change-function
(lambda () (unless (frame-focus-state)
(garbage-collect))))
(add-hook 'after-focus-change-function
'garbage-collect))
;; set name and email
(setq user-full-name "Michael Thomson")
(setq user-mail-address "michael@michaelthomson.dev")
;; display columna nd line numbers on all buffers
(column-number-mode 1)
(global-display-line-numbers-mode 1)
;; paren closing and tab fix
(electric-pair-mode 1)
(electric-indent-mode -1)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq-default indent-line-function 'insert-tab)
;; save history of mini buffer commands and opened files
(savehist-mode 1)
(recentf-mode 1)
;; disable lock file creation and send backups to a different directory
(setq backup-directory-alist '(("." . "~/.saves")))
(setq backup-by-copying t)
(setq version-control t)
(setq delete-old-versions t)
(setq create-lockfiles nil)
;; scroll wheel improvments
(setq mouse-wheel-progressive-speed nil)
(setq scroll-conservatively 101)
;; y or n for prompts
(setq use-short-answers t)
(setq use-dialog-box nil)
;; disable startup screen and messages buffer
(setq inhibit-startup-message t)
(setq message-log-max nil)
(kill-buffer "*Messages*")
;; prog mode truncate lines and highlight lines
(add-hook 'prog-mode-hook
(lambda () (toggle-truncate-lines 1)))
(add-hook 'prog-mode-hook 'hl-line-mode)
;; theme
(use-package catppuccin-theme
:config
(load-theme 'catppuccin :no-confirm)
(setq catppuccin-flavor 'frappe) ;; or 'latte, 'macchiato, or 'mocha
(catppuccin-reload))
;; evil
(use-package evil
:init
(setq evil-want-keybinding nil)
:config
(setq evil-want-keybinding nil
evil-auto-indent nil
evil-want-C-u-scroll t
evil-shift-width 2
evil-undo-system 'undo-redo
evil-vsplit-window-right t)
(evil-mode t))
(use-package evil-collection
:after evil
:config
(evil-collection-init))
;; vertico
(use-package vertico
:init
(vertico-mode))
(use-package savehist
:init
(savehist-mode))
(use-package marginalia
:after vertico
:init
(marginalia-mode))
(use-package nerd-icons-completion
:after marginalia
:config
(nerd-icons-completion-mode)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))
(use-package orderless
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles partial-completion)))))
(use-package consult
:bind (;; A recursive grep
("M-s M-g" . consult-grep)
;; Search for files names recursively
("M-s M-f" . consult-find)
;; Search through the outline (headings) of the file
("M-s M-o" . consult-outline)
;; Search the current buffer
("M-s M-l" . consult-line)
;; Switch to another buffer, or bookmarked file, or recently
;; opened file.
("M-s M-b" . consult-buffer)))
;; icons
(use-package all-the-icons
:if (display-graphic-p))
;;;; Code Completion
(use-package corfu
:custom
(corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
(corfu-auto t) ;; Enable auto completion
(corfu-separator ?\s) ;; Orderless field separator
(corfu-auto-delay 0) ;; TOO SMALL - NOT RECOMMENDED
(corfu-auto-prefix 1)
:init
(global-corfu-mode))
(use-package flycheck
:config
(add-hook 'after-init-hook #'global-flycheck-mode))
;; treesitter
(use-package treesit-auto
:custom
(treesit-auto-install 'prompt)
:config
(treesit-auto-add-to-auto-mode-alist 'all)
(global-treesit-auto-mode))
(use-package lsp-mode
:init
(setq lsp-keymap-prefix "C-c l")
(setq lsp-use-plists t)
:hook ((tsx-ts-mode . lsp)
(typescript-ts-mode . lsp)
(js-ts-mode . lsp)
(go-ts-mode . lsp)
(vue-mode . lsp))
:commands lsp)
(use-package lsp-ui :commands lsp-ui-mode)
(setq read-process-output-max (* 10 1024 1024)) ;; 10mb
(setq gc-cons-threshold 200000000)
;; emacs-lsp-booster
(defun lsp-booster--advice-json-parse (old-fn &rest args)
"Try to parse bytecode instead of json."
(or
(when (equal (following-char) ?#)
(let ((bytecode (read (current-buffer))))
(when (byte-code-function-p bytecode)
(funcall bytecode))))
(apply old-fn args)))
(advice-add (if (progn (require 'json)
(fboundp 'json-parse-buffer))
'json-parse-buffer
'json-read)
:around
#'lsp-booster--advice-json-parse)
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
"Prepend emacs-lsp-booster command to lsp CMD."
(let ((orig-result (funcall old-fn cmd test?)))
(if (and (not test?) ;; for check lsp-server-present?
(not (file-remote-p default-directory)) ;; see lsp-resolve-final-command, it would add extra shell wrapper
lsp-use-plists
(not (functionp 'json-rpc-connection)) ;; native json-rpc
(executable-find "emacs-lsp-booster"))
(progn
(when-let ((command-from-exec-path (executable-find (car orig-result)))) ;; resolve command from exec-path (in case not found in $PATH)
(setcar orig-result command-from-exec-path))
(message "Using emacs-lsp-booster for %s!" orig-result)
(cons "emacs-lsp-booster" orig-result))
orig-result)))
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
;; languages
(use-package vue-mode)

View File

@ -10,6 +10,14 @@
source = ./calendar-password.sh;
executable = true;
};
"work-calendar-client-id.sh" = {
source = ./work-calendar-client-id.sh;
executable = true;
};
"work-calendar-client-secret.sh" = {
source = ./work-calendar-client-secret.sh;
executable = true;
};
};
services = {
@ -26,10 +34,68 @@
programs = {
aerc = {
enable = true;
stylesets = {
catppuccin-frappe = ''
*.default=true
*.normal=true
default.fg=#c6d0f5
error.fg=#e78284
warning.fg=#ef9f76
success.fg=#a6d189
tab.fg=#737994
tab.bg=#292c3c
tab.selected.fg=#c6d0f5
tab.selected.bg=#303446
tab.selected.bold=true
border.fg=#232634
border.bold=true
msglist_unread.bold=true
msglist_flagged.fg=#e5c890
msglist_flagged.bold=true
msglist_result.fg=#8caaee
msglist_result.bold=true
msglist_*.selected.bold=true
msglist_*.selected.bg=#414559
dirlist_*.selected.bold=true
dirlist_*.selected.bg=#414559
statusline_default.fg=#949cbb
statusline_default.bg=#414559
statusline_error.bold=true
statusline_success.bold=true
completion_default.selected.bg=#414559
[viewer]
url.fg=#8caaee
url.underline=true
header.bold=true
signature.dim=true
diff_meta.bold=true
diff_chunk.fg=#8caaee
diff_chunk_func.fg=#8caaee
diff_chunk_func.bold=true
diff_add.fg=#a6d189
diff_del.fg=#e78284
quote_*.fg=#737994
quote_1.fg=#949cbb
'';
};
extraConfig = {
general = {
unsafe-accounts-conf = true;
};
ui = {
border-char-vertical = "";
border-char-horizontal = "";
styleset-name = "catppuccin-frappe";
};
filters = {
"text/plain" = "colorize";
"text/calendar" = "calendar";
@ -43,17 +109,28 @@
mbsync = {
enable = true;
};
notmuch = {
enable = true;
};
lieer = {
enable = true;
};
vdirsyncer = {
enable = true;
};
khal = {
enable = true;
settings = {
view = {
agenda_event_format = "{calendar-color}{cancelled}{start-end-time-style} {title}{repeat-symbol}{reset}";
};
};
};
};
accounts = {
email = {
accounts.michaelthomson = {
accounts.personal = {
primary = true;
address = "michael@michaelthomson.dev";
realName = "Michael Thomson";
@ -83,11 +160,30 @@
enable = true;
};
};
notmuch = {
enable = true;
};
};
accounts.work = {
primary = false;
flavor = "gmail.com";
address = "mthomson@konradgroup.com";
realName = "Michael Thomson";
aerc = {
enable = true;
extraAccounts = { source = "maildir://~/Maildir/work"; };
};
notmuch = {
enable = true;
};
lieer = {
enable = true;
};
};
};
calendar = {
basePath = ".calendar";
accounts.michaelthomson = {
accounts.personal = {
primary = true;
primaryCollection = "default";
remote = {
@ -114,6 +210,28 @@
color = "#f2d5cf";
};
};
accounts.work = {
primary = false;
remote = {
type = "google_calendar";
};
vdirsyncer = {
enable = true;
collections = [ "from a" "from b" ];
clientIdCommand = [
"~/work-calendar-client-id.sh"
];
clientSecretCommand = [
"~/work-calendar-client-secret.sh"
];
tokenFile = "~/token_file";
};
khal = {
enable = true;
type = "discover";
color = "#e78284";
};
};
};
};
}

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
op read "op://Employee/Work Email API OAuth/client id" --account konradgroup.1password.com

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
op read "op://Employee/Work Email API OAuth/client secret" --account konradgroup.1password.com

View File

@ -2,18 +2,26 @@
{
home.packages = with pkgs; [
(nerdfonts.override { fonts = [ "Iosevka" ]; })
(nerdfonts.override { fonts = [ "Iosevka" "NerdFontsSymbolsOnly" ]; })
];
programs.kitty = {
enable = true;
font = {
name = "Iosevka Nerd Font";
name = "Iosevka Nerd Font Mono";
size = 12;
};
shellIntegration = {
enableZshIntegration = true;
};
theme = "Catppuccin-Frappe";
darwinLaunchOptions = [
"--single-instance"
];
settings = {
background_opacity = "0.9";
background_blur = 5;
macos_traditional_fullscreen = "yes";
};
};
}

View File

@ -2,12 +2,18 @@
{
home.packages = with pkgs; [
neovim
fzf
ripgrep
luarocks
];
programs.neovim = {
enable = true;
};
home.file.".config/nvim/" = {
source = ./nvim;
recursive = true;
};
}

View File

@ -2,28 +2,36 @@ local api = vim.api
local g = vim.g
local opt = vim.opt
-- Load Lazy
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Remap leader and local leader to <Space>
api.nvim_set_keymap("", "<Space>", "<Nop>", { noremap = true, silent = true })
g.mapleader = " "
g.maplocalleader = " "
g.maplocalleader = ","
-- Load plugins
require('lazy').setup('plugins')
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{ import = "plugins" },
},
install = { colorscheme = { "habamax" } },
checker = { enabled = true },
})
vim.cmd 'colorscheme catppuccin-frappe'
@ -63,7 +71,7 @@ opt.softtabstop = 2
opt.splitbelow = true
opt.splitright = true
opt.cursorline = true
opt.guifont = "PragmataPro Mono Liga"
opt.guifont = "Iosevka Nerd Font Mono"
-- Remappings
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")

View File

@ -0,0 +1,43 @@
return {
"nvim-neorg/neorg",
lazy = false,
version = "*",
config = function()
require("neorg").setup({
load = {
["core.defaults"] = {},
["core.completion"] = { config = { engine = "nvim-cmp", name = "[Neorg]" } },
["core.integrations.nvim-cmp"] = {},
["core.concealer"] = {},
["core.keybinds"] = {
config = {
default_keybinds = true,
},
},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/notes",
}
}
},
["core.esupports.metagen"] = { config = { type = "auto", update_date = true } },
["core.qol.toc"] = {},
["core.qol.todo_items"] = {},
["core.looking-glass"] = {},
["core.presenter"] = { config = { zen_mode = "zen-mode" } },
["core.export"] = {},
["core.export.markdown"] = { config = { extensions = "all" } },
["core.summary"] = {},
["core.tangle"] = { config = { report_on_empty = false } },
["core.ui.calendar"] = {},
["core.journal"] = {
config = {
strategy = "flat",
workspace = "notes",
},
},
},
})
end,
}

View File

@ -1,71 +0,0 @@
return {
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
event = {
-- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
"BufReadPre " .. vim.fn.expand "~" .. "/notes/Everything/**.md"
},
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",
-- see below for full list of optional dependencies 👇
},
opts = {
workspaces = {
{
name = "everything",
path = "~/notes/Everything",
},
},
notes_subdir = "notes",
daily_notes = {
-- Optional, if you keep daily notes in a separate directory.
folder = "notes/dailies",
-- Optional, if you want to change the date format for the ID of daily notes.
date_format = "%Y-%m-%d",
-- Optional, if you want to change the date format of the default alias of daily notes.
alias_format = "%B %-d, %Y",
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
template = "daily.md"
},
-- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp.
completion = {
-- Set to false to disable completion.
nvim_cmp = true,
-- Trigger completion at 2 chars.
min_chars = 2,
},
new_notes_location = "notes_subdir",
templates = {
subdir = "notes/templates",
date_format = "%Y-%m-%d",
time_format = "%H:%M",
-- A map for custom variables, the key should be the variable and the value a function
substitutions = {},
},
picker = {
-- Set your preferred picker. Can be one of 'telescope.nvim', 'fzf-lua', or 'mini.pick'.
name = "telescope.nvim",
-- Optional, configure key mappings for the picker. These are the defaults.
-- Not all pickers support all mappings.
mappings = {
-- Create a new note from your query.
new = "<C-x>",
-- Insert a link to the selected note.
insert_link = "<C-l>",
},
},
-- see below for full list of options 👇
},
}

View File

@ -0,0 +1,4 @@
return {
'xiyaowong/transparent.nvim',
lazy = false,
}

View File

@ -19,7 +19,7 @@ return {
autotag = { enable = true },
incremental_selection = {
enable = true,
enable = false,
keymaps = {
init_selection = '<CR>',
scope_incremental = '<CR>',

View File

@ -6,12 +6,13 @@
extraConfig = ''
return {
color_scheme = 'catppuccin-frappe',
font = wezterm.font('Iosevka'),
font = wezterm.font('Iosevka Nerd Font'),
font_size = 16,
use_fancy_tab_bar = false,
native_macos_fullscreen_mode = false,
enable_scroll_bar = false,
window_decorations = "RESIZE",
enable_kitty_graphics = true,
hide_tab_bar_if_only_one_tab = true,
keys = {
{
@ -26,8 +27,9 @@
top = 0,
bottom = 0,
},
-- window_background_opacity = 0.90,
-- macos_window_background_blur = 20,
window_background_opacity = 0.90,
macos_window_background_blur = 0,
front_end = "WebGpu",
}
'';
};

View File

@ -2,7 +2,7 @@ local wezterm = require 'wezterm'
return {
color_scheme = 'catppuccin-frappe',
-- font = wezterm.font('PragmataPro Liga'),
font = wezterm.font('PragmataPro Liga'),
font_size = 16,
use_fancy_tab_bar = false,
native_macos_fullscreen_mode = false,
@ -22,6 +22,6 @@ return {
top = 0,
bottom = 0,
},
-- window_background_opacity = 0.90,
-- macos_window_background_blur = 20,
window_background_opacity = 0.90,
macos_window_background_blur = 0,
}

View File

@ -20,6 +20,9 @@
cdi = "zi";
cat = "bat";
};
initExtra = ''
eval "$(/opt/homebrew/bin/brew shellenv)"
'';
};
starship = {
enable = true;