1 { config, lib, pkgs, ... }:
3 cfg = config.services.lldpd;
8 options.services.lldpd = {
9 enable = lib.mkEnableOption "Link Layer Discovery Protocol Daemon";
11 extraArgs = lib.mkOption {
12 type = lib.types.listOf lib.types.str;
14 example = [ "-c" "-k" "-I eth0" ];
15 description = "List of command line parameters for lldpd";
19 config = lib.mkIf cfg.enable {
20 users.users._lldpd = {
21 description = "lldpd user";
26 users.groups._lldpd = {};
28 environment.systemPackages = [ pkgs.lldpd ];
29 systemd.packages = [ pkgs.lldpd ];
31 systemd.services.lldpd = {
32 wantedBy = [ "multi-user.target" ];
33 environment.LLDPD_OPTIONS = lib.concatStringsSep " " cfg.extraArgs;