home/ssh/pvv: rename some badly named functions
This commit is contained in:
parent
af345b38fc
commit
c2fca88a28
|
@ -33,17 +33,13 @@ let
|
||||||
];
|
];
|
||||||
|
|
||||||
# Either( String [String] AttrSet{String} ) -> AttrSet{String}
|
# Either( String [String] AttrSet{String} ) -> AttrSet{String}
|
||||||
normalizeValueType = let
|
coerceToSSHMatchBlock =
|
||||||
inherit (lib.strings) isString;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.attrsets) filterAttrs;
|
|
||||||
in
|
|
||||||
machine:
|
machine:
|
||||||
if (isString machine) then { names = [machine]; }
|
if builtins.isString machine then { names = [machine]; }
|
||||||
else if (isList machine) then { names = machine; }
|
else if builtins.isList machine then { names = machine; }
|
||||||
else machine;
|
else machine;
|
||||||
|
|
||||||
# [String] -> AttrSet
|
# ListOf(String) -> AttrSet
|
||||||
machineWithNames = let
|
machineWithNames = let
|
||||||
inherit (lib.lists) head;
|
inherit (lib.lists) head;
|
||||||
inherit (lib.strings) split;
|
inherit (lib.strings) split;
|
||||||
|
@ -70,12 +66,12 @@ let
|
||||||
convertAdminMachine =
|
convertAdminMachine =
|
||||||
convertMachineWithDefaults { user = adminUser; proxyJump = "hildring"; };
|
convertMachineWithDefaults { user = adminUser; proxyJump = "hildring"; };
|
||||||
|
|
||||||
# [ Either(String [String] AttrSet{String}) ] -> (AttrSet -> AttrSet) -> AttrSet
|
# ListOf (Either(String ListOf(String) AttrsOf(String))) -> (AttrSet -> AttrSet) -> AttrSet
|
||||||
convertMachinesWith = convertMachineFunction: let
|
convertMachinesWith = convertMachineFunction: let
|
||||||
inherit (lib.attrsets) listToAttrs;
|
inherit (lib.attrsets) listToAttrs;
|
||||||
inherit (lib.trivial) pipe;
|
inherit (lib.trivial) pipe;
|
||||||
pipeline = [
|
pipeline = [
|
||||||
(map normalizeValueType)
|
(map coerceToSSHMatchBlock)
|
||||||
(map convertMachineFunction)
|
(map convertMachineFunction)
|
||||||
listToAttrs
|
listToAttrs
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue