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