Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of dns.nix triggers infinite recursion #18

Open
Kreyren opened this issue Jul 8, 2021 · 5 comments
Open

Use of dns.nix triggers infinite recursion #18

Kreyren opened this issue Jul 8, 2021 · 5 comments

Comments

@Kreyren
Copy link

Kreyren commented Jul 8, 2021

I've deployed dns.nix in my config, but this line https://git.dotya.ml/RiXotStudio/system-management/src/branch/central/services/named/bind.nix#L11 causes an infinite recursion that community support in nix's matrix channel suspect is coming from dns.nix

Log: http://ix.io/3sbs

@Kreyren
Copy link
Author

Kreyren commented Jul 8, 2021

CC @kirelagin

@Kreyren
Copy link
Author

Kreyren commented Jul 8, 2021

Removing

subdomains = rec {
		ns = host "213.220.221.43";
	};	

from:

# File integrating https://github.com/kirelagin/dns.nix

{ dns, ... }: with dns.lib.combinators; {
	SOA = {
		# DND(Krey): Integrate `config.networking.fqdn`
		nameServer = "ns.leonid.rixotstudio.cz";
		# FIXME(Krey): Import this domain-wide
		adminEmail = "[email protected]";
		# FIXME(Krey): Generate this YYMMDDHH
		serial = 0;
	};

	NS = [ "ns.leonid.rixotstudio.cz" ];

	# FIXME-QA(Krey): Handle the interface
	# FIXME-QA(Krey): Figure out how to use `networking.interfaces.enp7s0.ipv4.addresses`
	A = [
		{ address = "SYSTEM_IP"; }
	];

	# FIXME(Krey): Integrate logic to set AAAA record
	# AAAA [
	# 	"${networking.interfaces.enp7s0.ipv6.addresses}"
	# ];

	subdomains = rec {
		ns = host "SYSTEM_IP";
	};	
}

With SYSTEM_IP representing IPv4 of the system fixed the issue

@Kreyren Kreyren closed this as completed Jul 8, 2021
@kirelagin
Copy link
Collaborator

kirelagin commented Jul 8, 2021

The problem here is that host takes two arguments: IPv4 and IPv6. So, in your example it should be ns = host "SYSTEM_IP" null;.

The fact that it causes infinite recursion, though, is weird, so I’ll reopen this.

@kirelagin kirelagin reopened this Jul 8, 2021
@Kreyren
Copy link
Author

Kreyren commented Jul 9, 2021

The fact that it causes infinite recursion, though, is weird, so I’ll reopen this. -- @kirelagin

Were you able to reproduce the issue?

@kirelagin
Copy link
Collaborator

Yes, I reproduced it using the zone from your original comment, but it can also be done by removing the second argument of host in the example.nix file in this repository, like so:

diff --git a/example.nix b/example.nix
index 4817f63..f7481b0 100644
--- a/example.nix
+++ b/example.nix
@@ -48,8 +48,8 @@ let
 
     subdomains = rec {
       www.A = [ "203.0.113.4" ];
-      www2 = host "203.0.113.5" "4321:0:1:2:3:4:567:89bb";
-      www3 = host "203.0.113.6" null;
+      www2 = host "203.0.113.5";
+      www3 = host "203.0.113.6";
       www4 = www3;
 
       staging = delegateTo [

which results in:

error: infinite recursion encountered

       at /nix/store/3ghy6irqjf72xmvzvi7j5amy6qp1b347-source/lib/modules.nix:568:27:

          567|     optionalValue =
          568|       if isDefined then { value = mergedValue; }
             |                           ^
          569|       else {};
(use '--show-trace' to show detailed location information)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants