2022-11-21 17:40:18 +00: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-10-09 19:29:22 +00:00
|
|
|
appBaseDefs = builtins.fromJSON (builtins.readFile ./nextcloud-apps.json);
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
in {
|
|
|
|
# Create a derivation from the official Nextcloud apps.
|
|
|
|
# This takes the data generated from the go tool.
|
2023-10-09 19:29:22 +00:00
|
|
|
mkNextcloudDerivation = self.callPackage ({ }: { pname, data }:
|
2022-11-21 17:40:18 +00:00
|
|
|
pkgs.fetchNextcloudApp {
|
2023-10-09 19:29:22 +00:00
|
|
|
appName = pname;
|
|
|
|
appVersion = data.version;
|
|
|
|
license = appBaseDefs.${pname};
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit (data) url hash description homepage;
|
2022-11-21 17:40:18 +00:00
|
|
|
}) {};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
} // lib.mapAttrs (type: pkgs:
|
|
|
|
lib.makeExtensible (_: lib.mapAttrs (pname: data: self.mkNextcloudDerivation { inherit pname; inherit data; }) pkgs))
|
|
|
|
generatedJson;
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
in (lib.makeExtensible (_: (lib.makeScope newScope packages))).extend (selfNC: superNC: {})
|