extendedLib: attrsets.concatAttrs -> lib.mergeAttrsList
This commit is contained in:
parent
0ea394dbf9
commit
7500197568
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, lib, extendedLib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
adminUser = "root";
|
adminUser = "root";
|
||||||
normalUser = "oysteikt";
|
normalUser = "oysteikt";
|
||||||
|
@ -88,10 +88,10 @@ let
|
||||||
machines: pipe machines pipeline;
|
machines: pipe machines pipeline;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.ssh.matchBlocks = (extendedLib.attrsets.concatAttrs [
|
programs.ssh.matchBlocks = lib.mergeAttrsList [
|
||||||
(convertMachinesWith convertNormalMachine normalMachines)
|
(convertMachinesWith convertNormalMachine normalMachines)
|
||||||
(convertMachinesWith convertAdminMachine rootMachines)
|
(convertMachinesWith convertAdminMachine rootMachines)
|
||||||
]) // {
|
{
|
||||||
"pvv-git git.pvv.ntnu.no" = {
|
"pvv-git git.pvv.ntnu.no" = {
|
||||||
hostname = "git.pvv.ntnu.no";
|
hostname = "git.pvv.ntnu.no";
|
||||||
user = "gitea";
|
user = "gitea";
|
||||||
|
@ -99,5 +99,6 @@ in
|
||||||
port = 2222;
|
port = 2222;
|
||||||
proxyJump = "pvv";
|
proxyJump = "pvv";
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,6 @@ in rec {
|
||||||
mapToAttrsWithConst = constant: items:
|
mapToAttrsWithConst = constant: items:
|
||||||
listToAttrs (map (name: nameValuePair name constant) items);
|
listToAttrs (map (name: nameValuePair name constant) items);
|
||||||
|
|
||||||
# [AttrSet] -> AttrSet
|
|
||||||
concatAttrs = foldr (a: b: a // b) {};
|
|
||||||
|
|
||||||
# (Int -> String -> a -> a) -> AttrSet -> AttrSet
|
# (Int -> String -> a -> a) -> AttrSet -> AttrSet
|
||||||
imap0Attrs = f: set:
|
imap0Attrs = f: set:
|
||||||
listToAttrs (imap0 (i: attr: nameValuePair attr (f i attr set.${attr})) (attrNames set));
|
listToAttrs (imap0 (i: attr: nameValuePair attr (f i attr set.${attr})) (attrNames set));
|
||||||
|
|
Loading…
Reference in New Issue