-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port php to v1 #550
Comments
@DavHau Made a first try, ran into some difficulties
How do i verify this is populated
I did this
Now i'm not sure which config attr to inspect |
You can do it like this:
I made your example evaluate with this patch:
|
Thanks, looks like i need to adapt the translator now for composer-lock files, is there a way to use the old composer translator in the v1 api: The old one is here: |
Yes, you can copy the code and refactor it a little bit. |
I'm getting into some errors, when trying to evaluate : Stack trace of error
nix-repl> :p packages.x86_64-linux.doctrine-dbal.config.php-composer-lock.dreamLock
{ _generic = { defaultPackage = "dbal"; location = ""; packages = { dbal = "unknown"; }; sourcesAggregatedHash = null; subsystem = "php"; }; _subsystem = { composerPluginApiSemver = { "composer/package-versions-deprecated@1.11.99.5" = "^1.1.0 || ^2.0"; "dealerdirect/phpcodesniffer-composer-installer@v1.0.0" = "^1.0 || ^2.0"; }; noDev = false; phpExtensions = [ "json" "pcre" "reflection" "spl" "tokenizer" "dom" "phar" "xmlwriter" "filter" "libxml" "mbstring" "xml" "simplexml" "ctype" ]; phpSemver = "^7.4 || ^8.0"; }; cyclicDependencies = error:
… while calling the 'foldl'' builtin
|
The reason might be that the translator used If you want I can help you with that. Just let me know. |
I pushed a commit to https://github.com/nix-community/dream2nix/tree/aszenz-php, where I ported simpleTranslate2 to |
Thanks it indeed evaluates, so now I could start porting the granular builder, is there a way to reuse the old api's php builder also? |
Yes, start out by copying the builder to a new module under v1. Then refactor it to be a valid nixos module. The module should import the mkDerivation module. Instead of calling the mkDerivation function like before, you want to set the option For examples for how to use the mkDerivation module, you can check the examples of the github.com/davhau/drv-parts project or other modules inside dream2nix v1 that import mkDerivation. Just ping me if you have any more questions. |
We probably want to create the following modules under
v1/nix/modules/drv-parts
:php-composer-lock
(the translator populatingoptions.php-composer-lock.dreamLock
)php-granular
(the builder reading thedreamLock
option and generating a package)And maybe also these modules:
php-composer-json
(impure translator using the newlock
module similar to hownodejs-package-json
does it)php-simple
(the simple builder)To get started I propose:
v1/nix/modules/drvs
that importsphp-composer-lock
andphp-granualar
which failsv1/nix/moduels/drv-parts/php-composer-lock
modules:v1/nix/moduels/drv-parts/nodejs-package-lock
interface.nix
filedefault.nix
file and ensure the internal dreamLock option is populated.config
attr of the example packagev1/nix/modules/drv-parts/php-grnular
module.nodejs-granular
for comparisonThe text was updated successfully, but these errors were encountered: