Add role-based auto-update host facts #14

Closed
opened 2026-07-01 16:15:49 +01:00 by nimmo · 1 comment
Owner

Goal

Implement Priority 1 from projects/host-facts-refactor-roadmap.md: move auto-update role defaults into durable host facts.

Acceptance Checklist

  • Add a host fact for the auto-update role, with values producer, consumer, or disabled.
  • Make services.nixos-auto-update default from that role while preserving explicit overrides.
  • Encode the existing intended behavior:
    • nova as producer at 03:00
    • electra, lena, vega, and lyra as consumers at 05:00
  • Keep the implementation easy to inspect rather than magical.

Suggested Shape

nixosConfig.autoUpdate.role = lib.mkOption {
  type = lib.types.enum [ "producer" "consumer" "disabled" ];
  default = "consumer";
};

Notes

Prefer implementing this inside the service module unless it becomes obviously cleaner as a wrapper profile.

## Goal Implement Priority 1 from `projects/host-facts-refactor-roadmap.md`: move auto-update role defaults into durable host facts. ## Acceptance Checklist - Add a host fact for the auto-update role, with values `producer`, `consumer`, or `disabled`. - Make `services.nixos-auto-update` default from that role while preserving explicit overrides. - Encode the existing intended behavior: - `nova` as producer at 03:00 - `electra`, `lena`, `vega`, and `lyra` as consumers at 05:00 - Keep the implementation easy to inspect rather than magical. ## Suggested Shape ```nix nixosConfig.autoUpdate.role = lib.mkOption { type = lib.types.enum [ "producer" "consumer" "disabled" ]; default = "consumer"; }; ``` ## Notes Prefer implementing this inside the service module unless it becomes obviously cleaner as a wrapper profile.
Author
Owner

Implemented via commit 24a7568.

Summary:

  • Added nixosConfig.autoUpdate.role with producer, consumer, and disabled values in modules/common/default-config.nix.
  • Updated modules/services/nixos-auto-update.nix so enable, pullOnly, and schedule default from that host fact while still allowing explicit overrides.
  • Set electra, lena, vega, and lyra to consumer and potential/nova to producer.
  • Removed the duplicated per-host services.nixos-auto-update blocks that only existed to express those defaults.
  • Updated the README auto-update section to describe the new role-based behavior.

Validation:

  • nix flake check passed.
  • nix build .#nixosConfigurations.electra.config.system.build.toplevel passed.
  • Deployment on electra succeeded.

Notes:

  • During validation there were transient DNS failures for attic.nimmog.uk and cuda-maintainers.cachix.org, but cache.nixos.org remained usable and did not block the final successful build.
Implemented via commit `24a7568`. Summary: - Added `nixosConfig.autoUpdate.role` with `producer`, `consumer`, and `disabled` values in `modules/common/default-config.nix`. - Updated `modules/services/nixos-auto-update.nix` so `enable`, `pullOnly`, and `schedule` default from that host fact while still allowing explicit overrides. - Set `electra`, `lena`, `vega`, and `lyra` to `consumer` and `potential/nova` to `producer`. - Removed the duplicated per-host `services.nixos-auto-update` blocks that only existed to express those defaults. - Updated the README auto-update section to describe the new role-based behavior. Validation: - `nix flake check` passed. - `nix build .#nixosConfigurations.electra.config.system.build.toplevel` passed. - Deployment on electra succeeded. Notes: - During validation there were transient DNS failures for `attic.nimmog.uk` and `cuda-maintainers.cachix.org`, but `cache.nixos.org` remained usable and did not block the final successful build.
nimmo closed this issue 2026-07-06 14:06:43 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#14
No description provided.