feat: experimenting with custom local hosts

This commit is contained in:
Zhongheng Liu 2024-12-17 00:53:10 +02:00
commit 64e476798d
Signed by: steven
GPG key ID: 805A28B071DAD84B
2 changed files with 19 additions and 5 deletions

13
nixos/custom-hosts.nix Normal file
View file

@ -0,0 +1,13 @@
{
config,
lib,
pkgs,
...
}: {
networking.extraHosts = ''
# home IP mapping
192.168.2.1 router.home
192.168.2.2 server.home
'';
}

View file

@ -1,4 +1,8 @@
{pkgs, ...}: {
{
pkgs,
config,
...
}: {
services.nginx = {
enable = true;
virtualHosts."localhost" = {
@ -11,10 +15,7 @@
'';
};
};
listenAddresses = [
"127.0.0.1"
"[::1]"
];
listenAddresses = ["127.0.0.1" "[::1]"];
};
};
networking.firewall.allowedTCPPorts = [80];