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;
{ config, ... }: let
evalHost = hostName: hostConfig: evalSubmodule types.host [
{ config, ... }: {
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 evalSubmodule types.host [
hostConfig
{
name = hostName;
@ -31,31 +41,13 @@ with import ../../lib;
type = head (toList (match "ssh-([^ ]+) .*" host.config.ssh.pubkey));
};
})
];
hostFiles =
mapAttrs'
])
(mapAttrs'
(name: type: {
name = removeSuffix ".nix" name;
value = ./hosts + "/${name}";
})
(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;
(readDir ./hosts));
sitemap = {
"http://cgit.krebsco.de" = {
desc = "Git repositories";