Add hook guard for machine platform literals outside inventory #107
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#107
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Machine platform strings should come from inventory, but it is easy to reintroduce literals such as
x86_64-linuxandaarch64-linuxin non-inventory flakes or modules when adding checks or defaults.Related cleanup evidence:
checkSystems = [ "x86_64-linux" "aarch64-linux" ]duplicates check platform keys outside inventory.nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"duplicates a machine platform inside the VM framework module.Proposed Direction
Add a shared
pre-commitguard in theallod/toolsgit hook stack.The guard should inspect staged added lines and reject newly introduced Nix system literals in non-inventory repos unless the line is explicitly allowed as a host-tool exposure surface.
allod/toolsis the right owner because it already owns:git-hooks/protected-refs-policy.hookspathgit-hooks/setup-tracked-hooksPolicy Sketch
git diff --cached -U0.git remote get-url origin.allod/inventory.x86_64-linuxoraarch64-linux.Acceptance
checkSystems = [ "x86_64-linux" "aarch64-linux" ];inallod/profilesis rejected.nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";inallod/vmis rejected.allod/inventoryis allowed.