2023-10-23 11:35:28 +02:00
|
|
|
{ lib, pkgs }:
|
|
|
|
source:
|
|
|
|
let
|
|
|
|
#import metis stuff
|
|
|
|
metisCalendarData = builtins.fromJSON (builtins.readFile (source + /data/calendars.json));
|
|
|
|
calendars = metisCalendarData.sources;
|
|
|
|
inherit (import source { inherit pkgs; }) providers;
|
|
|
|
|
|
|
|
# helper function to map 2-level deep attribute-sets
|
|
|
|
mapDeepAttrs = mapFct:
|
|
|
|
lib.concatMapAttrs (name: value:
|
|
|
|
lib.mapAttrs' (name': value':
|
|
|
|
mapFct name name' value'
|
|
|
|
) value
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
toLinkal = upstream: identifier:
|
|
|
|
lib.nameValuePair
|
2023-11-08 00:04:18 +01:00
|
|
|
"${providers.${upstream}}${identifier}"
|
2023-10-23 11:35:28 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
in
|
|
|
|
mapDeepAttrs toLinkal calendars
|