den icon indicating copy to clipboard operation
den copied to clipboard

Should `os` class also deliver `systemManager` configuration?

Open theutz opened this issue 1 month ago • 2 comments

Open for deliberation, but I think it maybe should. Given that there are already differences in what config can be shared between nixos and nix-darwin, anyone using System Manager in their infra should already be cognizant of the trade-offs.

theutz avatar Oct 07 '26 07:10 theutz

Here's a drop-in fix for anyone who wants this in the future:

{ den, lib, ... }:
{
  # Route `os` class content into systemManager-class hosts as well
  den.policies.os-to-system-manager =
    { host, ... }:
    lib.optional (host ? class && host.class == "systemManager") (
      den.lib.policy.route {
        fromClass = "os";
        intoClass = "systemManager";
        path = [ ];
      }
    );

  den.default.includes = [ den.policies.os-to-system-manager ];
}

theutz avatar Oct 07 '26 17:10 theutz

Sorry for the slow reply. I'd rather not do this by default. Most os content is NixOS or darwin options, and system-manager would refuse a lot of it, so turning it on would break configs that work today. Your policy is the right shape for opting in. I'd like to fold this into a small change that lets a custom OS class (system-manager included) opt into os routing, since #663 turned up the same gap for custom classes. Until then, your snippet is the way to do it.

sini avatar Dec 04 '26 23:12 sini