* tv identity: hosts.*.search -> search
This commit is contained in:
parent
504b1b90e8
commit
8e41a4be47
|
@ -4,6 +4,7 @@
|
|||
imports = [ ../../3modules/tv/identity.nix ];
|
||||
tv.identity = {
|
||||
enable = true;
|
||||
search = "retiolum";
|
||||
hosts = {
|
||||
cd = {
|
||||
cores = 2;
|
||||
|
@ -27,7 +28,6 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
search = "retiolum";
|
||||
};
|
||||
mkdir = {
|
||||
cores = 1;
|
||||
|
@ -41,7 +41,6 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
search = "retiolum";
|
||||
};
|
||||
nomic = {
|
||||
cores = 2;
|
||||
|
@ -55,7 +54,6 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
search = "retiolum";
|
||||
};
|
||||
rmdir = {
|
||||
cores = 1;
|
||||
|
@ -70,7 +68,6 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
search = "retiolum";
|
||||
};
|
||||
wu = {
|
||||
cores = 4;
|
||||
|
@ -84,7 +81,6 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
search = "retiolum";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -16,15 +16,19 @@ let
|
|||
type = types.host;
|
||||
};
|
||||
|
||||
others = mkOption {
|
||||
type = types.host;
|
||||
default = filterAttrs (name: _host: name != cfg.self.name) cfg.hosts;
|
||||
};
|
||||
#others = mkOption {
|
||||
# type = types.host;
|
||||
# default = filterAttrs (name: _host: name != cfg.self.name) cfg.hosts;
|
||||
#};
|
||||
|
||||
hosts = mkOption {
|
||||
type = with types; attrsOf host;
|
||||
apply = mapAttrs (name: value: value // { inherit name; });
|
||||
};
|
||||
|
||||
search = mkOption {
|
||||
type = types.hostname;
|
||||
};
|
||||
};
|
||||
|
||||
imp = {
|
||||
|
@ -36,7 +40,7 @@ let
|
|||
let
|
||||
aliases = toString (unique (longs ++ shorts));
|
||||
longs = (splitByProvider net.aliases).hosts;
|
||||
shorts = map (removeSuffix ".${cfg.self.search}") longs;
|
||||
shorts = map (removeSuffix ".${cfg.search}") longs;
|
||||
in
|
||||
map (addr: "${addr} ${aliases}") net.addrs
|
||||
) host.nets
|
||||
|
|
|
@ -39,9 +39,6 @@ builtins // lib // rec {
|
|||
in
|
||||
xsn >= sn && substring (xsn - sn) sn xs == s ;
|
||||
|
||||
removeSuffix =
|
||||
s : xs : substring 0 (stringLength xs - stringLength s) xs;
|
||||
|
||||
# setMap :: (String -> a -> b) -> Set String a -> [b]
|
||||
#setMap = f: xs: map (k : f k (getAttr k xs)) (attrNames xs);
|
||||
|
||||
|
@ -74,9 +71,6 @@ builtins // lib // rec {
|
|||
type = attrsOf net;
|
||||
apply = x: assert hasAttr "retiolum" x; x;
|
||||
};
|
||||
search = mkOption {
|
||||
type = hostname;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue