Merge pull request 'mumble: remove traces' (#1850) from kenji/clan-core:mumble/remove-traces into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/1850
This commit is contained in:
@@ -5,25 +5,24 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
clanDir = lib.trace config.clan.core.clanDir config.clan.core.clanDir;
|
clanDir = config.clan.core.clanDir;
|
||||||
machineDir = clanDir + "/machines/";
|
machineDir = clanDir + "/machines/";
|
||||||
machinesFileSet = builtins.readDir machineDir;
|
machinesFileSet = builtins.readDir machineDir;
|
||||||
machines = lib.mapAttrsToList (name: _: name) machinesFileSet;
|
machines = lib.mapAttrsToList (name: _: name) machinesFileSet;
|
||||||
machineJson = builtins.toJSON (lib.trace machines machines);
|
machineJson = builtins.toJSON machines;
|
||||||
certificateMachinePath = machines: machineDir + "/${machines}" + "/facts/mumble-cert";
|
certificateMachinePath = machines: machineDir + "/${machines}" + "/facts/mumble-cert";
|
||||||
certificatesUnchecked = builtins.map (
|
certificatesUnchecked = builtins.map (
|
||||||
machine:
|
machine:
|
||||||
let
|
let
|
||||||
fullPath = certificateMachinePath machine;
|
fullPath = certificateMachinePath machine;
|
||||||
in
|
in
|
||||||
if builtins.pathExists (lib.trace fullPath fullPath) then machine else null
|
if builtins.pathExists fullPath then machine else null
|
||||||
) machines;
|
) machines;
|
||||||
certificate = lib.filter (machine: machine != null) certificatesUnchecked;
|
certificate = lib.filter (machine: machine != null) certificatesUnchecked;
|
||||||
machineCert = builtins.map (
|
machineCert = builtins.map (
|
||||||
machine:
|
machine: (lib.nameValuePair machine (builtins.readFile (certificateMachinePath machine)))
|
||||||
lib.trace machine (lib.nameValuePair machine (builtins.readFile (certificateMachinePath machine)))
|
|
||||||
) certificate;
|
) certificate;
|
||||||
machineCertJson = builtins.toJSON (lib.trace machineCert machineCert);
|
machineCertJson = builtins.toJSON machineCert;
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user