Format
This commit is contained in:
parent
469c2e9393
commit
2ab3e1bdb4
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
|
@ -253,36 +253,38 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
programs.vim.defaultEditor = true;
|
||||
programs = {
|
||||
ssh.knownHosts = with builtins;
|
||||
let
|
||||
hostNames = hostRegistry.hqLocal;
|
||||
intersectKeys = intersectAttrs {
|
||||
publicKey = null;
|
||||
publicKeyFile = null;
|
||||
};
|
||||
list = map (name:
|
||||
let
|
||||
host = getAttr name hostRegistry.hosts;
|
||||
sshAttrs = intersectKeys host;
|
||||
in if sshAttrs == { } then
|
||||
null
|
||||
else {
|
||||
inherit name;
|
||||
value = let
|
||||
ip6 = if hasAttr "ip6" host then
|
||||
host.ip6
|
||||
else
|
||||
toHqPrivateAddress name;
|
||||
in {
|
||||
publicKey = null;
|
||||
publicKeyFile = null;
|
||||
hostNames = [ ip6 "${name}.hq.c3d2.de" "${name}.hq" name ];
|
||||
} // sshAttrs;
|
||||
}) hostNames;
|
||||
keyedHosts = filter (x: x != null) list;
|
||||
in listToAttrs keyedHosts;
|
||||
|
||||
programs.ssh.knownHosts = with builtins;
|
||||
let
|
||||
hostNames = hostRegistry.hqLocal;
|
||||
intersectKeys = intersectAttrs {
|
||||
publicKey = null;
|
||||
publicKeyFile = null;
|
||||
};
|
||||
list = map (name:
|
||||
let
|
||||
host = getAttr name hostRegistry.hosts;
|
||||
sshAttrs = intersectKeys host;
|
||||
in if sshAttrs == { } then
|
||||
null
|
||||
else {
|
||||
inherit name;
|
||||
value = let
|
||||
ip6 = if hasAttr "ip6" host then
|
||||
host.ip6
|
||||
else
|
||||
toHqPrivateAddress name;
|
||||
in {
|
||||
publicKey = null;
|
||||
publicKeyFile = null;
|
||||
hostNames = [ ip6 "${name}.hq.c3d2.de" "${name}.hq" name ];
|
||||
} // sshAttrs;
|
||||
}) hostNames;
|
||||
keyedHosts = filter (x: x != null) list;
|
||||
in listToAttrs keyedHosts;
|
||||
vim.defaultEditor = true;
|
||||
};
|
||||
|
||||
services.mpd.extraConfig = lib.mkIf cfg.hq.enableMpdProxy ''
|
||||
database {
|
||||
|
|
Loading…
Reference in New Issue