{ config, lib, pkgs, ... }: let inherit (lib) types; inherit (config.environment) etc; cfg = config.security.apparmor; enabledPolicies = lib.filterAttrs (n: p: p.state != "disable") cfg.policies; buildPolicyPath = n: p: lib.defaultTo (pkgs.writeText n p.profile) p.path; # Accessing submodule options when not defined results in an error thunk rather than a regular option object # We can emulate the behavior of `