Skip to content

feat(inventory): introduce NixOS-native inventory module system - #209

Draft
MattiasKockum wants to merge 2 commits into
cloud-gouv:mainfrom
MattiasKockum:feat/inventory-refactor
Draft

feat(inventory): introduce NixOS-native inventory module system#209
MattiasKockum wants to merge 2 commits into
cloud-gouv:mainfrom
MattiasKockum:feat/inventory-refactor

Conversation

@MattiasKockum

Copy link
Copy Markdown
Contributor

Adds modules/inventory/ with two new NixOS modules:

  • modules/inventory/users.nix: declares securix.inventory.users.
    options and provisions Linux accounts automatically via users.users
  • modules/inventory/machines.nix: declares securix.inventory.machine options and bridges to securix.self.* via lib.mkDefault

Also adds mkTerminal-refactor and mkTerminals-refactor in lib/default.nix as drop-in replacements that drop userSpecificModule/extraOperators in favor of plain NixOS modules passed via the modules argument.

The existing mkTerminal, mkTerminals and readInventory2 are left intact for backward compatibility. A follow-up commit will be able to deprecate them.

Closes #196 (partial: introduces the new system, migration of bureautix-example and deprecation of the old API are to follow)

Tests:

  • tests/inventory2.nix: regression test for the existing readInventory2
    • mkTerminal behavior
  • tests/inventory-refactor.nix: integration test for the new securix.inventory.* module system

MattiasKockum and others added 2 commits July 4, 2026 14:25
Adds modules/inventory/ with two new NixOS modules:
- modules/inventory/users.nix: declares securix.inventory.users.<name>
  options and provisions Linux accounts automatically via users.users
- modules/inventory/machines.nix: declares securix.inventory.machine
  options and bridges to securix.self.* via lib.mkDefault

Also adds mkTerminal-refactor and mkTerminals-refactor in lib/default.nix
as drop-in replacements that drop userSpecificModule/extraOperators in
favor of plain NixOS modules passed via the modules argument.

The existing mkTerminal, mkTerminals and readInventory2 are left intact
for backward compatibility. A follow-up commit will be able to deprecate them.

Closes cloud-gouv#196 (partial: introduces the new system, migration of
bureautix-example and deprecation of the old API are to follow)

Tests:
- tests/inventory2.nix: regression test for the existing readInventory2
  + mkTerminal behavior
- tests/inventory-refactor.nix: integration test for the new
  securix.inventory.* module system
@rlahfa-dinum
rlahfa-dinum marked this pull request as draft August 14, 2026 15:32
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.

refactor: rethink the static inventory system wrt to NixOS modules

1 participant