From 63d770b1c16f3aa40b04b88d0a1811679308f4c2 Mon Sep 17 00:00:00 2001 From: Robert Gerus Date: Sun, 18 Feb 2024 13:43:54 +0100 Subject: [PATCH] meta: avoid repetition with targetHost --- meta.nix | 6 +++++- nixos/akamanto/meta.json | 1 - nixos/amanojaku/meta.json | 1 - nixos/khas/meta.json | 1 - nixos/microlith/meta.json | 1 - nixos/scylla/meta.json | 1 - nixos/stereolith/meta.json | 1 - nixos/tsukumogami/meta.json | 1 - nixos/zorigami/meta.json | 1 - 9 files changed, 5 insertions(+), 9 deletions(-) diff --git a/meta.nix b/meta.nix index a3ffb13..c3792a7 100644 --- a/meta.nix +++ b/meta.nix @@ -3,9 +3,13 @@ let "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfIRe1nH6vwjQTjqHNnkKAdr1VYqGEeQnqInmf3A6UN ar@khas"; ar_microlith = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO6rEwERSm/Fj4KO4SxFIo0BUvi9YNyf8PSL1FteMcMt ar@microlith"; + defaultDomain = "tail412c1.ts.net"; in { hosts = builtins.mapAttrs (name: value: - builtins.fromJSON (builtins.readFile (./nixos/. + "/${name}/meta.json"))) + { + targetHost = name + "." + defaultDomain; + } + // builtins.fromJSON (builtins.readFile (./nixos/. + "/${name}/meta.json"))) (builtins.readDir ./nixos); users.ar = [ ar_khas ar_microlith ]; diff --git a/nixos/akamanto/meta.json b/nixos/akamanto/meta.json index 5238fe7..07f0f77 100644 --- a/nixos/akamanto/meta.json +++ b/nixos/akamanto/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKb4i+BmIb2wiT4y5uWsCOmSo1dRp6Ql36toUsRHN6pC", - "targetHost": "akamanto.tail412c1.ts.net", "system": "aarch64-linux" } \ No newline at end of file diff --git a/nixos/amanojaku/meta.json b/nixos/amanojaku/meta.json index 4a631fa..e8be2b3 100644 --- a/nixos/amanojaku/meta.json +++ b/nixos/amanojaku/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE4rFVYs5t4uBpZK9kmDQkr9ONLDE41jOCP/tMmM+SMb", - "targetHost": "amanojaku.tail412c1.ts.net", "system": "x86_64-linux" } diff --git a/nixos/khas/meta.json b/nixos/khas/meta.json index 0bcc2a3..78fdd4d 100644 --- a/nixos/khas/meta.json +++ b/nixos/khas/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO6VxPqJHYKmVB5d7bd6vuRqBNKXV1fo2R/WvdSF77xa", - "targetHost": "khas.tail412c1.ts.net", "system": "x86_64-linux" } \ No newline at end of file diff --git a/nixos/microlith/meta.json b/nixos/microlith/meta.json index c5085f2..b7c06f7 100644 --- a/nixos/microlith/meta.json +++ b/nixos/microlith/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDghNuH/3G+0BXwrBZWZXX0V3K0tfu/Q/AKokLXY5zTD", - "targetHost": "microlith.tail412c1.ts.net", "system": "x86_64-linux" } \ No newline at end of file diff --git a/nixos/scylla/meta.json b/nixos/scylla/meta.json index 16eb0e5..055af82 100644 --- a/nixos/scylla/meta.json +++ b/nixos/scylla/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1X7EaPNfLhWH32IAyaZj2dhJz+QLnyGuXPCZUYRTjg", - "targetHost": "scylla.tail412c1.ts.net", "system": "aarch64-linux" } \ No newline at end of file diff --git a/nixos/stereolith/meta.json b/nixos/stereolith/meta.json index e8039d2..d119040 100644 --- a/nixos/stereolith/meta.json +++ b/nixos/stereolith/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEVuDOcKE8ANKGjd6kfFH1qLLzLwg91o0exJ0isIEw4O", - "targetHost": "stereolith.tail412c1.ts.net", "system": "x86_64-linux" } \ No newline at end of file diff --git a/nixos/tsukumogami/meta.json b/nixos/tsukumogami/meta.json index 37b31a2..367dca9 100644 --- a/nixos/tsukumogami/meta.json +++ b/nixos/tsukumogami/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL/Cl0F5WUxDTaQAlb+bYpQ0sCRuFQlf3MHJ4+3/KfYi", - "targetHost": "tsukumogami.tail412c1.ts.net", "system": "aarch64-linux" } diff --git a/nixos/zorigami/meta.json b/nixos/zorigami/meta.json index d2838e6..2782c1b 100644 --- a/nixos/zorigami/meta.json +++ b/nixos/zorigami/meta.json @@ -1,5 +1,4 @@ { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM/7CsIWlJH2F0VQpgsGgZOQeAd7Zh98WpCvmTyXCTty", - "targetHost": "zorigami.tail412c1.ts.net", "system": "x86_64-linux" } \ No newline at end of file