nixos/anubis: add missing botPolicy option implementation
This commit is contained in:
@@ -55,7 +55,7 @@ let
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
botPolicy = lib.mkOption {
|
||||
botPolicy = mkDefaultOption "botPolicy" {
|
||||
default = null;
|
||||
description = ''
|
||||
Anubis policy configuration in Nix syntax. Set to `null` to use the baked-in policy which should be
|
||||
@@ -265,7 +265,18 @@ in
|
||||
wants = [ "network-online.target" ];
|
||||
|
||||
environment = lib.mapAttrs (lib.const (lib.generators.mkValueStringDefault { })) (
|
||||
lib.filterAttrs (_: v: v != null) instance.settings
|
||||
lib.filterAttrs (_: v: v != null) (
|
||||
instance.settings
|
||||
// {
|
||||
POLICY_FNAME =
|
||||
if instance.settings.POLICY_FNAME != null then
|
||||
instance.settings.POLICY_FNAME
|
||||
else if instance.botPolicy != null then
|
||||
jsonFormat.generate "${instanceName name}-botPolicy.json" instance.botPolicy
|
||||
else
|
||||
null;
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
serviceConfig = {
|
||||
|
||||
Reference in New Issue
Block a user