2022-10-23 14:54:25 +02:00
|
|
|
# Source: https://git.helsinki.tools/helsinki-systems/wp4nix/-/blob/master/default.nix
|
|
|
|
# Licensed under: MIT
|
|
|
|
# Slightly modified
|
|
|
|
|
|
|
|
{ lib, pkgs, newScope, apps }:
|
|
|
|
|
|
|
|
let packages = self:
|
|
|
|
let
|
|
|
|
generatedJson = {
|
|
|
|
inherit apps;
|
|
|
|
};
|
2023-08-20 12:30:34 +02:00
|
|
|
appBaseDefs = builtins.fromJSON (builtins.readFile ./nextcloud-apps.json);
|
2022-10-23 14:54:25 +02:00
|
|
|
|
|
|
|
in {
|
|
|
|
# Create a derivation from the official Nextcloud apps.
|
|
|
|
# This takes the data generated from the go tool.
|
2023-08-20 12:30:34 +02:00
|
|
|
mkNextcloudDerivation = self.callPackage ({ }: { pname, data }:
|
2022-10-23 14:54:25 +02:00
|
|
|
pkgs.fetchNextcloudApp {
|
2023-08-20 12:30:34 +02:00
|
|
|
appName = pname;
|
|
|
|
appVersion = data.version;
|
|
|
|
license = appBaseDefs.${pname};
|
|
|
|
inherit (data) url sha256 description homepage;
|
2022-10-23 14:54:25 +02:00
|
|
|
}) {};
|
|
|
|
|
2023-08-20 12:30:34 +02:00
|
|
|
} // lib.mapAttrs (type: pkgs:
|
|
|
|
lib.makeExtensible (_: lib.mapAttrs (pname: data: self.mkNextcloudDerivation { inherit pname; inherit data; }) pkgs))
|
|
|
|
generatedJson;
|
2022-10-23 14:54:25 +02:00
|
|
|
|
|
|
|
in (lib.makeExtensible (_: (lib.makeScope newScope packages))).extend (selfNC: superNC: {})
|