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

provide a hostTTL function #3

Open
kloenk opened this issue Aug 15, 2020 · 3 comments
Open

provide a hostTTL function #3

kloenk opened this issue Aug 15, 2020 · 3 comments

Comments

@kloenk
Copy link
Member

kloenk commented Aug 15, 2020

Currently its a little annoying to create a subdomain host with a specific TTL. I would suggest something like the following:

{
  hostTTL = ttl: ipv4: ipv6:
     lib.optionalAttrs (ipv4 != null) { A = [{ address = ipv4; inherit ttl; }]; } //
     lib.optionalAttrs (ipv6 != null) { AAAA = [{ address = ipv6; inherit ttl; }]; };
}
@kirelagin
Copy link
Collaborator

I think you can do either:

{
  subdomains.foo.A = [ (a "1.1.1.1" // { ttl = 50; }) ];
}

or

{
  subdomains.foo.A = [ (ttl 60 (a "1.1.1.1")) ];
}

I think it would also help if the ttl combinator could work recursively so that you could apply it to an entire zone/subzone.

Regarding creating simple subdomain hosts, I completely agree that it’s annoying, however I don’t know how to make it better in an unambiguous way. I was thinking about building yet another higher-level DSL on top of this one, that would be ambiguous but would allow for easier hosts definitions.

@kloenk
Copy link
Member Author

kloenk commented Oct 8, 2020

Your ttl function would mean, I would have to specify A and AAAA records separately. My idea was to create a shorthand function for this.

@eyJhb
Copy link

eyJhb commented Apr 29, 2021

Is there anything that goes against specifying a default TTL, and then editing it on a case on case basis?

EDIT: I stand corrected, there is a $TTL. Sorry! But for subdomains it would be nice as well :)

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

3 participants