kartei tv: move around hostFiles & co.

This commit is contained in:
tv 2022-12-29 17:33:07 +01:00
parent cda9bcfaff
commit 9cb022698e

View File

@ -1,7 +1,17 @@
with import ../../lib; with import ../../lib;
{ config, ... }: let { config, ... }: {
dns.providers = {
evalHost = hostName: hostConfig: evalSubmodule types.host [ "viljetic.de" = "regfish";
};
hosts =
mapAttrs
(hostName: hostFile: let
hostSource = import hostFile;
hostConfig = getAttr (typeOf hostSource) {
lambda = hostSource { inherit config lib; };
set = hostSource;
};
in evalSubmodule types.host [
hostConfig hostConfig
{ {
name = hostName; name = hostName;
@ -31,31 +41,13 @@ with import ../../lib;
type = head (toList (match "ssh-([^ ]+) .*" host.config.ssh.pubkey)); type = head (toList (match "ssh-([^ ]+) .*" host.config.ssh.pubkey));
}; };
}) })
]; ])
(mapAttrs'
hostFiles =
mapAttrs'
(name: type: { (name: type: {
name = removeSuffix ".nix" name; name = removeSuffix ".nix" name;
value = ./hosts + "/${name}"; value = ./hosts + "/${name}";
}) })
(readDir ./hosts); (readDir ./hosts));
in {
dns.providers = {
"viljetic.de" = "regfish";
};
hosts =
mapAttrs
(hostName: hostFile: let
hostSource = import hostFile;
hostConfig = getAttr (typeOf hostSource) {
lambda = hostSource { inherit config lib; };
set = hostSource;
};
in
evalHost hostName hostConfig)
hostFiles;
sitemap = { sitemap = {
"http://cgit.krebsco.de" = { "http://cgit.krebsco.de" = {
desc = "Git repositories"; desc = "Git repositories";