- Nix 95%
- Just 5%
| .config | ||
| src/nix | ||
| .editorconfig | ||
| .envrc | ||
| .gitignore | ||
| .prettierignore | ||
| flake.lock | ||
| flake.nix | ||
| Justfile | ||
| README.md | ||
Open Wearables Flake
This is currently pinned to Open Wearables 0.6.3.
This flake provides a NixOS module for running Open Wearables. It pins the upstream GitHub source and builds the backend and frontend as OCI containers using Docker or Podman.
{
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "nixpkgs/nixos-25.11";
open-wearables.url = "https://src.mfgames.com/nixos-contrib/open-wearables-flake";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
flake.nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
inputs.open-wearables.nixosModules.default
inputs.sops-nix.nixosModules.sops
(
{ config, ... }:
{
services.open-wearables = {
enable = true;
containerRuntime = "podman"; # or "docker"
environmentFile = config.sops.secrets.open-wearables-backend.path;
backendUrl = "https://api.wearables.example.com";
};
sops.secrets.open-wearables-backend = {
sopsFile = ./secrets.yaml;
mode = "0400";
};
}
)
];
};
};
}
Create secrets.yaml with sops secrets.yaml and add the following:
SECRET_KEYMASTER_KEYDB_PASSWORDADMIN_EMAILADMIN_PASSWORD.
Provider credentials and other application settings use the same names documented in Open Wearables' backend/config/.env.example. Add each value to secrets.yaml.
When enableSvix is enabled, also add:
SVIX_JWT_SECRETOUTGOING_WEBHOOKS_ENABLED=true
The service persists PostgreSQL and Redis data beneath /var/lib/open-wearables by default. It exposes the frontend on port 3000, the API on port 8000, and Flower on port 5555. Put a reverse proxy in front of those ports for a public deployment.
Set containerRuntime to "docker" or "podman". It defaults to Docker for compatibility with existing configurations. The module enables the selected runtime and uses its corresponding Compose implementation.
With Podman, writable bind mounts use its U and Z volume options. Podman may change ownership of files below dataDir so the PostgreSQL and Redis container users can access their persistent data.