2024-12-08 00:57:18 +00:00
|
|
|
{ lib, config, ... }:
|
2024-12-07 22:45:31 +00:00
|
|
|
let
|
|
|
|
inherit (lib) mkEnableOption mkOption types;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
valhalla = {
|
|
|
|
linux.programs.systemd-networkd = {
|
|
|
|
enable = mkEnableOption "systemd-networkd";
|
|
|
|
|
|
|
|
networks = mkOption {
|
|
|
|
type = types.attrsOf types.attrs;
|
|
|
|
description = "The networks to configure.";
|
|
|
|
};
|
|
|
|
|
|
|
|
networkFiles = mkOption {
|
|
|
|
type = types.attrsOf types.str;
|
|
|
|
description = "The files for configuring the networks.";
|
2024-12-08 00:57:18 +00:00
|
|
|
default = builtins.mapAttrs
|
|
|
|
(name: network: lib.generators.toINI { listsAsDuplicateKeys = true; } network)
|
|
|
|
config.valhalla.linux.programs.systemd-networkd.networks;
|
2024-12-07 22:45:31 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|