nixos/radvd: add package option

Allow package users to override the package for radvd.
This commit is contained in:
James Hannah 2022-06-30 19:35:53 +01:00 committed by Franz Pletz
parent 977a9b915e
commit c6e76ab7c9

View File

@ -16,9 +16,9 @@ in
###### interface ###### interface
options = { options.services.radvd = {
services.radvd.enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = description =
@ -32,7 +32,16 @@ in
''; '';
}; };
services.radvd.config = mkOption { package = mkOption {
type = types.package;
default = pkgs.radvd;
defaultText = literalExpression "pkgs.radvd";
description = ''
The RADVD package to use for the RADVD service.
'';
};
config = mkOption {
type = types.lines; type = types.lines;
example = example =
'' ''
@ -67,7 +76,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ]; after = [ "network.target" ];
serviceConfig = serviceConfig =
{ ExecStart = "@${pkgs.radvd}/bin/radvd radvd -n -u radvd -C ${confFile}"; { ExecStart = "@${cfg.package}/bin/radvd radvd -n -u radvd -C ${confFile}";
Restart = "always"; Restart = "always";
}; };
}; };