Skip to content

feat(flake): expose defaultLifetime + extraArgs on nixosModules.default#42

Merged
UnbreakableMJ merged 1 commit into
mainfrom
feat/nixos-module-defaultlifetime
May 8, 2026
Merged

feat(flake): expose defaultLifetime + extraArgs on nixosModules.default#42
UnbreakableMJ merged 1 commit into
mainfrom
feat/nixos-module-defaultlifetime

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Summary

  • Mirror homeManagerModules.default's defaultLifetime and extraArgs options on nixosModules.default, removing the need for downstream lib.mkForce ExecStart overrides to set a key TTL.
  • Build the agent ExecStart with lib.concatStringsSep + lib.optionals in the same shape as the home-manager variant; default behavior is unchanged when neither option is set.
  • CHANGELOG entry under [Unreleased].

Motivation

A downstream Lattice consumer wanted system-scoped services.gitway-agent.defaultLifetime = 86400 (24 h) but the nixosModule's ExecStart was hardcoded with no TTL flag, so the only path was a lib.mkForce override of systemd.user.services.gitway-agent.serviceConfig.ExecStart. The two modules now expose the same surface area; pick the scope that suits your deployment without losing TTL / extra-flag control.

Test plan

  • nix flake check --no-build — passes; only pre-existing warnings (homeManagerModules not in flake schema, apps.default lacks meta) remain.
  • Smoke-rebuild a NixOS host with services.gitway-agent.defaultLifetime = 86400; and confirm systemctl --user cat gitway-agent.service shows -t 86400 in ExecStart.
  • Confirm services.gitway-agent.enable = true; with neither option set produces an ExecStart byte-identical to the previous hardcoded line (default-equivalence check).

🤖 Generated with Claude Code

Mirror the homeManagerModule's `defaultLifetime` and `extraArgs`
options on the system-scoped nixosModule so callers no longer have
to override `systemd.user.services.gitway-agent.serviceConfig.ExecStart`
with `lib.mkForce` to set a key TTL.

ExecStart is now built with `lib.concatStringsSep` + `lib.optionals`
in the same shape as the home-manager variant: `-t <seconds>` is
appended only when `defaultLifetime != null`, and `extraArgs` is
spliced after the TTL flag.  Default behavior is unchanged when
neither option is set.

Surfaced from a downstream Lattice consumer that wanted a system-wide
24 h TTL via `services.gitway-agent.defaultLifetime = 86400` and was
forced into a `mkForce` ExecStart override.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@UnbreakableMJ UnbreakableMJ force-pushed the feat/nixos-module-defaultlifetime branch from de72cdb to 63021b4 Compare May 8, 2026 17:55
@UnbreakableMJ UnbreakableMJ merged commit 19b45fd into main May 8, 2026
10 checks passed
@UnbreakableMJ UnbreakableMJ deleted the feat/nixos-module-defaultlifetime branch May 8, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant