Commit Graph

158 Commits

Author SHA1 Message Date
Johannes Kirschbauer
419d6f08c4
add new node builder mono-module (#748)
* add new node builder mono-module

* add example

* nodejs-builder-v3: rename to WIP-nodejs-builder-v3

* fix tests

---------

Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
2023-10-17 20:59:10 +01:00
DavHau
72e4fd904d buildRustPackage: add example package 2023-10-17 18:12:32 +00:00
DavHau
cd7dee14ae modules: fixup more nodejs modules for docs rendering 2023-10-11 21:43:01 +00:00
DavHau
e6800060c9 modules: fixups nodejs modules to render docs 2023-10-11 21:12:59 +00:00
DavHau
5e938ebb20 findCycles: add some unit tests 2023-10-10 16:57:18 +00:00
DavHau
541655a6fb examples/pdm: pin nixpkgs to dream2nix nixpkgs 2023-10-08 12:53:39 +00:00
waalge
e9fac8985c fix: nixpkgs follows d2n 2023-10-07 12:52:30 +02:00
DavHau
c4bc9c1f27 feat(pdm): build default group
Also implement source fetching
2023-10-01 00:49:05 +01:00
DavHau
03b1e05f7b fix(spago): fix flake inputs 2023-09-30 15:56:55 +01:00
Andrea Ciceri
e4a9da41ad WIP 2023-09-30 15:56:55 +01:00
DavHau
4eeee078f7 chore(pdm): update example lock file 2023-09-29 14:46:15 +01:00
DavHau
98f7fac5a1 chore(python-pdm): rename python-pdm -> WIP-python-pdm 2023-09-28 19:19:18 +01:00
Frederik Rietdijk
c78d39119a wip pdm init 2023-09-28 19:11:18 +01:00
Jairo Llopis
25e07594f4 fix: improve handling of local python dependencies
The pip locker [sometimes created a URL without hash][1] to reflect that there was a local source.

This produced the following error when trying to evaluate that derivation:

    … from call site

      at /nix/store/qdzdi6qvrqxfqxhi3j70d5dsl9f5jpby-source/modules/dream2nix/pip/default.nix:86:28:

        85|       mkDerivation = {
        86|         src = l.mkDefault (fetchers.${metadata.sources.${config.name}.type} metadata.sources.${config.name});
          |                            ^
        87|         doCheck = l.mkDefault false;

    … while calling 'url'

      at /nix/store/qdzdi6qvrqxfqxhi3j70d5dsl9f5jpby-source/modules/dream2nix/pip/default.nix:57:11:

        56|   fetchers = {
        57|     url = info: l.fetchurl {inherit (info) url sha256;};
          |           ^
        58|     git = info: config.deps.fetchgit {inherit (info) url sha256 rev;};

    error: value is null while a string was expected

Of course, one cannot call `builtins.fetchurl` without a `sha256` argument.

Now, local dependencies are specified exactly like that in the lock file. Now, we'll fetch nothing when dealing with local dependencies.

Also, their evaluation when generating `preFixup` attribute is delayed until build time. This was a bigger problem due to the previous bug, but in any case it should still help to reduce evaluation overhead.

FWIW, sometimes local sources might not really exit in the derivation source tree until build time. For example, when building aggregated sources with meta-repo management tools such as Mr. Chef.

[1]: 40b65e4598/pkgs/fetchPipMetadata/src/fetch_pip_metadata/lock_file_from_report.py (L72C28-L72C28)
2023-09-22 10:49:10 +01:00
DavHau
4eb5478fdd feat(paths): allow paths.package to be an absolute path 2023-09-21 11:00:03 +02:00
DavHau
4234e462ce chore: re-generate all lock files 2023-09-18 17:56:27 +02:00
Yusuf Bera Ertan
599a42d247
refactor: update rust-package example to latest changes (#685) 2023-09-17 09:37:51 +00:00
Jairo Llopis
5a729cb75a docs: simplify python project example
Use `lib.importTOML`, clearer than the previous implementation.

Reuse more information from `pyproject`.
2023-09-15 10:33:20 +02:00
DavHau
a68165d109 chore: update lock files 2023-09-14 11:30:37 +02:00
DavHau
9cc6f02d94 feat(lock): lock file invalidation via lock.invalidationData 2023-09-14 11:30:37 +02:00
DavHau
08d414a359 feat: community overrides
- Add community overrides accessible via dream2nix.overrides.{lang}.{pname}
- make the pip module use the overrides for dependencies
2023-09-12 00:07:04 +02:00
DavHau
c5bdcd7e67 feat(python): add module WIP-python-pyproject 2023-09-11 22:40:08 +02:00
DavHau
cfac73dbd1 feat(pip): allow pypiSnapshotDate to be null
For many users not having a snapshot date is a valid use case.
Also many users will expect their lock file to be updated to the latest dependency versions via a nix run .#package.config.lock.refresh. so it can be the default behavior.
2023-09-11 16:30:31 +02:00
DavHau
e079a21487 examples: simplify repo examples 2023-09-09 14:33:21 +02:00
DavHau
873561e4fe fix(pip): change nixpkgs-overrides & remove default for top-level source
- nixpkgs-overrides are not lazy enough. They can lead to eval failures thrown in nixpkgs despite not being enabled. Therefore we better use the `import` as an enable mechanism instead of the `enable` option.
We keep the enable option to allow for users to disable the override module via mkForce
2023-09-06 02:07:25 +02:00
Yusuf Bera Ertan
45bf32881c fix(examples): fix rust-package example 2023-09-06 00:48:26 +02:00
Yusuf Bera Ertan
d9eada06bc fix(rust-crane): add cargo to the devshell 2023-09-06 00:48:26 +02:00
DavHau
556f2e7114 feat(lib): add helper lib.importPackages
This makes the repo initialization simpler (see examples)
2023-09-06 00:43:37 +02:00
DavHau
0e9553062c nodejs-granular-v3: use new nodejs-package-lock-v3 module
Also add an example package
2023-09-05 18:52:42 +02:00
Vincent Vanlaer
3fd2db74d3
Support git repositories in fetchPipMetadata; take 2 (#637)
* Make pip lock script use its own python version

To make the lock script independent of the python version used in the
user's project, it needs to use its own python environment. This was
already the case for the mitm proxy, but not yet for the lock script
itself. This commit ensures that the lock script uses its own python
environment, independent of the user python version, and shares it with
the mitm proxy.

* Fix IOKit dependency in htop example

* Add hash for git based packages

* Support install git dependencies

* Add test for pip with git dependency

* Update lockfiles for python example projects

This does not change any of the hashes or versions, just adds the type:
"url" property.

---------

Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
2023-09-05 00:40:05 +02:00
DavHau
b40d88b4c3 examples: pick cheaper packages for nodejs
spare some eval time on CI checks
2023-09-05 00:03:21 +02:00
DavHau
b34ce70fdf refactor(examples): more meaningful names 2023-09-04 23:45:08 +02:00
DavHau
b296c9c868 examples: remove use of l = builtins // lib
Having this in the examples might confuse people
2023-09-04 21:30:27 +00:00
DavHau
5418f890b9 examples: add .project-root 2023-09-03 22:47:21 +00:00
DavHau
63fe4be09c fix(examples): use settings.nix 2023-09-03 08:32:17 +00:00
DavHau
165014ec90 examples: add dream2nix-repo-flake 2023-09-03 08:25:17 +00:00
DavHau
ddbd3a159b example-repo: use dream2nix.lib.evalModules 2023-09-03 01:09:42 +00:00
DavHau
1f071813d3 chore: update all lock files and move to new location 2023-09-02 23:34:54 +00:00
DavHau
87722db970 feat(paths): init new core module 'paths'
This is to improve package location finding at eval time and script execution time.

Deprecates options lock.{repoRoot,lockFileRel} as well as option eval-cache.{repoRoot, cacheFileRel}

Instead the user must now set:
  - paths.projectRoot: pointing to the repoRoot
  - paths.package: pointing to the package directory

- paths.projectRootFile can be used to define a marker file to find the project root. The default is '.git' but it could be set to 'flake.nix' for example
- lock files are by default put in the same directory as the package definition
2023-09-02 23:34:54 +00:00
DavHau
c5f5b03944 refactor: rename modules.drv-parts => modules.dream2nix 2023-08-31 13:09:43 +00:00
DavHau
f4371d3e9b refactor(examples): re-categorize
new categories:
- basics
- single-language
- multi-language
2023-08-31 12:53:22 +00:00
DavHau
cf0bd2e99a
Port php to dream2nix modules (#623)
* init: composer

* initial attempt to translating composer lock

* fix(v1/php): use simpleTranslate2 instead of simpleTranslate

* chore: rebasing

* init: granular module

* lib/internal/simpleTranslate2: revert accidental changes

* php: fix php-granular builder module

* php-compser-lock: cleanup

---------

Co-authored-by: asrar <aszenz@gmail.com>
2023-08-29 17:47:13 +02:00
DavHau
9b721a5cd3 feat(rust-crane): get rid of depsDrvOptions and use mkDerivation as a submodule instead 2023-08-28 22:20:28 +00:00
Yusuf Bera Ertan
6e8a22196b feat(rust): pass mkDerivation options to crane options, add options to specify arguments for main and deps derivations 2023-08-28 22:20:28 +00:00
Yusuf Bera Ertan
5b4775c457 refactor: remove devshell code from buildRustPackage 2023-08-28 22:20:28 +00:00
Yusuf Bera Ertan
39a895d579 feat(rust): add some options to crane builder, move rust drvs to examples dir 2023-08-28 22:20:28 +00:00
DavHau
8ffd5e2485 example: add pyproject example package 2023-08-28 15:27:03 +00:00
DavHau
d48babc7b5 examples: improve dream2nix-repo example 2023-07-29 15:29:06 +02:00
DavHau
890d60bcb4 examples: move to /examples from /modules/drvs 2023-07-29 15:08:40 +02:00
DavHau
ef388ef84c chore(modules): move core modules to ./modules/core 2023-07-29 12:36:13 +02:00