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

networking.extraHosts doesn't work #230

Closed
zeratax opened this issue Mar 13, 2023 · 2 comments · Fixed by #233
Closed

networking.extraHosts doesn't work #230

zeratax opened this issue Mar 13, 2023 · 2 comments · Fixed by #233
Labels
bug Something isn't working

Comments

@zeratax
Copy link

zeratax commented Mar 13, 2023

Bug description

Just using networking.extraHosts will not change the /etc/hosts file since that one is by default managed by WSL.

To Reproduce

set
config.networking.extraHosts = 'test 127.0.0.1'

Expected behavior
I think either there should be an assertion that makes sure that wsl.wslConf.network.generateHosts and networking.extraHosts aren't set together, or even more ideally would be ofc a solution where we could still append to the wsl hosts config ^^

@zeratax zeratax added the bug Something isn't working label Mar 13, 2023
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Mar 14, 2023

We already have

etc = mkMerge [
(mkIf config.wsl.wslConf.network.generateHosts {
hosts.enable = false;
})
(mkIf config.wsl.wslConf.network.generateResolvConf {
"resolv.conf".enable = false;
})
];

Not sure if adding an assert and requiring to clean that option, would be good UX.

@nzbr
Copy link
Member

nzbr commented Mar 14, 2023

There should probably be a warning, when you try to use extraHosts while wsl.wslConf.network.generateHosts is true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants