diff options
author | provokateurin <kate@provokateurin.de> | 2025-05-16 09:03:25 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2025-05-19 12:01:40 +0200 |
commit | 0a9e6374bd13f2decbda40d175f5d8bc8cc06c72 (patch) | |
tree | 2658b8a219674b0b5c3b8988003ab0843ccf5b12 | |
parent | 119727d74a802981d0f43ec178302586e50718dd (diff) | |
download | nextcloud-server-backport/52891/stable30.tar.gz nextcloud-server-backport/52891/stable30.zip |
chore: Add nix flake with development shellbackport/52891/stable30
Signed-off-by: provokateurin <kate@provokateurin.de>
-rw-r--r-- | .envrc | 3 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .reuse/dep5 | 4 | ||||
-rw-r--r-- | build/files-checker.php | 3 | ||||
-rw-r--r-- | flake.lock | 61 | ||||
-rw-r--r-- | flake.nix | 88 |
6 files changed, 161 insertions, 0 deletions
diff --git a/.envrc b/.envrc new file mode 100644 index 00000000000..6f3f66b63d9 --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +watch_file lib/versioncheck.php +watch_file package.json +use flake diff --git a/.gitignore b/.gitignore index 5b747559a82..0c86a7cb829 100644 --- a/.gitignore +++ b/.gitignore @@ -182,3 +182,5 @@ core/js/mimetypelist.js cypress/downloads cypress/snapshots cypress/videos + +/.direnv diff --git a/.reuse/dep5 b/.reuse/dep5 index 619b4b0b7ef..4320fe5bd01 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -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|support@abbiecod.es>, 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 diff --git a/build/files-checker.php b/build/files-checker.php index 9cb67af3c0d..50c9efa6a70 100644 --- a/build/files-checker.php +++ b/build/files-checker.php @@ -11,6 +11,7 @@ $expectedFiles = [ '..', '.devcontainer', '.editorconfig', + '.envrc', '.eslintignore', '.eslintrc.js', '.git', @@ -62,6 +63,8 @@ $expectedFiles = [ 'cypress.d.ts', 'cypress', 'dist', + 'flake.lock', + 'flake.nix', 'index.html', 'index.php', 'jest.config.ts', diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000000..b3c1cbe2593 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1747428706, + "narHash": "sha256-XVds9FkRrY59xRNNq14FNsFGqDiexXX/mlHcX4hPyyk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2e1496bf8652ff4af4e4d4737277f71e4a4f5cb2", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000000..95cc8f9c87e --- /dev/null +++ b/flake.nix @@ -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 + ]; + }; + } + ); +} |