mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
nixos/services.lldpd: remove with lib;
This commit is contained in:
parent
0d57426bae
commit
196a14a174
1 changed files with 5 additions and 8 deletions
|
@ -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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue