Expose a NixOS module from the flake #48
Labels
No labels
epic
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie#48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The flake currently exposes
packages.default(theeviebinary),packages.sandcastleImage,apps, and dev shells — but nonixosModules. Deploying evie on a NixOS host today means hand-rolling a systemd service, threading the config TOML in manually, and wiring secrets (telegram.bot_token,http.api_key) by hand. There's no declarative, reusable deployment surface.Proposal
Add
nixosModules.default(and re-export via a top-levelnixosModulesoutput, sinceeachDefaultSystemonly covers per-system outputs) providing aservices.eviemodule that:eviepackage and runs it as a systemd service with a dedicated system user;src/config.rs) as typed NixOS options —telegram(enabled,bot_token,allowedChatIds),http(enabled,host,port,apiKey),pi(binaryPath,provider,model,systemPrompt,responseIdleTimeoutSecs,sessionDir,extensions,skills),notes.directory,session.idleTimeoutSecs,debug.exposeErrors,silverbullet.baseUrl, andschedule(list of{ cron, prompt });configFilepath passthrough) and points evie's--configat it;bot_token/api_keyout of the Nix store (e.g.*Fileoptions /LoadCredential/EnvironmentFile), rather than inlining them into world-readable store paths;DynamicUseror a dedicated user,StateDirectoryforsession_dir, restricted filesystem access).Open questions
settingsattrset (freeform, serialized to TOML)? Asettings-style freeform option tracks the Rust config with less churn.LoadCredentialvs.EnvironmentFilevs. agenix/sops — evie currently reads secrets straight from the TOML, so runtime substitution may need a small change inconfig.rs.piand its runtime deps (claude-code, etc.) should be wired into the servicePATHthe waypostInstallwraps the binary today.Note the
pibinary is already wrapped onto the package's PATH viapostInstall, so a service usingpackages.defaultinherits that.