diff --git a/pkgs/servers/nextcloud/packages/apps/hmr_enabler.nix b/pkgs/servers/nextcloud/packages/apps/hmr_enabler.nix new file mode 100644 index 000000000000..0249ad1e3ad9 --- /dev/null +++ b/pkgs/servers/nextcloud/packages/apps/hmr_enabler.nix @@ -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 ]; + }; + +}) diff --git a/pkgs/servers/nextcloud/packages/default.nix b/pkgs/servers/nextcloud/packages/default.nix index 8af2e2f5833b..7158bf8a2d0a 100644 --- a/pkgs/servers/nextcloud/packages/default.nix +++ b/pkgs/servers/nextcloud/packages/default.nix @@ -2,28 +2,58 @@ # Licensed under: MIT # Slightly modified -{ lib, pkgs, newScope, apps }: +{ + lib, + pkgs, + newScope, + apps, + callPackage, +}: -let packages = self: - let - generatedJson = { - inherit apps; - }; - appBaseDefs = builtins.fromJSON (builtins.readFile ./nextcloud-apps.json); +let + packages = + self: + let + generatedJson = { + inherit apps; + }; + appBaseDefs = builtins.fromJSON (builtins.readFile ./nextcloud-apps.json); - in { - # Create a derivation from the official Nextcloud apps. - # This takes the data generated from the go tool. - mkNextcloudDerivation = self.callPackage ({ }: { pname, data }: - pkgs.fetchNextcloudApp { - appName = pname; - appVersion = data.version; - license = appBaseDefs.${pname}; - inherit (data) url hash description homepage; - }) {}; + in + { + # Create a derivation from the official Nextcloud apps. + # This takes the data generated from the go tool. + mkNextcloudDerivation = self.callPackage ( + { }: + { pname, data }: + pkgs.fetchNextcloudApp { + 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)) - generatedJson; + } + // lib.mapAttrs ( + 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 +) diff --git a/pkgs/servers/nextcloud/packages/thirdparty.nix b/pkgs/servers/nextcloud/packages/thirdparty.nix new file mode 100644 index 000000000000..bcf151bc93f0 --- /dev/null +++ b/pkgs/servers/nextcloud/packages/thirdparty.nix @@ -0,0 +1,12 @@ +_: +{ apps, callPackage, ... }: +{ + + apps = apps.extend ( + self: super: { + + hmr_enabler = callPackage ./apps/hmr_enabler.nix { }; + + } + ); +}