mumble: remove traces

This commit is contained in:
a-kenji
2024-08-06 11:49:25 +02:00
parent 4b757d62a2
commit 83aa4002bd

View File

@@ -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
{ {