78 Commits

Author SHA1 Message Date
Sigmanificient dc7d0407b7 php: move env variable into env for structuredAttrs 2026-05-25 15:48:25 +02:00
nixpkgs-ci[bot] 744b127e11 Merge master into staging-next 2026-05-15 12:38:31 +00:00
Stanisław Pitucha a42c6cd109 php: remove buildtime xcbuild dependency 2026-04-25 21:38:18 +10:00
Piotr Kwiecinski f696ae3c91 php: fix infinite recursion with overrideAttrs 2026-04-19 12:13:13 +02:00
Piotr Kwiecinski 303884b3cb php: fix updateScript failure due to incorrect release url 2026-02-25 11:29:40 +01:00
Piotr Kwiecinski eac682cd51 php: simplify version definitions 2026-02-24 20:56:33 +01:00
jopejoe1 1ceb8bb210 php: set pname 2026-02-07 16:42:44 +01:00
Piotr Kwiecinski 21efaec96c php85: init at 8.5.2 2026-01-18 12:50:29 +01:00
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
Jan Tojnar 3e601e5455 php: Enable ACL support for FPM
This will allow authorizing extra processes like Prometheus exporter without having to run it as `listen.user` (or adding it `listen.group` and changing `listen.mode` to `0660`).

It is disabled by default:

https://www.php.net/manual/en/install.fpm.install.php

but it has been available since PHP 5.6:

https://github.com/php/php-src/commit/744ada7d9ddb7c0f37c494bf0e7636cb1ed6cb34

And Debian enables it too:

https://salsa.debian.org/php-team/php/-/commit/153055e5e35b4e8fce0fc452d2052e5457242abd
2025-11-10 04:01:01 +01:00
NAHO c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
Sandro Jäckel 50343562c8 php: move $out/lib/build used by phpize to dev output 2025-09-12 19:52:04 +02:00
nixpkgs-ci[bot] fbb3e5e3f0 Merge staging-next into staging 2025-08-27 12:07:35 +00:00
Robert Hensing d88b9464b0 system.services: Remove ambiguous, redundant pkgs module argument
Primary reasons: remove implicit dependencies and force uniformity.
See nixos/modules/system/service/README.md for detailed rationale.
2025-08-20 11:44:06 +02:00
Volker Diels-Grabsch 0456b29ff8 php: fix systemdLibs dependency 2025-08-16 15:13:41 +02:00
Aaron Andersen 04b4c3cd17 php: utilize finalAttrs pattern 2025-08-06 21:24:08 -04:00
Aaron Andersen 487e725463 php.services.default: init 2025-08-06 21:24:04 -04:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Fernando Rodrigues 05580f4b44 treewide: switch instances of lib.teams.*.members to the new meta.teams attribute
Follow-up to #394797.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-04-25 22:20:17 -03:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Tim Van Baak f7ab39e525 php: support two- and zero-argument overrideAttrs forms 2024-11-17 20:16:37 -08:00
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Pol Dellaiera dbc4f15b89 Merge pull request #308059 from drupol/build-support/php/remove-composer-local-repo-plugin
build-support/php: init `buildComposerProject2` and `mkComposerRepository2`
2024-08-20 18:38:44 +02:00
Piotr Kwiecinski 3e4323317c php84: 8.4.0alpha4 -> 8.4.0beta3 2024-08-16 08:02:09 +02:00
Pol Dellaiera 65c0e4ebf6 build-support/php: implement v2 2024-08-15 13:43:00 +02:00
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00
Pol Dellaiera bd92bef332 php.buildComposerWithPlugin: init new builder 2024-05-19 22:10:02 +02:00
Pol Dellaiera 81c42da3c3 php: use --replace-fail 2024-03-14 12:02:39 +01:00
Soner Sayakci 7da500d7cb php: add flags for static build and zend engine tweaks 2023-12-03 16:38:27 +01:00
Pol Dellaiera c038b79502 php: add phpSrc attribute (#254556)
This will allow building PHP from source, without using `.overrideAttrs()`.
When the new attribute `phpSrc` is not set, the default behavior (with `fetchurl`) is used.
2023-11-08 22:57:01 +01:00
Pol Dellaiera b36ad2f517 php: add new builder buildComposerProject 2023-09-13 15:00:03 +02:00
Pol Dellaiera dd57b3f250 php: fix path to genfiles 2023-09-08 12:11:02 +02:00
Artturin b93da3f4b7 treewide: overrideScope' -> overrideScope
`lib.makeScope` `overrideScope'` has been renamed to `overrideScope`

`fd --type f | xargs sd --string-mode "overrideScope'" "overrideScope"`
2023-08-14 18:46:47 +03:00
Thomas Gerbet 84c0cb1471 php: drop PHP 8.0
Closes #224505
2023-06-21 22:09:16 +02:00
Lars Strojny 095dfa20dc php: use binary wrappers
Instead of shell wrappers, use binary wrappers which are preferred (see
https://nixos.org/manual/nixpkgs/unstable/#:~:text=Using%20the-,makeBinaryWrapper,implementation%20is%20usually%20preferred,-%2C%20as%20it%20creates)
2023-06-01 13:53:20 +02:00
Lars Strojny e81872b9f4 Set PHP_INI_SCAN_DIR only if not set
Only set PHP_INI_SCAN_DIR if it isn’t set yet. This is so that users can
provide there own PHP_INI_SCAN_DIR, e.g. to restart the current PHP process
without xdebug.
For example, composer/xdebug-handler uses this mechanism to turn off xdebug
(https://github.com/composer/xdebug-handler/blob/cf19e3380ffd84cea4a2cbfcc599ea07ef01f18a/src/XdebugHandler.php#L441)
2023-03-19 22:04:35 +01:00
Pol Dellaiera a344af4c24 php: add meta.mainProgram 2023-02-10 09:12:32 +01:00
Adam Joseph 42815b4a0c treewide: systemdSupport: use lib.meta.availableOn
Many packages have some kind of flag indicating whether or not to build with
systemd support.  Most of these default to `stdenv.isLinux`, but systemd does
not build on (and is marked `broken` for) `isStatic`.  Only a few packages have
the needed `&& !isStatic` in the default value for their parameter.

This commit moves the logic for the default value of these flags into
`systemd.meta.{platforms,badPlatforms}` and evaluates those conditions using
`lib.meta.availableOn`.

This provides three benefits:

1. The default values are set correctly (i.e. including `&& isStatic`)

2. The default values are set consistently

3. The way is paved for any future non-Linux systemd platforms (FreeBSD is
   reported to have experimental systemd support)
2023-01-22 00:27:19 -08:00
Pol Dellaiera 142ac0ba91 php: add updateScript 2023-01-05 13:42:31 +01:00
Maximilian Bosch 2580440389 Merge pull request #198470 from RaitoBezarius/nc25-openssl
nextcloud25: use openssl 1.1 as a PHP extension to fix RC4 encryption
2022-11-20 18:32:41 +01:00
Pol Dellaiera 364a7d2920 php: switch to nts by default 2022-11-13 11:47:27 +01:00
Maximilian Bosch 35b146ca31 nixos/nextcloud: fixup openssl compat change
Upon testing the change itself I realized that it doesn't build properly
because

* the `pname` of a php extension is `php-<name>`, not `<name>`.
* calling the extension `openssl-legacy` resulted in PHP trying to compile
  `ext/openssl-legacy` which broke since it doesn't exist:

      source root is php-8.1.12
      setting SOURCE_DATE_EPOCH to timestamp 1666719000 of file php-8.1.12/win32/wsyslog.c
      patching sources
      cdToExtensionRootPhase
      /nix/store/48mnkga4kh84xyiqwzx8v7iv090i7z66-stdenv-linux/setup: line 1399: cd: ext/openssl-legacy: No such file or directory

I didn't encounter that one before because I was mostly interested in
having a sane behavior for everyone not using this "feature" and the
documentation around this. My findings about the behavior with turning
openssl1.1 on/off are still valid because I tested this on `master` with
manually replacing `openssl` by `openssl_1_1` in `php-packages.nix`.

To work around the issue I had to slightly modify the extension
build-system for PHP:

* The attribute `extensionName` is now relevant to determine the output
  paths (e.g. `lib/openssl.so`). This is not a behavioral change for
  existing extensions because then `extensionName==name`.

  However when specifying `extName` in `php-packages.nix` this value is
  overridden and it is made sure that the extension called `extName` NOT
  `name` (i.e. `openssl` vs `openssl-legacy`) is built and installed.

  The `name` still has to be kept to keep the legacy openssl available
  as `php.extensions.openssl-legacy`.

Additionally I implemented a small VM test to check the behavior with
server-side encryption:

* For `stateVersion` below 22.11, OpenSSL 1.1 is used (in `basic.nix`
  it's checked that OpenSSL 3 is used). With that the "default"
  behavior of the module is checked.

* It is ensured that the PHP interpreter for Nextcloud's php-fpm
  actually loads the correct openssl extension.

* It is tested that (encrypted) files remain usable when (temporarily)
  installing OpenSSL3 (of course then they're not decryptable, but on a
  rollback that should still be possible).

Finally, a few more documentation changes:

* I also mentioned the issue in `nextcloud.xml` to make sure the issue
  is at least mentioned in the manual section about Nextcloud. Not too
  much detail here, but the relevant option `enableBrokenCiphersForSSE`
  is referenced.

* I fixed a few minor wording issues to also give the full context
  (we're talking about Nextcloud; we're talking about the PHP extension
  **only**; please check if you really need this even though it's
  enabled by default).

  This is because I felt that sometimes it might be hard to understand
  what's going on when e.g. an eval-warning appears without telling where
  exactly it comes from.
2022-11-11 14:45:46 +01:00
Artturin 7e49471316 treewide: optional -> optionals where the argument is a list
the argument to optional should not be list
2022-10-10 15:40:21 +03:00
ajs124 3020f0014c php: sha256 -> hash 2022-07-08 18:22:14 +02:00
Jan Tojnar b4c6e5f345 php: Remove fixes for abandoned PHP versions 2022-05-10 01:23:39 +02:00
Anders Kaseorg 6920d8ca42 treewide: Simplify negated uses of versionAtLeast, versionOlder
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-04-25 13:35:24 -07:00
Shyim 994b6400c8 php: remove whitespace 2022-04-22 10:24:55 +02:00
Shyim 8fb8ccb179 php: fix extensions on php-cgi 2022-04-22 10:16:29 +02:00
Konrad Borowski e0d9f1bb03 php: skip performance sensitive tests 2021-12-14 22:50:03 +01:00
Jan Tojnar 968d180452 php: Implement overrideAttrs that composes with buildEnv/withExtensions
Hopefully.

Also add a couple of tests to check that.
2021-11-14 23:05:48 +01:00