Something went wrong. Try again.
my NixOS and Nix-Darwin configs
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# Rex (superlogical.com/rex). The flake input needs the package token in /etc/nix/netrc until# Rex's first release, readable by suri since nh evaluates as the user:# machine pkgs.superlogical.com login rex password <REX_PACKAGE_TOKEN># Only hosts with the token import this. The module also installs the client (with its terminfo)# in the system profile and adds the ssh guard to /etc/ssh/ssh_config, so there's no# home-manager side.{ config, pkgs, inputs, ...}:let # run the pinned rex's own setup into a scratch config dir, so the skill and hook follow # Rex upgrades rexAgent = pkgs.runCommandLocal "rex-claude-agent" { } '' export HOME=$TMPDIR CLAUDE_CONFIG_DIR=$out ${config.services.rex.package}/bin/rex skill setup --agent claude --autostart=false '';
rexSessionPlugin = pkgs.runCommandLocal "rex-session-plugin" { } '' install -Dm644 ${rexAgent}/settings.json $out/hooks/hooks.json '';in{ imports = [ inputs.rex.nixosModules.default ];
# one shared server on /run/rex/server.sock, run as suri rather than the default `rex` # system user so sessions get suri's home, keys and files. It's a system service, so it # survives logout without linger, and the module adds the ssh guard to /etc/ssh/ssh_config. # Remote access is over SSH (which already rides the tailnet), so nothing but sshd listens. # Clients must name the socket, or rex looks for a personal server and fails: # rex hosts add <host> ssh://<host>/run/rex/server.sock services.rex = { enable = true; user = "suri"; };
# the module creates the `rex` group; members can reach the 0660 socket users.users.suri.extraGroups = [ "rex" ];
# clients otherwise look under $XDG_RUNTIME_DIR/rex and would autostart their own server environment.sessionVariables.REX_RUNTIME_DIR = "/run/rex";
# What `rex skill setup` would install for Claude Code, plus the community MCP server # (https://www.superlogical.com/rex/docs/beta/community-mcp). claude-code itself comes from # modules/home/tools, and settings.json stays hand-managed. home-manager.users.suri.programs.claude-code = { enable = true; package = null; skills.rex = "${rexAgent}/skills/rex"; # the hook goes in a plugin: merging it into settings.json would replace the other # SessionStart hooks there plugins.rex-session = rexSessionPlugin; # named superlogical, not rex, as the docs advise. Needs a one-time Discord login via /mcp. mcpServers.superlogical = { type = "http"; url = "https://www.superlogical.com/rex/community-mcp"; }; };}