Restructure modules/shared and update all imports

- Delete 2024-12-rework/ folder
- Rename modules/hosts/common to modules/shared, then split into:
  - modules/shared/home/general
  - modules/shared/home/linux
  - modules/shared/nixos
- Update all import paths throughout the codebase
- Update lib/*.nix to use new paths
- Fix hardcoded /Users/${username} to use config.home.homeDirectory
- Update README and examples/flake-structure.nix
This commit is contained in:
Gene Liverman 2026-03-22 18:32:08 -04:00
parent 14fbadd9aa
commit 582f93d9ed
No known key found for this signature in database
78 changed files with 88 additions and 406 deletions

View file

@ -0,0 +1,10 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
esptool
];
programs = {
git.settings.aliases = {
kraken = "!gitkraken -p $(cd \"\${1:-.}\" && git rev-parse --show-toplevel)";
};
};
}

View file

@ -0,0 +1,366 @@
{ config, inputs, pkgs, ... }: let
sqlite_lib = if builtins.elem pkgs.stdenv.hostPlatform.system [
"aarch64-darwin"
"x86_64-darwin"
]
then "libsqlite3.dylib"
else "libsqlite3.so";
in {
home.packages = with pkgs; [
btop
bundix
cargo
cheat
colordiff
dogdns
dos2unix
duf
dust
fd
f2
git-filter-repo
glab
glow
gomuks
gotop
htop
httpie
hub
inputs.nix-auth.packages.${stdenv.hostPlatform.system}.default
jq
lazydocker
lazygit
lua-language-server
minicom
mtr
nil
nix-search
nix-zsh-completions
nodejs
nurl
nvd
onefetch
powershell
pre-commit
puppet-lint
rename
ruby
subversion
tldr
tree
trippy
vimv
watch
wget
yq-go
];
home.sessionVariables = {
CLICLOLOR = 1;
PAGER = "less";
};
programs = {
atuin = {
enable = true;
settings = {
ctrl_n_shortcuts = true; # Use Ctrl-0 .. Ctrl-9 instead of Alt-0 .. Alt-9 UI shortcuts
enter_accept = true; # press tab to edit command before running
filter_mode_shell_up_key_binding = "host"; # or global, host, directory, etc
sync_address = "https://atuin.home.technicalissues.us";
sync_frequency = "15m";
};
};
bat = {
enable = true;
config = {
theme = "Catppuccin-frappe";
};
themes = {
Catppuccin-frappe = {
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "bat";
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
hash = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
};
file = "Catppuccin-frappe.tmTheme";
};
};
};
bottom.enable = true;
broot.enable = true;
diff-so-fancy = {
enable = true;
enableGitIntegration = true;
};
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
eza.enable = true;
fzf.enable = true;
gh.enable = true;
git = {
enable = true;
settings = {
diff.sopsdiffer.textconv = "sops --config /dev/null --decrypt";
};
ignores = [
"*~"
"*.swp"
".DS_Store"
];
includes = [ { path = "~/.gitconfig-local"; }];
lfs.enable = true;
package = pkgs.gitFull;
settings = {
init = {
defaultBranch = "main";
};
merge = {
conflictStyle = "diff3";
tool = "meld";
};
pull = {
rebase = false;
};
user = {
name = "Gene Liverman";
};
};
}; # end git
irssi.enable = true;
jq.enable = true;
neovim = {
enable = true;
defaultEditor = true;
extraLuaConfig = ''
-- NOTE: This will get the OS from Lua:
-- print(vim.loop.os_uname().sysname)
-- setup lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
vim.opt.rtp:prepend(lazypath)
-- hack to deal with bug in telescope-cheat.nvim
-- https://github.com/nvim-telescope/telescope-cheat.nvim/issues/7
local cheat_dbdir = vim.fn.stdpath "data" .. "/databases"
if not vim.loop.fs_stat(cheat_dbdir) then
vim.loop.fs_mkdir(cheat_dbdir, 493)
end
-- load additional settings
require("config.vim-options")
require("lazy").setup("plugins")
-- tell sqlite.lua where to find the bits it needs
vim.g.sqlite_clib_path = '${pkgs.sqlite.out}/lib/${sqlite_lib}'
'';
extraPackages = with pkgs; [
gcc # needed so treesitter can do compiling
sqlite # needed by sqlite.lua used by telescope-cheat
];
plugins = [ pkgs.vimPlugins.lazy-nvim ]; # let lazy.nvim manage every other plugin
};
nh = {
enable = true;
flake = "${config.home.homeDirectory}/repos/dots";
};
oh-my-posh = {
enable = true;
enableZshIntegration = true;
settings = builtins.fromJSON (builtins.unsafeDiscardStringContext (builtins.readFile (inputs.genebean-omp-themes + "/beanbag.omp.json")));
#useTheme = "amro";
#useTheme = "montys";
};
ripgrep.enable = true;
tmux = {
enable = true;
historyLimit = 100000;
mouse = true;
tmuxinator.enable = true;
plugins = with pkgs.tmuxPlugins; [
vim-tmux-navigator
{
plugin = dracula;
extraConfig = ''
set -g @dracula-show-battery false
set -g @dracula-show-powerline true
set -g @dracula-refresh-rate 10
'';
}
];
extraConfig = ''
set -g status-position top
'';
};
vim = {
enable = true;
defaultEditor = false;
plugins = with pkgs.vimPlugins; [
syntastic
tabular
tlib_vim
vim-addon-mw-utils
vim-airline
vim-airline-themes
vim-flog
vim-fugitive
vim-json
vim-markdown
vim-nix
vim-puppet
vim-ruby
vim-snipmate
vim-snippets
vim-tmux-navigator
vim-yaml
];
settings = {
background = "dark";
expandtab = true;
};
extraConfig = ''
set nocompatible " be iMproved, required
filetype plugin indent on " required for plugins to be able to adjust indent
syntax on " enable syntax highlighting
set encoding=utf-8
set termencoding=utf-8
set t_Co=256 " tell vim we have 256 colors to work with
set autoindent " automatically indent new lines
set backspace=2 " make backspace work like most other programs
set fillchars+=stl:\ ,stlnc:\ " fix added per powerline troubleshooting docs
set laststatus=2 " Always display the status line in all windows
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the status line)
set smarttab " helps with expanding tabs to spaces (I think)
set statusline+=%{FugitiveStatusline()} " get git info via fugitive plugin
set statusline+=%#warningmsg# " recommended setting from syntastic plugin
set statusline+=%{SyntasticStatuslineFlag()} " recommended setting from syntastic plugin
set statusline+=%* " recommended setting from syntastic plugin
" This has to come after colorscheme, if defined, to not be masked
highlight ColorColumn ctermbg=232 " set the color to be used for guidelines
let &colorcolumn=join(range(81,999),",") " change the background color of everything beyond 80 characters
let g:snipMate = { 'snippet_version' : 1 }
" settings for the syntastic plugin
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs = 1
let g:syntastic_ruby_checkers = ['rubocop']
let g:syntastic_quiet_messages = {'level': 'warnings'}
" don't wrap text in markdown files
let g:vim_markdown_folding_disabled = 1
" settings for vim-airline
let g:airline_theme='badwolf'
let g:airline_powerline_fonts = 1
'';
};
zellij = {
enable = true;
enableZshIntegration = false;
};
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
history.save = 1000000;
history.size = 1000000;
initContent = ''
[ -f ~/.private-env ] && source ~/.private-env || echo '~/.private-env is missing'
[ -f ~/.gitconfig-local ] || echo '~/.gitconfig-local is missing. Create it and set user.email'
# Start GPG agent
# Some tips from https://hedberg.io/yubikey-for-ssh/ helped simplify this:
if [[ $(uname) == 'Darwin' ]]; then
# Add GPG Suite binaries to the path:
export PATH=/usr/local/MacGPG2/bin:$PATH
fi
export GPG_TTY=$(tty)
function nv() {
# Assumes all configs exist in directories named ~/.config/nvim-*
local config=$(fd --max-depth 1 --glob 'nvim*' ~/.config | fzf --prompt="Neovim Configs > " --height=~50% --layout=reverse --border --exit-0)
# If I exit fzf without selecting a config, don't open Neovim
[[ -z $config ]] && echo "No config selected" && return
# Open Neovim with the selected config
NVIM_APPNAME=$(basename $config) nvim $*
}
function svndiffless() {
svn diff "$@" |diff-so-fancy |less -R
}
function svndiffless-nows() {
svn diff -x -w "$@" |diff-so-fancy |less -R
}
# unset oh-my-zsh's gk so that gk can refer to the gitkraken-cli
unalias gk
'';
oh-my-zsh = {
enable = true;
plugins = [
"bundler"
"gem"
"git"
"github"
"history"
"kubectl"
"pip"
"terraform"
"vagrant"
"vscode"
];
};
shellAliases = {
bcrr = "bolt command run --run-as root --sudo-password-prompt";
bcrrs = "bcrr --stream --no-verbose";
beo = "bundle exec onceover run spec --trace --force";
biv = "bundle install --path=vendor/bundle";
bottom = "echo 'To run bottom, the command is btm'";
ce = "code-exploration";
dots = "cd ~/repos/dots";
gbc = ''
git branch --merged | command grep -vE "^(\*|\s*(main|master|develop|production|qa)\s*$)" | command xargs -n 1 git branch -d
'';
gitextract = "git log --pretty=email --patch-with-stat --reverse --full-index --binary --";
gpge = "gpg2 --encrypt --sign --armor -r ";
hubpr = "hub pull-request --push --browse";
nvdots = "NVIM_APPNAME=nvim-dots nvim";
nve = "nvdots ~/repos/dots/modules/home-manager/files/nvim/lua";
pssh = "ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no' -o PubkeyAcceptedKeyTypes=+ssh-rsa -o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -i ~/.ssh/id_rsa-acceptance";
sal = "ssh-add -L";
sshnull = "ssh -o UserKnownHostsFile=/dev/null";
st = "open -a SourceTree";
sz = "source ~/.zshrc";
trippy = "echo 'To run trippy, the command is trip'";
usegpg = "killall ssh-agent; export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) && gpgconf --launch gpg-agent";
usessh = "gpgconf --kill gpg-agent";
};
}; # end zsh
}; # end programs
home.file = {
".config/nvim/lua/config" = {
source = ../../files/nvim/lua/config;
recursive = true;
};
".config/nvim/lua/plugins" = {
source = ../../files/nvim/lua/plugins;
recursive = true;
};
".config/powershell/Microsoft.PowerShell_profile.ps1".source = ../../files/Microsoft.PowerShell_profile.ps1;
".config/powershell/Microsoft.VSCode_profile.ps1".source = ../../files/Microsoft.PowerShell_profile.ps1;
};
}

View file

@ -0,0 +1,3 @@
{ ... }: {
programs.hexchat.enable = true;
}

View file

@ -0,0 +1,3 @@
{ ... }: {
programs.pidgin.enable = true;
}

View file

@ -0,0 +1,30 @@
{ lib, pkgs, ... }: with lib.hm.gvariant; {
dconf.settings = {
"com/gexperts/Tilix/profiles/2b7c4080-0ddd-46c5-8f23-563fd3ba789d" = {
background-color = "#272822";
background-transparency-percent = 10;
badge-color-set = false;
bold-color-set = false;
cursor-colors-set = false;
font = "Hack Nerd Font Mono 12";
foreground-color = "#F8F8F2";
highlight-colors-set = false;
palette = [ "#272822" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F8F8F2" "#75715E" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F9F8F5" ];
use-system-font = false;
use-theme-colors = false;
visible-name = "Default";
};
};
home.file = {
".config/tilix/schemes/Beanbag-Mathias.json".source = ../../../files/tilix/Beanbag-Mathias.json;
".config/tilix/schemes/Catppuccin-Frappe.json".source = (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "tilix";
rev = "3fd05e03419321f2f2a6aad6da733b28be1765ef";
hash = "sha256-SI7QxQ+WBHzeuXbTye+s8pi4tDVZOV4Aa33mRYO276k=";
} + "/src/Catppuccin-Frappe.json");
};
}

View file

@ -0,0 +1,17 @@
{ pkgs, ... }: {
home.file = {
".config/waybar/config".source = ../../../files/waybar/config;
".config/waybar/frappe.css".source = (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "waybar";
rev = "f74ab1eecf2dcaf22569b396eed53b2b2fbe8aff";
hash = "sha256-WLJMA2X20E5PCPg0ZPtSop0bfmu+pLImP9t8A8V4QK8=";
} + "/themes/frappe.css");
".config/waybar/style.css".source = ../../../files/waybar/style.css;
};
programs = {
# Using file in ../../files/waybar/ to configure waybar
waybar.enable = true;
};
}

View file

@ -0,0 +1,46 @@
{ ... }: {
home.file = {
".config/xfce4/terminal/accels.scm".source = ../../../files/xfce4/terminal/accels.scm;
};
xfconf.settings = {
xfce4-terminal = {
"background-mode" = "TERMINAL_BACKGROUND_TRANSPARENT";
"background-darkness" = "0.90000000000000000";
"color-foreground" = "#e3e3ea";
"color-background" = "#08052b";
"color-cursor" = "#ff7f7f";
"color-cursor-use-default" = false;
"color-palette" = "#000000;#e52222;#a6e32d;#fc951e;#c48dff;#fa2573;#67d9f0;#f2f2f2;#555555;#ff5555;#55ff55;#ffff55;#5555ff;#ff55ff;#55ffff;#ffffff";
"font-name" = "Hack Nerd Font Mono 12";
"misc-always-show-tabs" = false;
"misc-bell" = false;
"misc-bell-urgent" = true;
"misc-borders-default" = true;
"misc-cursor-blinks" = false;
"misc-cursor-shape" = "TERMINAL_CURSOR_SHAPE_BLOCK";
"misc-default-geometry" = "120x24";
"misc-inherit-geometry" = false;
"misc-menubar-default" = true;
"misc-mouse-autohide" = false;
"misc-mouse-wheel-zoom" = true;
"misc-toolbar-default" = false;
"misc-confirm-close" = true;
"misc-cycle-tabs" = true;
"misc-tab-close-buttons" = true;
"misc-tab-close-middle-click" = true;
"misc-tab-position" = "GTK_POS_TOP";
"misc-highlight-urls" = true;
"misc-middle-click-opens-uri" = false;
"misc-copy-on-select" = false;
"misc-show-relaunch-dialog" = true;
"misc-rewrap-on-resize" = true;
"misc-slim-tabs" = true;
"misc-new-tab-adjacent" = false;
"misc-search-dialog-opacity" = "100";
"misc-show-unsafe-paste-dialog" = true;
"scrolling-unlimited" = true;
"title-initial" = "xfce4-terminal";
};
};
}

View file

@ -0,0 +1,17 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
fastfetch
];
programs = {
# Linux-specific aliases
zsh.shellAliases = {
nixboot = "sudo nixos-rebuild boot --flake ~/repos/dots && echo 'Time to reboot!'";
nixdiff = "cd ~/repos/dots && nixos-rebuild build --flake . && nvd diff /run/current-system result";
nixup = "sudo nixos-rebuild switch --flake ~/repos/dots";
uwgconnect = "nmcli dev wifi connect SecureWest password";
uwgforget = "nmcli connection delete SecureWest";
ykey = "sudo systemctl restart pcscd && sudo pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L";
};
};
}