add hosts entries for vpn hosts

This commit is contained in:
Hendrik Sokolowski 2023-11-18 12:52:53 +01:00
parent f310195ee2
commit a7efed6f20
2 changed files with 18 additions and 0 deletions

View file

@ -10,6 +10,7 @@ in
./home.nix
./htop.nix
./ssh.nix
./hosts.nix
];
config = {

17
users/hensoko/hosts.nix Normal file
View file

@ -0,0 +1,17 @@
{ lib, ... }:
let
vpnHosts = [
{ ip = "10.0.1.11"; hosts = [ "giggles.vpn" ]; }
{ ip = "10.0.1.12"; hosts = [ "cox.vpn" ]; }
{ ip = "10.0.1.13"; hosts = [ "companion.vpn" ]; }
];
mkVpnHosts = e: {${e.ip} = e.hosts;};
in
{
networking.hosts =
lib.attrsets.mergeAttrsList (builtins.map mkVpnHosts vpnHosts)
;
}