Partial split into module files

This commit is contained in:
Joe Frikker
2026-02-15 22:56:32 -05:00
parent 0082cb1b33
commit 390b6d522b
2 changed files with 369 additions and 278 deletions

View File

@@ -42,15 +42,16 @@
in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
"${modules}/home.nix"
{
modules =
(pkgs.lib.filter
(n: pkgs.lib.strings.hasSuffix ".nix" n)
(pkgs.lib.filesystem.listFilesRecursive modules)) ++
[{
home.stateVersion = "22.05";
home.username = "jfrikker";
home.homeDirectory = "/Users/jfrikker";
home.packages = [ pkgs.pinentry_mac ];
}
];
}];
extraSpecialArgs = { kube = kube.packages.aarch64-darwin.default; };
};

306
home.org
View File

@@ -28,10 +28,6 @@ This is the basic structure of the home.nix file. Individual sections are define
}
#+END_SRC
* Packages
:PROPERTIES:
:header-args: :noweb-ref packages
:END:
Home-manager "packages" are simply binaries that are placed on the path, without any attached
configuration. The code blocks in this section contain package lists that go under the packages
section above.
@@ -42,7 +38,10 @@ in a ~nix~ devshell I think I'd also like to use it for scripting / exploratory
so I'm installing it globally with a useful set of libraries. I should curate this somewhat
carefully so it doesn't get carried away...
#+BEGIN_SRC nix
#+BEGIN_SRC nix :tangle target/common-lisp.nix
{pkgs, ...}:
{
home.packages = with pkgs; [
rlwrap
(sbcl.withPackages (ps: with ps; [
alexandria
@@ -78,6 +77,8 @@ carefully so it doesn't get carried away...
trivial-timeout
uuid
]))
];
}
#+END_SRC
[[https://github.com/str4d/rage][~rage~]] is a rust implementation of [[https://pkg.go.dev/filippo.io/age][~age~]]. It implements a simple system for generating public /
@@ -86,9 +87,15 @@ the name implies, allows generating and storing ~age~ keys on a Yubikey. ~rage~
~age~ when using ~age.el~, because it supports ~pinentry~. That allows it to prompt for yubikey pins
using a dialog, rather than a command line prompt.
#+BEGIN_SRC nix
#+BEGIN_SRC nix :tangle target/crypto.nix
{pkgs, ...}:
{
home.packages = with pkgs; [
rage
age-plugin-yubikey
yubikey-manager
];
}
#+END_SRC
~dust~, ~fd~, ~ripgrep~, and ~xh~ are rust re-implementations of a few longtime Linux command-line
@@ -100,37 +107,60 @@ tools. They boost better speed, or simply more streamlined features.
| ~ripgrep~ | ~grep~ |
| ~xh~ | ~curl~ |
#+BEGIN_SRC nix
#+BEGIN_SRC nix :tangle target/rust-reimpls.nix
{pkgs, ...}:
{
home.packages = with pkgs; [
dust
fd
ripgrep
xh
];
}
#+END_SRC
[[https://ledger-cli.org/][~ledger~]] is how I manage my budget. It's a plain-text accounting tool that's really awesome.
#+BEGIN_SRC nix
#+BEGIN_SRC nix :tangle target/ledger.nix
{pkgs, ...}:
{
home.packages = with pkgs; [
ledger
];
}
#+END_SRC
~nil~ is an LSP server for nix files.
#+BEGIN_SRC nix
#+BEGIN_SRC nix :tangle target/nil.nix
{pkgs, ...}:
{
home.packages = with pkgs; [
nil
];
}
#+END_SRC
[[https://github.com/magic-wormhole/magic-wormhole][Magic Wormhole]] is a quick-and-easy way to securely transfer a file or directory between any two
computers in the world, assuming that you have an out-of-band way to communicate a passphrase
between them. Once installed, the actual command is ~wormhole~.
#+begin_src nix
#+begin_src nix :tangle target/magic-wormhole.nix
{pkgs, ...}:
{
home.packages = with pkgs; [
magic-wormhole
];
}
#+end_src
These are the other programs I have installed globally. A few (like ~awscli~, ~mysql-client~, etc.)
are still Shibumi-specific; ideally I'd find another way to install them.
#+BEGIN_SRC nix
#+BEGIN_SRC nix :tangle target/other-packages.nix
{pkgs, kube, ...}:
{
home.packages = with pkgs; [
aws-iam-authenticator
awscli2
iosevka
@@ -140,14 +170,11 @@ are still Shibumi-specific; ideally I'd find another way to install them.
nerd-fonts.jetbrains-mono
openssh
tokei
yubikey-manager
];
}
#+END_SRC
* Program Configurations
:PROPERTIES:
:header-args:nix: :noweb-ref programs :noweb no-export
:END:
This section contains applications whose config files will be generated by Home Manager. Home
Manager calls these "programs" (as opposed to "packages", which are just binaries to put on the
path).
@@ -158,13 +185,17 @@ Although Home-Manager generates config files for these programs, they don't need
configuration. I'm not sure what benefit there is to enabling ~jq~ as a Home Manager program, rather
than just as an available package, but there doesn't seem to be a downside.
#+BEGIN_SRC nix
#+BEGIN_SRC nix :tangle target/simple-programs.nix
{
programs = {
bash.enable = true;
gh.enable = true;
home-manager.enable = true;
jq.enable = true;
lazygit.enable = true;
zoxide.enable = true;
};
}
#+END_SRC
** Bat
@@ -173,9 +204,13 @@ than just as an available package, but there doesn't seem to be a downside.
provides syntax-highlighting versions of a few other commands. It's honestly not incredibly useful,
but still nice to have.
#+BEGIN_SRC nix
bat.enable = true;
bat.config.style = "numbers";
#+BEGIN_SRC nix :tangle target/bat.nix
{
programs.bat = {
enable = true;
config.style = "numbers";
};
}
#+END_SRC
** Direnv
@@ -183,20 +218,28 @@ but still nice to have.
~direnv~ allows loading per-project paths as I navigate to their directories on the command line. I
leverage this with the emacs ~envrc~ package.
#+BEGIN_SRC nix
direnv.enable = true;
direnv.nix-direnv.enable = true;
#+BEGIN_SRC nix :tangle target/direnv.nix
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}
#+END_SRC
** Eza
~eza~ is an ~ls~ replacement that offers icons, colors, and some easier command-line options.
#+BEGIN_SRC nix
eza.enable = true;
eza.enableBashIntegration = true;
eza.enableZshIntegration = true;
eza.icons = "auto";
#+BEGIN_SRC nix :tangle target/eza.nix
{
programs.eza = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
icons = "auto";
};
}
#+END_SRC
** Fzf
@@ -204,35 +247,48 @@ leverage this with the emacs ~envrc~ package.
~fzf~ offers a variety of fuzzy finders right from the shell. I haven't been using this, so I'll
turn it off for now.
#+BEGIN_SRC nix
fzf.defaultCommand = "fd --type f";
fzf.fileWidgetCommand = "fd --type f";
fzf.fileWidgetOptions = ["--preview" "'bat --color=always --style=numbers --line-range=:500 {}'"];
fzf.changeDirWidgetCommand = "fd --type d";
fzf.tmux.enableShellIntegration = true;
#+BEGIN_SRC nix :tangle target/fzf.nix
{
programs.fzf = {
defaultCommand = "fd --type f";
fileWidgetCommand = "fd --type f";
fileWidgetOptions = ["--preview" "'bat --color=always --style=numbers --line-range=:500 {}'"];
changeDirWidgetCommand = "fd --type d";
tmux.enableShellIntegration = true;
};
}
#+END_SRC
** Git
We all know what ~git~ does.
#+BEGIN_SRC nix
git.enable = true;
git.settings.user.name = "Joe Frikker";
git.settings.user.email = "joe.frikker@shibumi.com";
delta.enable = true;
delta.enableGitIntegration = true;
#+BEGIN_SRC nix :tangle target/git.nix
{
programs.git = {
enable = true;
settings.user.name = "Joe Frikker";
settings.user.email = "joe.frikker@shibumi.com";
};
programs.delta = {
enable = true;
enableGitIntegration = true;
};
}
#+END_SRC
** Helix
The best text editor ever? Heresy!
#+BEGIN_SRC nix
helix.enable = true;
helix.defaultEditor = true;
#+BEGIN_SRC nix :tangle target/helix.nix
{
programs.helix = {
enable = true;
defaultEditor = true;
helix.settings.editor = {
settings.editor = {
auto-format = false;
auto-pairs = false;
auto-save.after-delay.enable = true;
@@ -247,14 +303,14 @@ The best text editor ever? Heresy!
whitespace.render.newline = "all";
};
helix.settings.keys.normal.space = {
settings.keys.normal.space = {
space = "file_picker";
"," = "buffer_picker";
# b = "@:sh wezterm cli spawn --cwd . -- tig blame <C-r>%<ret>";
};
helix.languages.language-server.eslint = {
languages.language-server.eslint = {
args = ["--stdio"];
command = "vscode-eslint-language-server";
config.nodePath = "";
@@ -268,15 +324,15 @@ The best text editor ever? Heresy!
config.problems.shortenToSingleLine = false;
};
helix.languages.language-server.jdtls.config.java = {
languages.language-server.jdtls.config.java = {
autobuild.enabled = true;
completion.maxResults = 1000;
format.settings.url = "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml";
};
helix.languages.language-server.rust-analyzer.config.files.watcher = "client";
languages.language-server.rust-analyzer.config.files.watcher = "client";
helix.languages.language = [
languages.language = [
{
name = "typescript";
language-servers = [ "typescript-language-server" "vscode-eslint-language-server" ];
@@ -295,6 +351,8 @@ The best text editor ever? Heresy!
indent.unit = " ";
}
];
};
}
#+END_SRC
** Starship
@@ -302,9 +360,11 @@ The best text editor ever? Heresy!
~starship~ gives me a nice shell prompt, mostly showing the versions of relevant software I have
installed. It's shell-agnostic, so it works with both bash and zsh.
#+BEGIN_SRC nix :noweb no-export
starship.enable = true;
starship.settings = {
#+BEGIN_SRC nix :tangle target/starship.nix
{
programs.starship = {
enable = true;
settings = {
add_newline = false;
container.disabled = true;
git_branch.symbol = " ";
@@ -323,9 +383,9 @@ installed. It's shell-agnostic, so it works with both bash and zsh.
rust.symbol = " ";
docker_context.disabled = true;
shell.disabled = false;
} //
<<starship_colors>>
;
};
};
}
#+END_SRC
** Tmux
@@ -333,20 +393,23 @@ installed. It's shell-agnostic, so it works with both bash and zsh.
I'm using ~wezterm~ instead of ~tmux~ for now, so this is disabled, but I'm keeping the config here
in case I need it later.
#+BEGIN_SRC nix
tmux.baseIndex = 1;
tmux.clock24 = true;
tmux.customPaneNavigationAndResize = true;
tmux.historyLimit = 50000;
tmux.enable = true;
tmux.escapeTime = 0;
tmux.keyMode = "vi";
tmux.mouse = true;
tmux.shell = pkgs.zsh + "/bin/zsh";
tmux.shortcut = "Space";
tmux.tmuxinator.enable = true;
tmux.terminal = "xterm-256color";
tmux.extraConfig = ''
#+BEGIN_SRC nix :tangle target/tmux.nix
{pkgs, ...}:
{
programs.tmux = {
baseIndex = 1;
clock24 = true;
customPaneNavigationAndResize = true;
historyLimit = 50000;
enable = true;
escapeTime = 0;
keyMode = "vi";
mouse = true;
shell = pkgs.zsh + "/bin/zsh";
shortcut = "Space";
tmuxinator.enable = true;
terminal = "xterm-256color";
extraConfig = ''
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
@@ -354,6 +417,8 @@ bind-key -T launcher g popup -h 100% -w 100% -E lazygit
bind-key g switch-client -Tlauncher
set -g default-command ""
'';
};
}
#+END_SRC
** Wezterm
:PROPERTIES:
@@ -363,9 +428,13 @@ set -g default-command ""
~wezterm~ is a fast terminal emulator and multiplexer. It is configured using lua. We'll define its
config in two blocks, so we can get lua syntax highlighting in org. First, the nix configuration:
#+BEGIN_SRC nix
wezterm.enable = true;
wezterm.extraConfig = builtins.readFile ./wezterm.lua;
#+BEGIN_SRC nix :tangle target/wezterm.nix
{
programs.wezterm = {
enable = true;
extraConfig = builtins.readFile ./wezterm.lua;
};
}
#+END_SRC
Then the real lua config:
@@ -565,20 +634,26 @@ Now we'll set up some keybindings:
This is my default shell for now. Unfortunately, nix requires a posix-compliant shell, so bash or
zsh it is.
#+BEGIN_SRC nix
zsh.enable = true;
zsh.oh-my-zsh.enable = true;
zsh.syntaxHighlighting.enable = true;
zsh.autosuggestion.enable = true;
zsh.historySubstringSearch.enable = true;
zsh.history.share = false;
zsh.cdpath = ["~/source"];
#+BEGIN_SRC nix :tangle target/zsh.nix
{
programs.zsh = {
enable = true;
oh-my-zsh.enable = true;
syntaxHighlighting.enable = true;
autosuggestion.enable = true;
historySubstringSearch.enable = true;
history.share = false;
cdpath = ["~/source"];
};
}
#+END_SRC
Actually, nix *really* requires ~bash~. This is a plugin that allows using zsh from nix-shell.
#+BEGIN_SRC nix
zsh.plugins = [
#+BEGIN_SRC nix :tangle target/zsh-nix-shell.nix
{pkgs, ...}:
{
programs.zsh.plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
@@ -590,6 +665,7 @@ Actually, nix *really* requires ~bash~. This is a plugin that allows using zsh f
};
}
];
}
#+END_SRC
* Emacs
@@ -603,12 +679,16 @@ breaking it out into its own top-level section. Many of the sections here have t
nix code block listing the emacs packages to include, and an elisp code block to configure them in
emacs.
#+BEGIN_SRC nix :noweb-ref programs
emacs.enable = true;
emacs.extraPackages = epkgs: with epkgs; [
#+BEGIN_SRC nix :tangle target/emacs.nix :noweb-ref
{
programs.emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [
<<emacs_packages>>
];
emacs.extraConfig = builtins.readFile ./emacs.el;
extraConfig = builtins.readFile ./emacs.el;
};
}
#+END_SRC
We'll put the actual emacs config into a separate file, rather than into a nix string literal. This
@@ -1635,14 +1715,15 @@ age
#+END_SRC
* Theme
I like Catppuccin Frappe as my theme. Let's use it in as many places as we can.
** Bat
#+BEGIN_SRC nix :noweb-ref programs
bat.config.theme = "catppuccin-frappe";
bat.themes = {
#+BEGIN_SRC nix :tangle target/bat-theme.nix
{pkgs, ...}:
{
programs.bat = {
config.theme = "catppuccin-frappe";
themes = {
catppuccin-frappe = {
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
@@ -1653,18 +1734,22 @@ I like Catppuccin Frappe as my theme. Let's use it in as many places as we can.
file = "Frappe.tmTheme";
};
};
};
}
#+END_SRC
** Helix
#+BEGIN_SRC nix :noweb-ref programs
helix.settings.theme = "catppuccin_frappe";
#+BEGIN_SRC nix :tangle target/helix-theme.nix
{
programs.helix.settings.theme = "catppuccin_frappe";
}
#+END_SRC
** Tmux
#+BEGIN_SRC nix :noweb-ref programs
tmux.plugins = [
#+BEGIN_SRC nix :tangle target/tmux-theme.nix
{pkgs, ...}:
{
programs.tmux.plugins = [
{
plugin = pkgs.tmuxPlugins.catppuccin;
extraConfig = ''set -g @catppuccin_window_tabs_enabled on
@@ -1672,11 +1757,15 @@ I like Catppuccin Frappe as my theme. Let's use it in as many places as we can.
set -g @catppuccin_window_current_text "#W"'';
}
];
}
#+END_SRC
** Lazygit
#+BEGIN_SRC nix :noweb-ref extra_xdg
#+BEGIN_SRC nix :tangle target/lazygit.nix
{pkgs, ...}:
{
xdg = {
enable = true;
configFile."lazygit/config.yml" = {
enable = true;
source = pkgs.fetchFromGitHub
@@ -1687,25 +1776,27 @@ I like Catppuccin Frappe as my theme. Let's use it in as many places as we can.
sha256 = "9BBmWRcjNaJE9T0RKVEJaSnkrbMom0CLYE8PzAT6yFw=";
} + /themes/frappe.yml;
};
};
}
#+END_SRC
** Starship
#+NAME: starship_colors
#+BEGIN_SRC nix
builtins.fromTOML (builtins.readFile
#+BEGIN_SRC nix :tangle target/starship_colors.nix
{pkgs, ...}:
{
programs.starship.settings = builtins.fromTOML (builtins.readFile
(pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "starship";
repo = "starship
";
rev = "3e3e54410c3189053f4da7a7043261361a1ed1bc"; # Replace with the latest commit hash
sha256 = "soEBVlq3ULeiZFAdQYMRFuswIIhI9bclIU8WXjxd7oY=";
} + /palettes/frappe.toml))
} + /palettes/frappe.toml));
}
#+END_SRC
** Wezterm
#+NAME: wezterm_colors
#+BEGIN_SRC lua :tangle target/wezterm.lua
config.color_scheme = 'Catppuccin Frappe'
@@ -1713,7 +1804,6 @@ I like Catppuccin Frappe as my theme. Let's use it in as many places as we can.
#+END_SRC
** Emacs
#+BEGIN_SRC nix :noweb-ref "emacs_packages"
catppuccin-theme
#+END_SRC