Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit be434c6

Browse filesBrowse files
committed
chore: Add nix flake with development shell
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 4b62b57 commit be434c6
Copy full SHA for be434c6

File tree

6 files changed

+168
-1
lines changed
Filter options

6 files changed

+168
-1
lines changed

‎.envrc

Copy file name to clipboard
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+2
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,5 @@ core/js/mimetypelist.js
183183
cypress/downloads
184184
cypress/snapshots
185185
cypress/videos
186+
187+
/.direnv

‎.reuse/dep5

Copy file name to clipboardExpand all lines: .reuse/dep5
+1-1
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,6 @@ Files: apps/theming/fonts/OpenDyslexic-Bold.otf apps/theming/fonts/OpenDyslexic-
351351
Copyright: 2012-2019 Abbie Gonzalez <https://abbiecod.es|support@abbiecod.es>, with Reserved Font Name OpenDyslexic.
352352
License: OFL-1.1-RFN
353353

354-
Files: openapi.json
354+
Files: openapi.json .envrc flake.nix flake.lock
355355
Copyright: 2025 Nextcloud GmbH and Nextcloud contributors
356356
License: AGPL-3.0-or-later

‎build/files-checker.php

Copy file name to clipboardExpand all lines: build/files-checker.php
+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'..',
1212
'.devcontainer',
1313
'.editorconfig',
14+
'.envrc',
1415
'.eslintignore',
1516
'.eslintrc.js',
1617
'.git',
@@ -61,6 +62,8 @@
6162
'cypress.d.ts',
6263
'cypress',
6364
'dist',
65+
'flake.lock',
66+
'flake.nix',
6467
'index.html',
6568
'index.php',
6669
'lib',

‎flake.lock

Copy file name to clipboardExpand all lines: flake.lock
+61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flake.nix

Copy file name to clipboard
+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
7+
outputs = { nixpkgs, flake-utils, ... }:
8+
flake-utils.lib.eachDefaultSystem (system:
9+
let
10+
pkgs = nixpkgs.legacyPackages.${system};
11+
lib = pkgs.lib;
12+
in
13+
{
14+
devShells.default =
15+
let
16+
php_versioncheck_parts = builtins.match ".*PHP_VERSION_ID >= ([0-9])0([0-9])00.*" (builtins.readFile ./lib/versioncheck.php);
17+
# Subtract 1 from the lowest unsupported minor version to get the highest supported minor version
18+
php_version = "${builtins.elemAt php_versioncheck_parts 0}${builtins.toString ((lib.strings.toInt (builtins.elemAt php_versioncheck_parts 1)) - 1)}";
19+
php = pkgs.pkgs."php${php_version}".buildEnv {
20+
# Based off https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html
21+
extensions = ({ enabled, all }: enabled ++ (with all; [
22+
# Required
23+
ctype
24+
curl
25+
dom
26+
fileinfo
27+
filter
28+
gd
29+
mbstring
30+
openssl
31+
posix
32+
session
33+
simplexml
34+
xmlreader
35+
xmlwriter
36+
zip
37+
zlib
38+
# Database connectors
39+
pdo_sqlite
40+
pdo_mysql
41+
pdo_pgsql
42+
# Recommended
43+
intl
44+
sodium
45+
# Required for specific apps
46+
ldap
47+
smbclient
48+
ftp
49+
imap
50+
# Recommended for specific apps (optional)
51+
gmp
52+
exif
53+
# For enhanced server performance (optional)
54+
apcu
55+
memcached
56+
redis
57+
# For preview generation (optional)
58+
imagick
59+
# For command line processing (optional)
60+
pcntl
61+
62+
# Debugging
63+
xdebug
64+
]));
65+
66+
extraConfig = ''
67+
max_execution_time=300
68+
memory_limit=-1
69+
70+
xdebug.mode=debug
71+
'';
72+
};
73+
# Skip the caret and only take the major version
74+
node_version = builtins.substring 1 2 (builtins.fromJSON (builtins.readFile ./package.json)).engines.node;
75+
node = pkgs."nodejs_${node_version}";
76+
in
77+
pkgs.mkShell {
78+
packages = [
79+
php
80+
php.packages.composer
81+
node
82+
# Preview generation
83+
pkgs.ffmpeg
84+
pkgs.libreoffice
85+
];
86+
87+
shellHook = ''
88+
export NOCOVERAGE=1
89+
90+
git submodule update --init
91+
92+
npm install
93+
94+
composer install
95+
cd build/integration && composer install
96+
'';
97+
};
98+
}
99+
);
100+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.