2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Maurice Debray <maurice.debray@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
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
|
2024-02-02 10:51:31 +01:00
|
|
|
mapDeepAttrs =
|
|
|
|
mapFct:
|
|
|
|
lib.concatMapAttrs (name: value: lib.mapAttrs' (name': value': mapFct name name' value') value);
|
2023-10-23 11:35:28 +02:00
|
|
|
|
2024-02-02 10:51:31 +01:00
|
|
|
toLinkal = upstream: identifier: lib.nameValuePair "${providers.${upstream}}${identifier}";
|
2023-10-23 11:35:28 +02:00
|
|
|
in
|
2024-02-02 10:51:31 +01:00
|
|
|
mapDeepAttrs toLinkal calendars
|