Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
watch_file lib/versioncheck.php
watch_file package.json
use flake
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,5 @@ core/js/mimetypelist.js
cypress/downloads
cypress/snapshots
cypress/videos

/.direnv
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,7 @@ License: CC0-1.0
Files: apps/theming/fonts/OpenDyslexic-Bold.otf apps/theming/fonts/OpenDyslexic-Regular.otf
Copyright: 2012-2019 Abbie Gonzalez <https://abbiecod.es|[email protected]>, with Reserved Font Name OpenDyslexic.
License: OFL-1.1-RFN

Files: .envrc flake.nix flake.lock
Copyright: 2025 Nextcloud GmbH and Nextcloud contributors
License: AGPL-3.0-or-later
3 changes: 3 additions & 0 deletions build/files-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'..',
'.devcontainer',
'.editorconfig',
'.envrc',
'.eslintignore',
'.eslintrc.js',
'.git',
Expand Down Expand Up @@ -62,6 +63,8 @@
'cypress.d.ts',
'cypress',
'dist',
'flake.lock',
'flake.nix',
'index.html',
'index.php',
'jest.config.ts',
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
in
{
devShells.default =
let
php_version = lib.strings.concatStrings (builtins.match ".*PHP_VERSION_ID < ([0-9])0([0-9])00.*" (builtins.readFile ./lib/versioncheck.php));
php = pkgs.pkgs."php${php_version}".buildEnv {
# Based off https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html
extensions = ({ enabled, all }: enabled ++ (with all; [
# Required
ctype
curl
dom
fileinfo
filter
gd
mbstring
openssl
posix
session
simplexml
xmlreader
xmlwriter
zip
zlib
# Database connectors
pdo_sqlite
pdo_mysql
pdo_pgsql
# Recommended
intl
sodium
# Required for specific apps
ldap
smbclient
ftp
imap
# Recommended for specific apps (optional)
gmp
exif
# For enhanced server performance (optional)
apcu
memcached
redis
# For preview generation (optional)
imagick
# For command line processing (optional)
pcntl

# Debugging
xdebug
]));

extraConfig = ''
max_execution_time=300
memory_limit=-1

xdebug.mode=debug
'';
};
node_version = builtins.substring 1 (-1) (builtins.elemAt (lib.strings.splitString "." (builtins.fromJSON (builtins.readFile ./package.json)).engines.node) 0);
node = pkgs."nodejs_${node_version}";
in
pkgs.mkShell {
NOCOVERAGE = 1;

packages = [
php
php.packages.composer
node
# Preview generation
pkgs.ffmpeg
pkgs.libreoffice
];
};
}
);
}
Loading