depot/third_party/nixpkgs/nixos/modules/services/networking/lldpd.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

36 lines
847 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.services.lldpd;
in
{
options.services.lldpd = {
enable = lib.mkEnableOption "Link Layer Discovery Protocol Daemon";
extraArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
example = [ "-c" "-k" "-I eth0" ];
description = "List of command line parameters for lldpd";
};
};
config = lib.mkIf cfg.enable {
users.users._lldpd = {
description = "lldpd user";
group = "_lldpd";
home = "/run/lldpd";
isSystemUser = true;
};
users.groups._lldpd = {};
environment.systemPackages = [ pkgs.lldpd ];
systemd.packages = [ pkgs.lldpd ];
systemd.services.lldpd = {
wantedBy = [ "multi-user.target" ];
environment.LLDPD_OPTIONS = lib.concatStringsSep " " cfg.extraArgs;
};
};
}