modules/stayrtr: rename, make enableable
This commit is contained in:
parent
622503946e
commit
5229ec7f24
|
@ -38,15 +38,17 @@ in
|
|||
roa4 table dnroa4;
|
||||
roa6 table dnroa6;
|
||||
|
||||
protocol rpki roa_dn42 {
|
||||
roa4 { table dnroa4; };
|
||||
roa6 { table dnroa6; };
|
||||
remote 127.0.0.1;
|
||||
port 8082;
|
||||
refresh 600;
|
||||
retry 300;
|
||||
expire 7200;
|
||||
}
|
||||
${lib.optionalString config.services.dn42-stayrtr.enable ''
|
||||
protocol rpki roa_dn42 {
|
||||
roa4 { table dnroa4; };
|
||||
roa6 { table dnroa6; };
|
||||
remote 127.0.0.1;
|
||||
port 8082;
|
||||
refresh 600;
|
||||
retry 300;
|
||||
expire 7200;
|
||||
}
|
||||
''}
|
||||
|
||||
include "${../resources/community_filter.conf}";
|
||||
include "${../resources/filters.conf}";
|
||||
|
|
|
@ -6,7 +6,7 @@ in
|
|||
imports = [
|
||||
./firewall.nix
|
||||
./bird2.nix
|
||||
./rtr.nix
|
||||
./stayrtr.nix
|
||||
];
|
||||
|
||||
options.networking.dn42 = {
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
systemd.services.dn42-stayrtr = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.stayrtr}/bin/stayrtr -cache https://dn42.burble.com/roa/dn42_roa_46.json -checktime=false -bind :8082";
|
||||
DynamicUser = true;
|
||||
User = "dn42-stayrtr";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.dn42-stayrtr;
|
||||
|
||||
in
|
||||
{
|
||||
options.services.dn42-stayrtr = with lib; {
|
||||
enable = mkEnableOption "dn42-stayrtr";
|
||||
|
||||
cache = mkOption {
|
||||
type = types.url;
|
||||
default = "https://dn42.burble.com/roa/dn42_roa_46.json";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.dn42-stayrtr = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.stayrtr}/bin/stayrtr -cache '${cfg.cache}' -checktime=false -bind :8082";
|
||||
DynamicUser = true;
|
||||
User = "dn42-stayrtr";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue