- Define homelab.workloadGrants attrsOf submodule in nixos/modules/homeserver.nix with devices, groups, and readOnlyPaths - Add Nix assertions rejecting privileged groups (0, root, wheel, docker) and relative/traversal paths - Generate /etc/homelab/grants.json (root:homelab-operators 0640) and wire HOMELAB_GRANTS_FILE into homelab-appctl and homelab-gitops - Add tracked nixos/instance.example.nix and prioritize /etc/nixos/homelab-instance.nix over nixos/instance.nix - Add structural and security invariant tests for workloadGrants and instance.example.nix
21 lines
672 B
Nix
21 lines
672 B
Nix
# Example host-local instance configuration for Canopy NixOS Core.
|
|
# Copy to /etc/nixos/homelab-instance.nix (recommended, loaded with --impure)
|
|
# or gitignored nixos/instance.nix, and customize for your host.
|
|
{ ... }:
|
|
|
|
{
|
|
homelab.domain = "example.com";
|
|
homelab.operatorUser = "operator";
|
|
|
|
# Host-granted workload capabilities ("Compose Requests, Nix Grants" — ADR-0005).
|
|
# Keyed by workload name matching ~/Workloads/<app>.
|
|
homelab.workloadGrants = {
|
|
# Example hardware-accelerated media workload:
|
|
# media-server = {
|
|
# devices = [ "/dev/dri/renderD128" ];
|
|
# groups = [ "render" ];
|
|
# readOnlyPaths = [ "/mnt/media" ];
|
|
# };
|
|
};
|
|
}
|