liminix/modules/iproute2.nix
Raito Bezarius 9490822c1a
Some checks failed
build liminix / build_vm_qemu_mips (push) Has been cancelled
build liminix / test_hostapd (push) Has been cancelled
build liminix / build_zyxel-nwa50ax_mips (push) Has been cancelled
build liminix / test_shell_customization (push) Has been cancelled
feat: introduce iproute2 module for linkage
In the future, we will make it possible to choose between iproute2 and
busybox more properly.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-12-09 00:43:45 +01:00

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;
};
};
}