9490822c1a
Some checks failed
In the future, we will make it possible to choose between iproute2 and busybox more properly. Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
28 lines
616 B
Nix
28 lines
616 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
inherit (lib) mkEnableOption mkPackageOption mkIf genAttrs;
|
|
inherit (pkgs.pseudofile) dir symlink;
|
|
cfg = config.programs.iproute2;
|
|
minimalPrograms = [
|
|
"ip"
|
|
"devlink"
|
|
"ss"
|
|
"bridge"
|
|
"genl"
|
|
"ifstat"
|
|
"nstat"
|
|
];
|
|
links = genAttrs minimalPrograms (p: symlink "${cfg.package}/bin/${p}");
|
|
in
|
|
{
|
|
options.programs.iproute2 = {
|
|
enable = mkEnableOption "the iproute2 programs instead of busybox variants";
|
|
package = mkPackageOption pkgs "iproute2" { };
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
filesystem = dir {
|
|
bin = dir links;
|
|
};
|
|
};
|
|
}
|