DIY & Making — 3D Printing and Maker Tooling
Purpose
The purpose.diy Home-Manager modules provide tooling and configuration for hardware tinkering, 3D printing, and related maker activities.
Entry Point
Architecture / Services / Scope
Printing
The printing module installs 3D-printing software and wires up persistent storage so that settings survive reboots on impermanence-based systems.
Options
purpose.diy.printing.enable
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable Enable 3D printing support.
purpose.diy.printing.gitSync.enable
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable Auto-commit OrcaSlicer settings changes to a local git repository.
purpose.diy.printing.gitSync.remoteUrl
| Type | null or string |
| Default | null |
Optional remote URL to push commits to. If set, the git sync service will attempt to push commits to this remote after creating them.
The remote must be configured with appropriate credentials (e.g. via SSH keys) for non-interactive authentication.
purpose.diy.printing.gitSync.repoPath
| Type | string |
| Default | "${config.home.homeDirectory}/.config/OrcaSlicer/user/default" |
Absolute path to the directory that will be tracked as a git repository. The directory is initialised automatically the first time the watcher service starts, so it does not need to exist at activation time.
Defaults to the standard OrcaSlicer per-user profile directory so that filament, process, and machine profiles are all captured without any additional configuration.
Git Sync
The gitSync sub-module adds a long-running systemd user service backed by the packaged orca-slicer-git-sync helper.
It watches the OrcaSlicer profile directory and automatically creates a git commit every time a profile file is added, changed, or removed. This gives a full revision history of slicer settings with zero manual effort.
Commit Message Convention
Commit messages are generated automatically based on the type of filesystem event and the location of the file within the repository:
| Event | Commit message format |
|---|---|
| File added / created | feat(<type>): added <name> |
| File modified | refactor(<type>): updated <name> |
| File deleted | chore(<type>): removed <name> |
Where:
<type>is the name of the first directory component under the repo root (e.g.filament,process,machine). Files placed directly at the root level use the fallback typeconfig.<name>is the filename stripped of its extension (e.g. a file namedPrusament_PLA.jsonyields the namePrusament_PLA).
Examples:
feat(filament): added Prusament_PLA
refactor(process): updated Standard_0.2mm_Quality
chore(machine): removed Prusa_MK4S
How It Works
- A systemd user service is started at login and kept alive by systemd.
- The service uses
inotifywait(frominotify-tools) in one-shot mode inside a loop to detect any filesystem event under the repo path (excluding the.gitdirectory). - After an event is received the watcher sleeps for a short debounce period to absorb rapid bursts of writes (e.g. when OrcaSlicer rewrites multiple files at once).
- All pending changes are staged and committed once per batch. The commit message is derived from the first changed path in that batch, using the same profile-aware naming convention documented above.
- If the watched directory does not yet exist (e.g. OrcaSlicer has never been run), the service polls until it appears, then initialises the repository and starts watching.
Usage Example
{ ... }: {
purpose.diy.enable = true;
purpose.diy.printing = {
enable = true;
gitSync = {
enable = true;
# Optional: use a custom path outside the OrcaSlicer config directory
# repoPath = "/home/alice/slicer-profiles";
};
};
}
Operational Notes / Assumptions
- The git repository is initialised with
git initand an initial commit the first time the service starts if no.gitdirectory exists. - The service is set to restart on failure so transient errors do not leave settings un-tracked.
- Because the watcher operates on the live OrcaSlicer profile directory, no separate mirroring or rsync step is needed.