nixos/services.lldpd: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-28 21:19:11 +02:00 committed by Jörg Thalheim
parent 0d57426bae
commit 196a14a174

View File

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.lldpd;
@ -9,17 +6,17 @@ in
{
options.services.lldpd = {
enable = mkEnableOption "Link Layer Discovery Protocol Daemon";
enable = lib.mkEnableOption "Link Layer Discovery Protocol Daemon";
extraArgs = mkOption {
type = types.listOf types.str;
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 = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
users.users._lldpd = {
description = "lldpd user";
group = "_lldpd";
@ -33,7 +30,7 @@ in
systemd.services.lldpd = {
wantedBy = [ "multi-user.target" ];
environment.LLDPD_OPTIONS = concatStringsSep " " cfg.extraArgs;
environment.LLDPD_OPTIONS = lib.concatStringsSep " " cfg.extraArgs;
};
};
}