Skip to content

Commit 527df17

Browse files
committed
Add crush, modify MCPs
1 parent a3ebb38 commit 527df17

14 files changed

Lines changed: 243 additions & 50 deletions

File tree

‎AGENTS.md‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# AGENTS.md
2+
3+
Nix flake managing macOS (nix-darwin) and Home Manager configs. Built on
4+
`flake-parts` + `haumea` (directory-tree-as-attrset auto-loading). Pinned to the
5+
`26.05` release channels.
6+
7+
## Commands
8+
9+
All workflows go through `just` (see `Justfile`). Run inside `nix develop` (auto
10+
via `.envrc`/direnv).
11+
12+
- `just build` — build current host (`nh darwin build`)
13+
- `just build-system <name>` — build a named host (`eMac`, `mercury`)
14+
- `just build-home <name>` — build a home config (`ethan`, `et`)
15+
- `just switch` — activate current host
16+
- `just check` — `nix flake check --impure --all-systems` (note `--impure` is required)
17+
- `just format` / `treefmt` — format everything
18+
- `just repl` — Nix REPL with this flake loaded
19+
- `just render-workflows` — regenerate `.github/workflows/*.yml` (see Gotchas)
20+
21+
There is no test suite; `just check` + a successful build is the verification.
22+
23+
## Architecture
24+
25+
Everything is wired through `flake.nix`'s `imports`. Three building blocks:
26+
27+
1. **Modules** (`modules/{darwin,home}/src/`, `modules/profiles/`) — auto-loaded
28+
by `haumea` into `flake.darwinModules` / `flake.homeModules` and
29+
`flake.profiles.{darwin,home}`. A file's directory path becomes its attr path
30+
(e.g. `profiles/home/git/common.nix` → `profiles.home.git.common`). Adding a
31+
file is enough to register it; no central import list.
32+
2. **Suites** (`modules/suites/{system,home}.nix`) — named bundles of profiles
33+
(`base`, `development`, `work`, `identity`, `minimal`, `fonts`). This is where
34+
you opt a profile into the default set. Defined as plain lists referencing
35+
`profiles`.
36+
3. **Configurations** — `hosts/` defines `darwinConfigurations`, `users/` defines
37+
`homeConfigurations`, both built via helpers in `lib/src/{darwin,hm}.nix`
38+
(`mkDarwinConfiguration` / `mkHomeManagerConfiguration`).
39+
40+
Data flow: profile files are pure HM/darwin modules → grouped into suites →
41+
hosts/users import suites + extra profiles. Hosts inject the standalone home
42+
configs via `modules/profiles/system/users/*.nix` (e.g. `home-manager.users.et =
43+
import ../../../../users/et/home.nix`), so a user's `home.nix` is shared between
44+
the standalone `homeConfigurations` and the darwin host.
45+
46+
`specialArgs`/`extraSpecialArgs` expose `flake`, `inputs`, `secrets`, `suites`,
47+
`profiles` to every module — that's why profiles take `{ suites, profiles, ... }`.
48+
49+
## Conventions
50+
51+
- **nixfmt-classic** style, 2-space indent (`.editorconfig`); Justfile uses
52+
4-space. `treefmt` runs deadnix + statix + nixfmt + prettier + actionlint.
53+
- Profiles are thin: one tool/concern per file, typically `programs.<x>.enable =
54+
true` plus config. Match neighbors in `modules/profiles/home/`.
55+
- Custom HM modules with full options live in `modules/home/src/programs/`
56+
(see `rippkgs/default.nix` for the option pattern).
57+
- Custom options namespaced under `tilde.*` (`modules/darwin/src/tilde/options.nix`).
58+
- Packages defined in `modules/packages/` via `callPackage`, exposed through both
59+
`packages` and the overlay (`modules/overlays/default.nix`, `easyOverlay`).
60+
- nixpkgs is overlaid (`self.overlays.default`, pragmatapro, emacs-overlay) with
61+
`allowUnfree = true` in `flake.nix` `perSystem`.
62+
63+
## Gotchas
64+
65+
- **`--impure` is required** for `flake check` and the devShell build (secrets +
66+
`tilde-secrets` private input).
67+
- **Secrets** use sops-nix; the `tilde-secrets` / `pragmatapro` inputs are
68+
private SSH git repos. Builds need SSH agent access. Edit secrets via
69+
`just edit-secret <file>`; after key changes run `just update-secret-files`.
70+
- **GitHub workflows are generated** from `modules/development/ci.nix` via
71+
`actions-nix`. Never hand-edit `.github/workflows/*.yml` — change `ci.nix` and
72+
run `just render-workflows`.
73+
- `secrets.json` / `secrets.yml` are excluded from prettier; don't reformat them.
74+
- Hosts are all `aarch64-darwin`; flake `systems` also lists `x86_64-linux` for
75+
the linux builder.
76+
- Binary caches (cachix `tilde`, attic at `cache.e10.camp`) are configured in
77+
`nixConfig`; push results with `just push-result-to-cache`.

‎flake.lock‎

Lines changed: 44 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flake.nix‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
emacs-overlay.url = "github:nix-community/emacs-overlay";
5555
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
5656

57+
charmbracelet.url = "github:charmbracelet/nur";
58+
charmbracelet.inputs.nixpkgs.follows = "nixpkgs";
59+
5760
pragmatapro.url = "git+ssh://git@github.com/ethnt/pragmatapro";
5861
pragmatapro.inputs.nixpkgs.follows = "nixpkgs";
5962
pragmatapro.inputs.flake-parts.follows = "flake-parts";

‎lib/src/hm.nix‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ let
55

66
l = inputs.nixpkgs.lib // builtins;
77

8-
sharedModules = l.attrValues flake.homeModules
9-
++ (with inputs; [ sops-nix.homeManagerModules.sops ]);
8+
sharedModules = l.attrValues flake.homeModules ++ (with inputs; [
9+
sops-nix.homeManagerModules.sops
10+
charmbracelet.homeModules.crush
11+
]);
1012

1113
extraSpecialArgs = {
1214
inherit flake inputs secrets;

‎modules/profiles/home/crush.nix‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{ config, ... }: {
2+
programs.crush = {
3+
enable = true;
4+
settings.mcp = config.programs.mcp.servers;
5+
};
6+
}

‎modules/profiles/home/emacs.nix‎

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
1-
{ pkgs, ... }:
2-
let
3-
configuredEmacs = pkgs.emacs.override {
4-
withNativeCompilation = true;
5-
withTreeSitter = true;
6-
};
7-
patchedEmacs = configuredEmacs.overrideAttrs (old: {
8-
patches = (old.patches or [ ]) ++ [
9-
(pkgs.fetchpatch {
10-
url =
11-
"https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/system-appearance.patch";
12-
sha256 = "3QLq91AQ6E921/W9nfDjdOUWR8YVsqBAT/W9c1woqAw=";
13-
})
14-
(pkgs.fetchpatch {
15-
url =
16-
"https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/round-undecorated-frame.patch";
17-
sha256 = "uYIxNTyfbprx5mCqMNFVrBcLeo+8e21qmBE3lpcnd+4=";
18-
})
19-
(pkgs.fetchpatch {
20-
url =
21-
"https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-28/fix-window-role.patch";
22-
sha256 = "+z/KfsBm1lvZTZNiMbxzXQGRTjkCFO4QPlEK35upjsE=";
23-
})
24-
];
25-
});
26-
in {
27-
programs.emacs = {
28-
enable = true;
29-
package = patchedEmacs;
30-
};
1+
# { pkgs, ... }:
2+
# let
3+
# configuredEmacs = pkgs.emacs.override {
4+
# withNativeCompilation = true;
5+
# withTreeSitter = true;
6+
# };
7+
# patchedEmacs = configuredEmacs.overrideAttrs (old: {
8+
# patches = (old.patches or [ ]) ++ [
9+
# (pkgs.fetchpatch {
10+
# url =
11+
# "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/system-appearance.patch";
12+
# sha256 = "3QLq91AQ6E921/W9nfDjdOUWR8YVsqBAT/W9c1woqAw=";
13+
# })
14+
# (pkgs.fetchpatch {
15+
# url =
16+
# "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/round-undecorated-frame.patch";
17+
# sha256 = "uYIxNTyfbprx5mCqMNFVrBcLeo+8e21qmBE3lpcnd+4=";
18+
# })
19+
# (pkgs.fetchpatch {
20+
# url =
21+
# "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-28/fix-window-role.patch";
22+
# sha256 = "+z/KfsBm1lvZTZNiMbxzXQGRTjkCFO4QPlEK35upjsE=";
23+
# })
24+
# ];
25+
# });
26+
# in {
27+
# programs.emacs = {
28+
# enable = true;
29+
# package = patchedEmacs;
30+
# };
3131

32-
home.packages = with pkgs; [
33-
emacs-all-the-icons-fonts
34-
coreutils
35-
fd
36-
fontconfig
37-
shellcheck
38-
clang
39-
];
32+
# home.packages = with pkgs; [
33+
# emacs-all-the-icons-fonts
34+
# coreutils
35+
# fd
36+
# fontconfig
37+
# shellcheck
38+
# clang
39+
# ];
40+
# }
41+
42+
{ pkgs, ... }: {
43+
home.sessionPath = [ "$HOME/.config/emacs/bin" ];
44+
45+
home.packages = with pkgs; [ fontconfig emacsPackages.nerd-icons ];
4046
}

‎modules/profiles/home/mcp/github/default.nix‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ in {
2121
};
2222

2323
programs.mcp.servers.github = {
24-
command = github-mcp-wrapper;
24+
command = toString github-mcp-wrapper;
2525
args = [ ];
2626
};
2727
}

‎modules/profiles/home/zed-editor.nix‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
enable = true;
44
extensions = [
55
"editorconfig"
6+
"elisp"
67
"haskell"
78
"html"
89
"just"
10+
"latex"
911
"log"
12+
"make"
1013
"nix"
1114
"nord"
1215
"ruby"

‎modules/suites/home.nix‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ with profiles;
99
autojump
1010
bat
1111
certs
12+
crush
1213
direnv
14+
emacs
1315
fish
1416
fzf
1517
ghostty

‎users/et/home.nix‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
++ (with profiles; [ haskell nodejs ]) ++ [ secrets.users.et.home ] ++ [
55
./profiles/git.nix
66
./profiles/jujutsu.nix
7-
./profiles/mcp.nix
7+
./profiles/mcp/default.nix
8+
./profiles/mcp/linear/default.nix
89
./profiles/tmuxp.nix
910
./profiles/tools.nix
1011
./profiles/vscode.nix

0 commit comments

Comments
 (0)