feat: allow using suite on non-nixos systems

This commit is contained in:
FUFSoB committed 2026-09-17 13:27:08 +05:00
1 parent e852bef400
commit 3b568bb54e
63 files changed
+3572 -523

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
# Shared by the adapters whose host runs NixOS's own systemd unit options (NixOS,
# system-manager).
{ lib }:
rec {
# Only what the core set: an internal option's default would add a definition of its
# own. Definitions are forwarded rather than values, so priorities nested inside them
# (mkDefault in a unit, say) still meet the rest of the host's.
forwardWith =
wrap: option:
lib.mkIf (option.highestPrio < (lib.mkOptionDefault null).priority) (
lib.mkMerge (map wrap option.definitions)
);
forward = forwardWith lib.id;
# Scripts share one store name per block, and journald names a unit's output
# after its ExecStart basename; tag each unit with its own name instead.
unitsWithOwnSyslogIdentifier = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule (
{ name, ... }:
{
config.serviceConfig.SyslogIdentifier = lib.mkIf (lib.hasPrefix "proxy-suite-" name) (
lib.mkDefault (lib.removeSuffix "@" name)
);
}
)
);
};
}