You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.7 KiB

  1. {
  2. inputs = {
  3. nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
  4. flake-utils.url = "github:numtide/flake-utils";
  5. haze = {
  6. url = "git+https://codeberg.org/icewind/haze.git";
  7. inputs.nixpkgs.follows = "nixpkgs";
  8. };
  9. };
  10. outputs = { nixpkgs, flake-utils, haze, ... }:
  11. flake-utils.lib.eachDefaultSystem (system:
  12. let
  13. pkgs = nixpkgs.legacyPackages.${system};
  14. lib = pkgs.lib;
  15. in
  16. {
  17. devShells.default =
  18. let
  19. php_version = lib.strings.concatStrings (builtins.match ".*PHP_VERSION_ID < ([0-9])0([0-9])00.*" (builtins.readFile ./lib/versioncheck.php));
  20. php = pkgs.pkgs."php${php_version}".buildEnv {
  21. # Based off https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html
  22. extensions = ({ enabled, all }: enabled ++ (with all; [
  23. # Required
  24. ctype
  25. curl
  26. dom
  27. fileinfo
  28. filter
  29. gd
  30. mbstring
  31. openssl
  32. posix
  33. session
  34. simplexml
  35. xmlreader
  36. xmlwriter
  37. zip
  38. zlib
  39. # Database connectors
  40. pdo_sqlite
  41. pdo_mysql
  42. pdo_pgsql
  43. # Recommended
  44. intl
  45. sodium
  46. # Required for specific apps
  47. ldap
  48. smbclient
  49. ftp
  50. imap
  51. # Recommended for specific apps (optional)
  52. gmp
  53. exif
  54. # For enhanced server performance (optional)
  55. apcu
  56. memcached
  57. redis
  58. # For preview generation (optional)
  59. imagick
  60. # For command line processing (optional)
  61. pcntl
  62. # Debugging
  63. xdebug
  64. ]));
  65. extraConfig = ''
  66. max_execution_time=300
  67. memory_limit=-1
  68. xdebug.mode=debug
  69. '';
  70. };
  71. node_version = builtins.substring 1 (-1) (builtins.elemAt (lib.strings.splitString "." (builtins.fromJSON (builtins.readFile ./package.json)).engines.node) 0);
  72. node = pkgs."nodejs_${node_version}";
  73. in
  74. pkgs.mkShell {
  75. NOCOVERAGE = 1;
  76. packages = [
  77. php
  78. php.packages.composer
  79. node
  80. # Preview generation
  81. pkgs.ffmpeg
  82. pkgs.libreoffice
  83. haze.packages.${system}.default
  84. ];
  85. };
  86. }
  87. );
  88. }