Re: set dnsdomainname

2019-03-06 Thread Marco van Hulten
Je  6 mrt 10:21 skribis Tobias:
> Giovanni Biscuolo wrote:
> > I'd prefer setting the contents "inline" declaring each hosts
> > record... but I don't know how to do it  
> 
> Probably easier than you thought!
> 
>   (host-name "lapdog.tobias.gr")
>   ;; This creates a file /gnu/store/…-hosts and links it as 
>   /etc/hosts.
>   (hosts-file (plain-file "hosts "\
> 127.0.0.1 lapdog.tobias.gr localhost
> ::1   lapdog.tobias.gr localhost
> "))
> 
> Doing it in Scheme also allows one to factor out some of that ugly 
> repetition, if I'd bother.

Great, this works fine!  Thanks, Giovanni and Tobias!

—Marco



Re: set dnsdomainname

2019-03-06 Thread Tobias Geerinckx-Rice

Giovanni, Marco,

Giovanni Biscuolo wrote:

I'd prefer setting the contents "inline" declaring each hosts
record... but I don't know how to do it


Probably easier than you thought!

 (host-name "lapdog.tobias.gr")
 ;; This creates a file /gnu/store/…-hosts and links it as 
 /etc/hosts.

 (hosts-file (plain-file "hosts "\
127.0.0.1 lapdog.tobias.gr localhost
::1   lapdog.tobias.gr localhost
"))

Doing it in Scheme also allows one to factor out some of that ugly 
repetition, if I'd bother.


Kind regards,

T G-R



Re: set dnsdomainname

2019-03-05 Thread Giovanni Biscuolo
Hi Marco,

Marco van Hulten  writes:

[...]

> I found that one can edit /etc/hosts , starting with something like:
>
> 127.0.0.1  localhost
> 127.0.1.1  myhost.mydomain  myhost

for hosts you have to configure "hosts-file" [1] in your
operating-system section

I found this in an old thread [2]:

--8<---cut here---start->8---
you can keep your hosts file wherever you want, let's say
"~/my-config/hosts"; and you can add this line to your operating-system
declaration:

  (hosts-file (local-file (string-append (getenv "HOME")
 "/my-config/hosts")))

After reconfiguring your system, this file will be put into the store,
and /etc/hosts will have the same contents after reboot.
--8<---cut here---end--->8---

I'd prefer setting the contents "inline" declaring each hosts
record... but I don't know how to do it

HTH!
Giovanni


[1] 
https://www.gnu.org/software/guix/manual/en/html_node/operating_002dsystem-Reference.html#index-hosts-file

[2] https://lists.gnu.org/archive/html/bug-guix/2016-03/msg00114.html

-- 
Giovanni Biscuolo

Xelera IT Infrastructures


signature.asc
Description: PGP signature


Re: set dnsdomainname

2019-03-05 Thread Marco van Hulten
Je  5 mrt 11:30 skribis Marco:
> Hello Guix—
> 
> I want `dnsdomainname` to be set on my system with GuixSD (because it
> is used as a destination in my Postfix configuration).  How do I go
> about this?
> 
> The system with GuixSD gets network information from my Debian 8 server
> that runs the ISC DHCP server.  So I thought the best approach would be
> to configure the DHCP server by adding this near the top of dhcpd.conf:
> 
> ddns-updates on;
> ddns-domainname "instanton";
> 
> But it doesn't get picked up by the GuixSD client system.
> 
> Is there a way to specify full hostname(1) information (`hostname
> --fqdn`, `dnsdomainname`) in Guix' system configuration?

I found that one can edit /etc/hosts , starting with something like:

127.0.0.1  localhost
127.0.1.1  myhost.mydomain  myhost

but of course this is overwritten by the Guix system (at reboot).

—Marco



set dnsdomainname

2019-03-05 Thread Marco van Hulten
Hello Guix—

I want `dnsdomainname` to be set on my system with GuixSD (because it
is used as a destination in my Postfix configuration).  How do I go
about this?

The system with GuixSD gets network information from my Debian 8 server
that runs the ISC DHCP server.  So I thought the best approach would be
to configure the DHCP server by adding this near the top of dhcpd.conf:

ddns-updates on;
ddns-domainname "instanton";

But it doesn't get picked up by the GuixSD client system.

Is there a way to specify full hostname(1) information (`hostname
--fqdn`, `dnsdomainname`) in Guix' system configuration?

—Marco