push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
{
lib,
stdenvNoCC,
fetchurl,
nixosTests,
cacert,
caBundle ? "${cacert}/etc/ssl/certs/ca-bundle.crt",
nextcloud31Packages,
}:
let
generic =
{
version,
hash,
eol ? false,
extraVulnerabilities ? [ ],
packages,
}:
stdenvNoCC.mkDerivation rec {
pname = "nextcloud";
inherit version;
src = fetchurl {
url = "https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2";
inherit hash;
};
passthru = {
tests = lib.filterAttrs (
key: _: (lib.hasSuffix (lib.versions.major version) key)
) nixosTests.nextcloud;
inherit packages;
};
postPatch = ''
cp ${caBundle} resources/config/ca-bundle.crt
'';
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -R . $out/
runHook postInstall
'';
meta = {
changelog = "https://nextcloud.com/changelog/#${lib.replaceStrings [ "." ] [ "-" ] version}";
description = "Sharing solution for files, calendars, contacts and more";
homepage = "https://nextcloud.com";
teams = [ lib.teams.nextcloud ];
license = lib.licenses.agpl3Plus;
platforms = lib.platforms.linux;
knownVulnerabilities =
extraVulnerabilities ++ (lib.optional eol "Nextcloud version ${version} is EOL");
};
};
in
{
nextcloud31 = generic {
version = "31.0.9";
hash = "sha256-qrhBTMY1gco6jfRy9F60ErK4Q6lms4cCdUIbrQ1nD2g=";
packages = nextcloud31Packages;
};
# tip: get the sha with:
# curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256'
}

View File

@@ -0,0 +1,68 @@
{
lib,
fetchFromGitHub,
nixosTests,
rustPlatform,
fetchNextcloudApp,
}:
rustPlatform.buildRustPackage rec {
pname = "notify_push";
# NOTE: make sure this is compatible with all Nextcloud versions
# in nixpkgs!
# For that, check the `<dependencies>` section of `appinfo/info.xml`
# in the app (https://github.com/nextcloud/notify_push/blob/main/appinfo/info.xml)
version = "1.2.0";
src = fetchFromGitHub {
owner = "nextcloud";
repo = "notify_push";
tag = "v${version}";
hash = "sha256-zefoazreNUc3agbdeQRusYWwGNDZnC375ZlLlG+SPeg=";
};
cargoHash = "sha256-+z9XaAzToLZg6/PoRigkvPVpZ/bX/t0VBR5bg3dCUVw=";
passthru = rec {
app = fetchNextcloudApp {
appName = "notify_push";
appVersion = version;
hash = "sha256-KIgXruwYPTLmpO3bMbEcm9jlRYjqX8JgTJt5hd7QugM=";
license = "agpl3Plus";
homepage = "https://github.com/nextcloud/notify_push";
url = "https://github.com/nextcloud-releases/notify_push/releases/download/v${version}/notify_push-v${version}.tar.gz";
description = "Push update support for desktop app";
};
test_client = rustPlatform.buildRustPackage {
pname = "${pname}-test_client";
inherit src version;
buildAndTestSubdir = "test_client";
cargoHash = "sha256-+z9XaAzToLZg6/PoRigkvPVpZ/bX/t0VBR5bg3dCUVw=";
meta = meta // {
mainProgram = "test_client";
};
};
tests =
lib.filterAttrs (
key: lib.const (lib.hasPrefix "with-postgresql-and-redis" key)
) nixosTests.nextcloud
// {
inherit test_client;
};
};
meta = with lib; {
changelog = "https://github.com/nextcloud/notify_push/releases/tag/v${version}";
description = "Update notifications for nextcloud clients";
mainProgram = "notify_push";
homepage = "https://github.com/nextcloud/notify_push";
license = licenses.agpl3Plus;
platforms = platforms.linux;
teams = [ teams.helsinki-systems ];
};
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,58 @@
## Updating apps
To regenerate the nixpkgs nextcloudPackages set, run:
```
./generate.sh
```
After that you can commit and submit the changes in a pull request.
## Adding apps
**Before adding an app and making a pull request to nixpkgs, please first update as described above in a separate commit.**
To extend the nextcloudPackages set, add a new line to the corresponding json
file with the id of the app:
- `nextcloud-apps.json` for apps
The app must be available in the official
[Nextcloud app store](https://apps.nextcloud.com).
https://apps.nextcloud.com. The id corresponds to the last part in the app url,
for example `breezedark` for the app with the url
`https://apps.nextcloud.com/apps/breezedark`.
Then regenerate the nixpkgs nextcloudPackages set by running:
```
./generate.sh
```
**Make sure that in this update, only the app added to `nextcloud-apps.json` gets updated.**
After that you can commit and submit the changes in a pull request.
## Usage with the Nextcloud module
The apps will be available in the namespace `nextcloud31Packages.apps` (and for older versions of Nextcloud similarly).
Using it together with the Nextcloud module could look like this:
```
{
services.nextcloud = {
enable = true;
package = pkgs.nextcloud31;
hostName = "localhost";
config.adminpassFile = "${pkgs.writeText "adminpass" "hunter2"}";
extraApps = with pkgs.nextcloud31Packages.apps; {
inherit mail calendar contact;
};
extraAppsEnable = true;
};
}
```
Adapt the version number in the Nextcloud package and nextcloudPackages set
according to the Nextcloud version you wish to use. There are several supported
stable Nextcloud versions available in the repository.

View File

@@ -0,0 +1,38 @@
{
php,
fetchFromGitHub,
lib,
}:
php.buildComposerProject2 (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-H+yxviMYc6AuerhYtcHRluRWdS1mmqcSMlN2Q24G1m8=";
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

@@ -0,0 +1,32 @@
diff --git a/lib/Settings/SystemConfig.php b/lib/Settings/SystemConfig.php
index 7814f071..bb1309fa 100644
--- a/lib/Settings/SystemConfig.php
+++ b/lib/Settings/SystemConfig.php
@@ -124,6 +125,14 @@ class SystemConfig
*/
public static function get(string $key, mixed $default = null): mixed
{
+ switch ($key) {
+ case "memories.exiftool": return "@exiftool@";
+ case "memories.exiftool_no_local": return false;
+ case "memories.vod.ffmpeg": return "@ffmpeg@";
+ case "memories.vod.ffprobe": return "@ffprobe@";
+ case "memories.vod.path": return "@go-vod@";
+ }
+
if (!\array_key_exists($key, self::DEFAULTS)) {
throw new \InvalidArgumentException("Invalid system config key: {$key}");
}
@@ -154,6 +161,12 @@ public static function get(string $key, mixed $default = null): mixed
*/
public static function set(string $key, mixed $value): void
{
+ // Ignore those paths and always use the nix paths.
+ // We cannot return a proper error message except a 500 here without changing the code to much.
+ if (in_array($key, array("memories.exiftool", "memories.exiftool_no_local", "memories.vod.ffmpeg", "memories.vod.ffprobe", "memories.vod.path"))) {
+ throw new \InvalidArgumentException("Cannot set nix-managed key: {$key}");
+ }
+
// Check if the key is valid
if (!\array_key_exists($key, self::DEFAULTS)) {
throw new \InvalidArgumentException("Invalid system config key: {$key}");

View File

@@ -0,0 +1,91 @@
{
stdenv,
buildGoModule,
exiftool,
fetchurl,
ffmpeg-headless,
fetchFromGitHub,
lib,
replaceVars,
ncVersion,
}:
let
latestVersionForNc = {
"31" = {
version = "7.6.1";
appHash = "sha256-uRZBTwhdNr3OUw021WvTnEBcLd49EQbVr9bvU97zblc=";
srcHash = "sha256-eKvdv3ng4YwPmFu7eapYvD8A2cliryAhPf6NDBJjX6c=";
};
};
currentVersionInfo =
latestVersionForNc.${ncVersion}
or (throw "memories currently does not support nextcloud version ${ncVersion}");
commonMeta = with lib; {
homepage = "https://apps.nextcloud.com/apps/memories";
changelog = "https://github.com/pulsejet/memories/blob/v${currentVersionInfo.version}/CHANGELOG.md";
license = licenses.agpl3Only;
maintainers = with maintainers; [ SuperSandro2000 ];
};
go-vod = buildGoModule rec {
pname = "go-vod";
inherit (currentVersionInfo) version;
src = fetchFromGitHub {
owner = "pulsejet";
repo = "memories";
tag = "v${version}";
hash = currentVersionInfo.srcHash;
};
sourceRoot = "${src.name}/go-vod";
vendorHash = null;
meta = commonMeta // {
description = "Extremely minimal on-demand video transcoding server in go";
mainProgram = "go-vod";
};
};
in
stdenv.mkDerivation rec {
pname = "nextcloud-app-memories";
inherit (currentVersionInfo) version;
src = fetchurl {
url = "https://github.com/pulsejet/memories/releases/download/v${version}/memories.tar.gz";
hash = currentVersionInfo.appHash;
};
patches = [
(replaceVars ./memories-paths.diff {
exiftool = lib.getExe exiftool;
ffmpeg = lib.getExe ffmpeg-headless;
ffprobe = lib.getExe' ffmpeg-headless "ffprobe";
go-vod = lib.getExe go-vod;
})
];
postPatch = ''
rm appinfo/signature.json
rm -rf bin-ext/
sed -i 's/EXIFTOOL_VER = .*/EXIFTOOL_VER = @;/' lib/Service/BinExt.php
substituteInPlace lib/Service/BinExt.php \
--replace-fail "EXIFTOOL_VER = @" "EXIFTOOL_VER = '${exiftool.version}'"
'';
installPhase = ''
mkdir -p $out
cp -r ./* $out/
'';
meta = commonMeta // {
description = "Fast, modern and advanced photo management suite";
longDescription = ''
All settings related to required packages and installed programs are hardcoded in program code and cannot be changed.
'';
};
}

View File

@@ -0,0 +1,130 @@
{
stdenv,
fetchurl,
lib,
nodejs,
node-pre-gyp,
node-gyp,
python3,
util-linux,
ffmpeg-headless,
# Current derivation only supports linux-x86_64 (contributions welcome, without libTensorflow builtin webassembly can be used)
useLibTensorflow ? stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isLinux,
ncVersion,
}:
let
latestVersionForNc = {
"31" = {
version = "9.0.3";
appHash = "sha256-G7SDE72tszifozfT3vNxHW6WmMqQKhrSayQVANQaMbs=";
modelHash = "sha256-dB4ot/65xisR700kUXg3+Y+SkrpQO4mWrFfp+En0QEE=";
};
};
currentVersionInfo =
latestVersionForNc.${ncVersion}
or (throw "recognize currently does not support nextcloud version ${ncVersion}");
in
stdenv.mkDerivation rec {
pname = "nextcloud-app-recognize";
inherit (currentVersionInfo) version;
srcs = [
(fetchurl {
url = "https://github.com/nextcloud/recognize/releases/download/v${version}/recognize-${version}.tar.gz";
hash = currentVersionInfo.appHash;
})
(fetchurl {
url = "https://github.com/nextcloud/recognize/archive/refs/tags/v${version}.tar.gz";
hash = currentVersionInfo.modelHash;
})
]
++ lib.optionals useLibTensorflow [
(fetchurl {
# For version see LIBTENSORFLOW_VERSION in https://github.com/tensorflow/tfjs/blob/master/tfjs-node/scripts/deps-constants.js
url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz";
hash = "sha256-f1ENJUbj214QsdEZRjaJAD1YeEKJKtPJW8pRz4KCAXM=";
})
];
unpackPhase = ''
# Merge the app and the models from github
tar -xzpf "${builtins.elemAt srcs 0}" recognize
tar -xzpf "${builtins.elemAt srcs 1}" -C recognize --strip-components=1 recognize-${version}/models
''
+ lib.optionalString useLibTensorflow ''
# Place the tensorflow lib at the right place for building
tar -xzpf "${builtins.elemAt srcs 2}" -C recognize/node_modules/@tensorflow/tfjs-node/deps
'';
postPatch = ''
# Make it clear we are not reading the node in settings
sed -i "/'node_binary'/s:'""':'Nix Controlled':" recognize/lib/Service/SettingsService.php
# Replace all occurrences of node (and check that we actually removed them all)
test "$(grep "get[a-zA-Z]*('node_binary'" recognize/lib/**/*.php | wc -l)" -gt 0
substituteInPlace recognize/lib/**/*.php \
--replace-quiet "\$this->settingsService->getSetting('node_binary')" "'${lib.getExe nodejs}'" \
--replace-quiet "\$this->config->getAppValueString('node_binary', '""')" "'${lib.getExe nodejs}'" \
--replace-quiet "\$this->config->getAppValueString('node_binary')" "'${lib.getExe nodejs}'"
test "$(grep "get[a-zA-Z]*('node_binary'" recognize/lib/**/*.php | wc -l)" -eq 0
# Skip trying to install it... (less warnings in the log)
sed -i '/public function run/areturn ; //skip' recognize/lib/Migration/InstallDeps.php
ln -s ${lib.getExe ffmpeg-headless} recognize/node_modules/ffmpeg-static/ffmpeg
'';
nativeBuildInputs = lib.optionals useLibTensorflow [
nodejs
node-pre-gyp
node-gyp
python3
util-linux
];
buildPhase = lib.optionalString useLibTensorflow ''
runHook preBuild
cd recognize
# Install tfjs dependency
export CPPFLAGS="-I${lib.getDev nodejs}/include/node -Ideps/include"
cd node_modules/@tensorflow/tfjs-node
node-pre-gyp install --prefer-offline --build-from-source --nodedir=${nodejs}
rm -r ./build-tmp-napi-v*/
cd -
# Test tfjs returns exit code 0
node src/test_libtensorflow.js
cd ..
runHook postBuild
'';
installPhase = ''
runHook preInstall
approot="$(dirname $(dirname $(find -path '*/appinfo/info.xml' | head -n 1)))"
if [ -d "$approot" ]; then
mv "$approot/" $out
chmod -R a-w $out
fi
runHook postInstall
'';
meta = with lib; {
license = licenses.agpl3Only;
maintainers = with maintainers; [ beardhatcode ];
longDescription = ''
Nextcloud app that does Smart media tagging and face recognition with on-premises machine learning models.
This app goes through your media collection and adds fitting tags, automatically categorizing your photos and music.
'';
homepage = "https://apps.nextcloud.com/apps/recognize";
description = "Smart media tagging for Nextcloud: recognizes faces, objects, landscapes, music genres";
changelog = "https://github.com/nextcloud/recognize/blob/v${version}/CHANGELOG.md";
};
}

View File

@@ -0,0 +1,63 @@
# Source: https://git.helsinki.tools/helsinki-systems/wp4nix/-/blob/master/default.nix
# Licensed under: MIT
# Slightly modified
{
lib,
pkgs,
newScope,
apps ? lib.importJSON (./. + "/${ncVersion}.json"), # Support out-of-tree overrides
callPackage,
ncVersion,
nextcloud-notify_push,
}:
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 =
{ pname, data }:
pkgs.fetchNextcloudApp {
appName = pname;
appVersion = data.version;
license = appBaseDefs.${pname};
teams = [ lib.teams.nextcloud ];
inherit (data)
url
hash
description
homepage
;
};
}
// lib.mapAttrs (
type: pkgs:
lib.makeExtensible (
_:
lib.mapAttrs (
pname: data:
self.mkNextcloudDerivation {
inherit pname data;
}
) pkgs
// {
notify_push = nextcloud-notify_push.app;
}
)
) generatedJson;
in
(lib.makeExtensible (_: (lib.makeScope newScope packages))).extend (
import ./thirdparty.nix { inherit ncVersion; }
)

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=../../../.. -i bash -p nc4nix jq
set -e
set -u
set -o pipefail
set -x
export NEXTCLOUD_VERSIONS=$(nix-instantiate --eval -E 'import ./nc-versions.nix {}' -A e)
APPS=`cat nextcloud-apps.json | jq -r 'keys|.[]' | sed -z 's/\n/,/g;s/,$/\n/'`
nc4nix -apps $APPS
rm *.log

View File

@@ -0,0 +1,19 @@
# Source: https://git.helsinki.tools/helsinki-systems/nc4nix/-/raw/main/nc-versions.nix
# Licensed under: MIT
# this file is used to figure out which versions of nextcloud we have in nixpkgs
{
pkgs ? import ../../../.. { },
lib ? pkgs.lib,
}:
let
n = lib.mapAttrsToList (_: v: v.version) (
lib.filterAttrs (
k: v: builtins.match "nextcloud[0-9]+" k != null && (builtins.tryEval v.version).success
) pkgs
);
in
{
inherit n;
e = lib.concatStringsSep "," n;
}

View File

@@ -0,0 +1,53 @@
{
"app_api" : "agpl3Plus"
, "bookmarks": "agpl3Plus"
, "calendar": "agpl3Plus"
, "collectives": "agpl3Plus"
, "contacts": "agpl3Plus"
, "cookbook": "agpl3Plus"
, "cospend": "agpl3Plus"
, "dav_push": "agpl3Plus"
, "deck": "agpl3Plus"
, "end_to_end_encryption": "agpl3Plus"
, "files_automatedtagging" : "agpl3Plus"
, "files_markdown": "agpl3Plus"
, "files_mindmap": "agpl3Plus"
, "files_retention": "agpl3Plus"
, "files_texteditor": "agpl3Plus"
, "forms": "agpl3Plus"
, "gpoddersync": "agpl3Only"
, "groupfolders": "agpl3Plus"
, "impersonate": "agpl3Plus"
, "integration_openai": "agpl3Only"
, "integration_deepl": "agpl3Plus"
, "integration_paperless": "agpl3Plus"
, "mail": "agpl3Plus"
, "maps": "agpl3Plus"
, "music": "agpl3Plus"
, "news": "agpl3Plus"
, "nextpod": "agpl3Only"
, "notes": "agpl3Plus"
, "oidc_login": "agpl3Only"
, "onlyoffice": "asl20"
, "phonetrack": "agpl3Plus"
, "polls": "agpl3Plus"
, "previewgenerator": "agpl3Plus"
, "quota_warning": "agpl3Plus"
, "qownnotesapi": "agpl3Plus"
, "registration": "agpl3Plus"
, "richdocuments": "agpl3Only"
, "sociallogin": "agpl3Only"
, "spreed": "agpl3Plus"
, "tables": "agpl3Only"
, "tasks": "agpl3Plus"
, "twofactor_admin": "agpl3Plus"
, "twofactor_nextcloud_notification": "agpl3Only"
, "twofactor_totp": "agpl3Plus"
, "twofactor_webauthn": "agpl3Plus"
, "unroundedcorners": "agpl3Only"
, "unsplash": "agpl3Only"
, "uppush": "agpl3Plus"
, "user_oidc": "agpl3Plus"
, "user_saml": "agpl3Plus"
, "whiteboard": "agpl3Plus"
}

View File

@@ -0,0 +1,15 @@
{ ncVersion }:
_:
{ apps, callPackage, ... }:
{
apps = apps.extend (
self: super: {
hmr_enabler = callPackage ./apps/hmr_enabler.nix { };
memories = callPackage ./apps/memories.nix { inherit ncVersion; };
recognize = callPackage ./apps/recognize.nix { inherit ncVersion; };
}
);
}