Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

ci: drop the Nix gate from the GitLab pipeline

gerrydoro1fcccac4964a
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b77ad4cf6..f2c470392 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -48,10 +48,6 @@ stages:
variables:
# node:22-alpine in web/Dockerfile and api/Dockerfile — CI must match production.
NODE_IMAGE: "node:22-alpine"
- # Nix for the flake tests. Pinned, not `latest`: the VM integration test (tests.nix) and the
- # package builds must be reproducible against a stable toolchain. 2.34.8 matches what the
- # maintainer builds against locally.
- NIX_IMAGE: "nixos/nix:2.34.8"
DOCKER_IMAGE: "docker:28-cli"
DOCKER_DIND_IMAGE: "docker:28-dind"
TRIVY_IMAGE: "aquasec/trivy:0.74.0"
@@ -276,92 +272,6 @@ test:api:
- !reference [.rules, not_on_schedule]
- when: on_success
-# ------------------------------------------------------------------------------ nix
-
-# The Nix flake (flake.nix → nix/) is a first-class packaging path for self-hosters on NixOS,
-# so it gets its own gate. This job:
-# * runs the module-eval check (checks.nixos-module-eval), validating the NixOS module wiring
-# (services/users/systemd/nginx state) against a smoke-test config, and
-# * builds every app package (#opengym-frontend, #opengym-api, #opengym-mcp) — actually
-# building each derivation catches a broken buildPhase/installPhase that eval alone would
-# miss.
-#
-# The full `nix flake check` also runs the NixOS VM integration test (nixosTests.opengym,
-# nix/tests.nix), but that derivation requires the `kvm` system feature, which GitLab shared
-# runners do not provide (their features are: benchmark, big-parallel, nixos-test, uid-range —
-# no kvm). So the VM test is deliberately left out of CI; run `nix flake check` on a
-# KVM-capable self-hosted runner to exercise it.
-#
-# Nix comes from the official nixos/nix image. The store stays at its default /nix/store so the
-# locked nixpkgs derivations resolve straight from the cache.nixos.org binary cache (relocating
-# it under the project dir made Nix rebuild the bootstrap from source — slow gnu.org tarball
-# downloads — which is why it's not cached). sandbox is disabled because a container has no
-# usable kernel sandbox.
-#
-# The job only runs when the flake packaging actually changed — anything under nix/, the two
-# flake files, or this pipeline itself (a branch push or MR that touches none of those skips
-# it; release tags always run it). MR pipelines with no nix change keep a manual fallback.
-test:nix:
- stage: test
- image: $NIX_IMAGE
- interruptible: true
- variables:
- # Keep the *default* store (/nix/store) so the flake's locked nixpkgs derivations resolve
- # straight from cache.nixos.org. The earlier attempt to relocate the store under the project
- # dir for GitLab caching backfired: cache.nixos.org only serves /nix/store paths, so a
- # relocated store built the entire bootstrap toolchain from source (slow gnu.org tarball
- # downloads, 502s). With the default store the shared runners just substitute from the binary
- # cache.
- #
- # NIX_CONFIG is nix.conf content, one key per line:
- # * experimental-features — enable `nix flake`.
- # * sandbox = false — a container has no usable kernel sandbox, and disabling it also
- # avoids the Nix 2.30+ build-dir check tripping on the world-writable /builds dir
- # (NixOS/nix#13701) that the default-store build-dir path is unaffected by, but being
- # explicit here is simplest and matches what Nix-on-GitLab CI does everywhere.
- NIX_CONFIG: |
- experimental-features = nix-command flakes
- sandbox = false
- script:
- - |
- set -euo pipefail
- SYSTEM="$(nix eval --impure --raw --expr 'builtins.currentSystem')"
- echo "system: $SYSTEM"
- # Locked inputs first: `nix develop`/`nix run`/CI must all agree with the committed lock.
- nix flake lock --no-update-lock-file
- # The module-eval check validates the NixOS module wiring (services/users/systemd/nginx
- # state) against a smoke-test config. The full `nix flake check` also runs the NixOS VM
- # integration test (nixosTests.opengym), which needs the `kvm` system feature — not present
- # on GitLab shared runners (Available: benchmark, big-parallel, nixos-test, uid-range), so
- # it would fail here. Run it instead on a KVM-capable self-hosted runner; CI covers
- # evaluation + every app package here.
- echo "== module-eval check =="
- nix build ".#checks.$SYSTEM.nixos-module-eval" --no-link
- echo "== building packages =="
- nix build ".#opengym-frontend" ".#opengym-api" ".#opengym-mcp" --no-link
- rules:
- # A scheduled pipeline exists only to run `renovate` (bottom of this file) — it must not
- # re-run the suite once a month for nothing.
- - if: $CI_PIPELINE_SOURCE == "schedule"
- when: never
- # Release tags always get the full nix gate regardless of what changed — the tag is what
- # self-hosters pull, so it must never ship with a broken flake.
- - if: $CI_COMMIT_TAG
- # Everything else (branch pushes and MRs): only when the push/MR actually touches the
- # flake packaging or the pipeline itself.
- - if: $CI_COMMIT_BRANCH || $CI_PIPELINE_SOURCE == "merge_request_event"
- changes:
- paths:
- - "nix/**/*"
- - "flake.nix"
- - "flake.lock"
- - ".gitlab-ci.yml"
- # MR pipelines with no nix-related change: one click away, so a contributor can still run
- # the flake checks when the change affects them indirectly.
- - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- when: manual
- allow_failure: true
-
# --------------------------------------------------------------------------- images
# Images land at registry.gitlab.com/duartesantos8/opengym/{api,web} and are what