feat: introduce iproute2 module for linkage
Some checks failed
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>
This commit is contained in:
parent
0c6d26b4fc
commit
9490822c1a
4 changed files with 35 additions and 1 deletions
|
@ -12,6 +12,7 @@ in
|
||||||
"${modulesPath}/hardware.nix"
|
"${modulesPath}/hardware.nix"
|
||||||
"${modulesPath}/base.nix"
|
"${modulesPath}/base.nix"
|
||||||
"${modulesPath}/busybox.nix"
|
"${modulesPath}/busybox.nix"
|
||||||
|
"${modulesPath}/iproute2.nix"
|
||||||
"${modulesPath}/hostname.nix"
|
"${modulesPath}/hostname.nix"
|
||||||
"${modulesPath}/kernel"
|
"${modulesPath}/kernel"
|
||||||
"${modulesPath}/s6"
|
"${modulesPath}/s6"
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
./base.nix
|
./base.nix
|
||||||
./bridge
|
./bridge
|
||||||
./busybox.nix
|
./busybox.nix
|
||||||
|
./iproute2.nix
|
||||||
./dhcp6c
|
./dhcp6c
|
||||||
./jitter-rng
|
./jitter-rng
|
||||||
./dnsmasq
|
./dnsmasq
|
||||||
|
|
28
modules/iproute2.nix
Normal file
28
modules/iproute2.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{ 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -210,6 +210,10 @@ extraPkgs // {
|
||||||
echo "Removing unnecessary binary $out/sbin/$needless_binary"
|
echo "Removing unnecessary binary $out/sbin/$needless_binary"
|
||||||
rm "$out/sbin/$needless_binary"
|
rm "$out/sbin/$needless_binary"
|
||||||
done
|
done
|
||||||
|
# No man
|
||||||
|
rm -rf "$out/share"
|
||||||
|
# Remove all the data about distributions for tc.
|
||||||
|
rm -rf "$out/lib"
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
# Don't bring ebpf stuff to the table.
|
# Don't bring ebpf stuff to the table.
|
||||||
|
|
Loading…
Reference in a new issue