Created
March 22, 2023 14:58
-
-
Save PedroHLC/6634f606100296628a5adb8f79da2e01 to your computer and use it in GitHub Desktop.
Returns dnsname-cni to nixpkgs' podman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, ... }: | |
{ | |
environment.etc."cni/net.d/87-podman-bridge.conflist".source = | |
let | |
cfgExtraPlugins = [{ | |
type = "dnsname"; | |
domainName = "dns.podman"; | |
capabilities.aliases = true; | |
}]; | |
cfgPackage = pkgs.podman; | |
in | |
pkgs.runCommand "87-podman-bridge.conflist" | |
{ | |
nativeBuildInputs = [ pkgs.jq ]; | |
extraPlugins = builtins.toJSON cfgExtraPlugins; | |
jqScript = '' | |
. + { "plugins": (.plugins + $extraPlugins) } | |
''; | |
} '' | |
jq <${cfgPackage.src}/cni/87-podman-bridge.conflist \ | |
--argjson extraPlugins "$extraPlugins" \ | |
"$jqScript" \ | |
>$out | |
''; | |
virtualisation.containers.containersConf.cniPlugins = [ pkgs.dnsname-cni ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment