diff --git a/lib/modules/programs.nix b/lib/modules/programs.nix index cc33329e..2a6a1eba 100644 --- a/lib/modules/programs.nix +++ b/lib/modules/programs.nix @@ -65,7 +65,6 @@ let [ "plasma" "Plasma" ] [ "pyenv" "pyenv" ] [ "sddm" "SDDM" ] - [ "systemd-networkd" "systemd-networkd" ] [ "vim" "Vim" ] [ "virt-manager" "Virtual Machine Manager" ] [ "waydroid" "Waydroid" ] @@ -96,10 +95,10 @@ in ./programs/btrfs.nix ./programs/docker.nix ./programs/git.nix - ./programs/systemd-networkd.nix ./programs/nextcloud.nix ./programs/oh-my-posh.nix ./programs/rclone.nix + ./programs/systemd-networkd.nix ]; options = { diff --git a/lib/modules/programs/systemd-networkd.nix b/lib/modules/programs/systemd-networkd.nix new file mode 100644 index 00000000..e5a009b8 --- /dev/null +++ b/lib/modules/programs/systemd-networkd.nix @@ -0,0 +1,24 @@ +{ lib, ... }: +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."; + default = builtins.mapAttrs (name: network: lib.generators.toINI { listsAsDuplicateKeys = true; } network); + }; + }; + }; + }; +}