1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

nextcloudPackages.hmr_enabler: init at 0+unstable-2024-08-24

This commit is contained in:
Jonas Heinrich 2024-07-20 12:15:30 +02:00
parent 51704cb008
commit 94db46ecad
3 changed files with 101 additions and 21 deletions

View file

@ -0,0 +1,38 @@
{
php,
fetchFromGitHub,
lib,
}:
php.buildComposerProject (finalAttrs: {
pname = "hmr_enabler";
# composer doesn't support our unstable version format
# version = "0-unstable-2024-08-24";
version = "0";
src = fetchFromGitHub {
owner = "nextcloud";
repo = "hmr_enabler";
rev = "d5d9d330d405ac4aa0de1a87d1133784560462ed";
hash = "sha256-uLCpwvMVQ20z9vlO5q/GVPnaaQZ7ZjE8+V/zuqaB9Yo=";
};
composerNoDev = false;
vendorHash = "sha256-ZuEEcFT+q49CCooEwdiu2Co345s0ZCC7jeEksi6A99A=";
postInstall = ''
chmod -R u+w $out/share
mv $out/share/php/hmr_enabler/* $out/
rm -r $out/share $out/composer.* $out/Makefile $out/psalm.xml $out/tests
'';
meta = {
description = " Development Nextcloud app to enable apps to use hot module reloading";
homepage = "https://github.com/nextcloud/hmr_enabler";
changelog = "https://github.com/nextcloud/hmr_enabler/blob/master/CHANGELOG.md";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ onny ];
};
})

View file

@ -2,28 +2,58 @@
# Licensed under: MIT # Licensed under: MIT
# Slightly modified # Slightly modified
{ lib, pkgs, newScope, apps }: {
lib,
pkgs,
newScope,
apps,
callPackage,
}:
let packages = self: let
let packages =
generatedJson = { self:
inherit apps; let
}; generatedJson = {
appBaseDefs = builtins.fromJSON (builtins.readFile ./nextcloud-apps.json); inherit apps;
};
appBaseDefs = builtins.fromJSON (builtins.readFile ./nextcloud-apps.json);
in { in
# Create a derivation from the official Nextcloud apps. {
# This takes the data generated from the go tool. # Create a derivation from the official Nextcloud apps.
mkNextcloudDerivation = self.callPackage ({ }: { pname, data }: # This takes the data generated from the go tool.
pkgs.fetchNextcloudApp { mkNextcloudDerivation = self.callPackage (
appName = pname; { }:
appVersion = data.version; { pname, data }:
license = appBaseDefs.${pname}; pkgs.fetchNextcloudApp {
inherit (data) url hash description homepage; appName = pname;
}) {}; appVersion = data.version;
license = appBaseDefs.${pname};
inherit (data)
url
hash
description
homepage
;
}
) { };
} // lib.mapAttrs (type: pkgs: }
lib.makeExtensible (_: lib.mapAttrs (pname: data: self.mkNextcloudDerivation { inherit pname; inherit data; }) pkgs)) // lib.mapAttrs (
generatedJson; type: pkgs:
lib.makeExtensible (
_:
lib.mapAttrs (
pname: data:
self.mkNextcloudDerivation {
inherit pname data;
}
) pkgs
)
) generatedJson;
in (lib.makeExtensible (_: (lib.makeScope newScope packages))).extend (selfNC: superNC: {}) in
(lib.makeExtensible (_: (lib.makeScope newScope packages))).extend (
import ./thirdparty.nix
)

View file

@ -0,0 +1,12 @@
_:
{ apps, callPackage, ... }:
{
apps = apps.extend (
self: super: {
hmr_enabler = callPackage ./apps/hmr_enabler.nix { };
}
);
}