From a7efed6f2095f29482118ea540d05f9f4e2e1ccd Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 18 Nov 2023 12:52:53 +0100 Subject: [PATCH] add hosts entries for vpn hosts --- users/hensoko/default.nix | 1 + users/hensoko/hosts.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 users/hensoko/hosts.nix diff --git a/users/hensoko/default.nix b/users/hensoko/default.nix index 33eebfd0..ee531d0c 100644 --- a/users/hensoko/default.nix +++ b/users/hensoko/default.nix @@ -10,6 +10,7 @@ in ./home.nix ./htop.nix ./ssh.nix + ./hosts.nix ]; config = { diff --git a/users/hensoko/hosts.nix b/users/hensoko/hosts.nix new file mode 100644 index 00000000..4f9bb2fe --- /dev/null +++ b/users/hensoko/hosts.nix @@ -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) + ; +}