16 Aug 2024 |
nebucatnetzer13 | ah okay, because the rest I have already working | 08:25:29 |
Pol | But you'll find all the most used tools already in nixpkgs (phpunit, psalm, phpstan, etc etc) | 08:25:42 |
Pol | I know that you could do 2 derivations | 08:26:34 |
Pol | For example: | 08:26:38 |
Pol |
my-app -> would be made with buildComposerProject , using regular attributes. This is ready to go in prod if needed, it doesn't contain any require-dev stuff.
| 08:27:14 |
Pol |
my-app-dev -> would also be made with buildComposerProject but this time, you can add an attribute that will install the require-dev dependencies.
| 08:27:54 |
Pol | Then you create a devshell and use the attribute inputsFrom = [ my-app-dev ]; | 08:28:12 |
Pol | That might work. | 08:28:22 |
Pol | To be tested. | 08:28:27 |
nebucatnetzer13 | Okay, yeah that was my last idea as well, the problem with that is that the code for the project lands twice in the store right? It's not a killer, just a bit inelegant. | 08:30:12 |
rikudou@lemmings.world | Added php84 to https://history.nix-packages.com/search?packageName=php%2Ftag | 08:33:04 |
Pol | In reply to @nebucatnetzer13:matrix.org Okay, yeah that was my last idea as well, the problem with that is that the code for the project lands twice in the store right? It's not a killer, just a bit inelegant. Yes. I'm pretty sure there's room for improvements... | 08:44:16 |
Pol | In reply to @rikudou:lemmings.world Added php84 to https://history.nix-packages.com/search?packageName=php%2Ftag The sort is not really optimal in the list. | 08:44:52 |
Pol | Download image.png | 08:45:07 |
rikudou@lemmings.world | Yep, I've noticed | 08:45:11 |
rikudou@lemmings.world | Fixed | 09:07:17 |
Pol | quick and nice ! :) | 09:23:00 |
nebucatnetzer13 | 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 set a profile picture. | 11:05:52 |
nebucatnetzer13 | From the reaction I assume it's a stupid idea :) | 12:13:12 |
Pol | nooooo | 12:43:40 |
Pol | I mean, I don't know these stuff | 12:43:46 |
Pol | So I'm surprised we can do this | 12:43:51 |
Pol | I would not judge it, I don't know it | 12:44:12 |
nebucatnetzer13 | Easy, 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 |
Pol | yep :9 | 12:50:47 |
Pol | * yep :( | 12:50:49 |
17 Aug 2024 |
piotrkwiecinski | I was able to fix 20 jobs yesterday https://github.com/piotrkwiecinski/php-src-nix/pull/1 | 08:50:43 |
Pol | man, wow ! Impressive !!! | 08:51:45 |
piotrkwiecinski | There is fair amount of copy/paste. For now I plan to ensure all of them are green and see I can simply it | 08:51:47 |