summaryrefslogtreecommitdiff
path: root/modules/hosts.nix
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-05-09 17:54:45 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-05-09 17:54:45 -0500
commit4ea08b3976188eb01a74548d68b227a7794b4caa (patch)
tree505c0df98ed00ed592be15895b8ed3eb7aa9e2c3 /modules/hosts.nix
downloadnixos-config-4ea08b3976188eb01a74548d68b227a7794b4caa.tar.gz
nixos-config-4ea08b3976188eb01a74548d68b227a7794b4caa.zip
Add current configuration
Diffstat (limited to 'modules/hosts.nix')
-rw-r--r--modules/hosts.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/hosts.nix b/modules/hosts.nix
new file mode 100644
index 0000000..0c66c70
--- /dev/null
+++ b/modules/hosts.nix
@@ -0,0 +1,25 @@
+{ lib, config, ... }:
+
+let cfg = config.this.hosts;
+in
+{
+ options = {
+ this.hosts.lan.home = lib.mkEnableOption "Home LAN /etc/hosts";
+ this.hosts.mine = lib.mkEnableOption "my /etc/hosts";
+ this.hosts.alef.zoar.cx = lib.mkEnableOption "alef.zoar.cx /etc/hosts";
+ };
+
+ config = {
+ networking.hosts =
+ lib.optionalAttrs cfg.lan.home {
+ "172.19.0.14" = ["sage.alef.zoar.cx" "sage"];
+ "192.168.1.5" = ["rosemary.alef.zoar.cx" "rosemary"];
+ } //
+ lib.optionalAttrs cfg.mine {
+ "45.61.184.234" = ["alfheim"];
+ } //
+ lib.optionalAttrs cfg.alef.zoar.cx {
+ "173.16.167.196" = ["sage.alef.zoar.cx" "sage"];
+ };
+ };
+}