!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

67 Members
A room for PHP developers running on Nix20 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
16 Aug 2024
@drupol:matrix.orgPolquick and nice ! :)09:23:00
@nebucatnetzer13:matrix.orgnebucatnetzer13
In reply to @drupol:matrix.org
Yes. I'm pretty sure there's room for improvements...

I found a bit of a hack that works, but it's basically the same as sharing the COMPOSER_CACHED_DIR between runners.
On the runner I then point it to the result as the cache dir and set the env var COMPOSER_CACHE_READ_ONLY=1

{
  lib,
  php83Packages,
  root,
  stdenvNoCC,
}:
let
  fs = lib.fileset;
  sourceFiles = fs.unions [
    (root + "/composer.json")
    (root + "/composer.lock")
  ];
  composerFiles = fs.toSource {
    fileset = sourceFiles;
    inherit root;
  };
in
stdenvNoCC.mkDerivation {
  name = "composer-dev-dependencies";
  src = composerFiles;
  nativeBuildInputs = [ php83Packages.composer ];
  buildPhase = ''
    export COMPOSER_HOME=$TMPDIR
    composer install --download-only --no-interaction --no-scripts --no-ansi --no-autoloader
  '';
  installPhase = ''
    mkdir -p $out/
    cp -r $COMPOSER_HOME/cache/files $out/
  '';
  dontFixup = true;
  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
  outputHash = "sha256-b3RbFaiVPuSpG6jZjSwOjFGyWo/sSb91JLdtcIIv1C8=";
}
10:58:26
@nebucatnetzer13:matrix.orgnebucatnetzer13 set a profile picture.11:05:52
@nebucatnetzer13:matrix.orgnebucatnetzer13From the reaction I assume it's a stupid idea :)12:13:12
@drupol:matrix.orgPolnooooo12:43:40
@drupol:matrix.orgPolI mean, I don't know these stuff12:43:46
@drupol:matrix.orgPolSo I'm surprised we can do this12:43:51
@drupol:matrix.orgPolI would not judge it, I don't know it12:44:12
@nebucatnetzer13:matrix.orgnebucatnetzer13Easy, well we will see how it works out. Fixed output derivations are a bit of a pain to update, especially for non-nix people.12:49:26
@drupol:matrix.orgPolyep :912:50:47
@drupol:matrix.orgPol * yep :(12:50:49
17 Aug 2024
@piotrkwiecinski:matrix.orgpiotrkwiecinski I was able to fix 20 jobs yesterday https://github.com/piotrkwiecinski/php-src-nix/pull/108:50:43

Show newer messages


Back to Room ListRoom Version: 6