Commit Graph

184 Commits

Author SHA1 Message Date
DavHau
42838c5909 examples: cleanup and rename to simplify
- name example more consistently, eg. `{language}-packaging-{feature}` or `{language}-local-development-{feature}`
- move some examples to the modules integration tests directory instead as their purpose was mainly testing and they weren't good example
- module owned checks: import via flake if available
2024-03-09 04:45:59 +00:00
DavHau
887022b8c1 update nixpkgs:
- downgrade mitmproxy to avoid breakage
- add test for pip lock script
- fix bug in flake compat implementation (https://github.com/nix-community/flake-compat/pull/4#issuecomment-1950301370)
- small fix in docs for lock and eval-cache
- fix lock refresh script: don't swallow errors
2024-02-24 13:47:45 +00:00
Johannes Kirschbauer
8a040b7a96 nodejs: add simple nextjs example 2024-02-15 07:22:18 +00:00
DavHau
16f2c654c6 pdm: stop using config.deps.python3 in favor of config.deps.python 2024-01-24 08:09:56 +00:00
DavHau
0fb528d452 pdm: refresh pdm.lock on 'nix run .#{package}.lock' 2024-01-07 17:40:55 +00:00
DavHau
0f2d06b43e examples: add readme for packages examples 2024-01-07 06:28:34 +00:00
DavHau
67c1356f20 update nixpkgs 2023-12-12 09:52:44 +00:00
DavHau
c25e88974f nodejs-devshell-v3: init 2023-11-17 07:35:09 +00:00
DavHau
8db4cb1121 examples: minimize nodejs-project example 2023-11-15 08:44:40 +00:00
DavHau
7cb0fded82 nodejs: fix backward compat for nodejs-package-json
- revert recent changes on nodejs-package-json
- instead introduce nodejs-package-json-v3

This way, existing users won't face breakages in the api
2023-11-08 07:34:15 +00:00
DavHau
24e81d5ce8 examples: rename repo examples 2023-11-07 19:08:27 +07:00
DavHau
1c47a7cfba examples: move repo-flake-groups to /misc/drafts 2023-11-07 19:08:27 +07:00
DavHau
3030cd5877 examples/python-pdm: migrate to ./packages 2023-11-07 19:08:27 +07:00
DavHau
bce7ab631d nodejs-package-json: use v3 lock file 2023-11-07 18:45:35 +07:00
DavHau
d8e4b477e3 refactor: move dev related things to /dev-flake
The goal is to reduce the flake inputs visible to the user
Still, the top-level flake re-exposes the outputs of the dev-flake, but
without exposing its inputs. This means a devShell is still available in
the top-level, for example.

This also removes the /modules/flake.nix. Its original purpose was
separating the modules inputs from the development inputs, but this is
now done the opposite way around by moving the dev inputs to
/dev-flake/flake.nix.
2023-11-05 03:42:18 +00:00
DavHau
5914156eb7 examples: add flake.nix to each example
This makes hte examples more standalone and suitable for copy & paste
2023-10-31 11:36:21 +00:00
DavHau
61bc3b1377 examples: remove dream2nix- prefix 2023-10-30 21:42:51 +00:00
t4ccer
1a7a59e001 Remove Haskell example readme 2023-10-30 20:35:34 +00:00
t4ccer
c5b2624352 More robust source locking 2023-10-30 20:35:34 +00:00
t4ccer
2313bdf946 Don't fixup dependencies to prevent moving directories 2023-10-30 20:35:34 +00:00
t4ccer
42d9efb91b Clean up haskell stuff 2023-10-30 20:35:34 +00:00
t4ccer
d903c85d7a Simplify lock file 2023-10-30 20:35:34 +00:00
t4ccer
92375aa5fd Add toy Haskell example 2023-10-30 20:35:34 +00:00
Johannes Kirschbauer
f9f8b595d6 Docs: add comment to flake template 2023-10-29 12:36:14 +00:00
DavHau
aac7f3f77e pdm: build package with deps 2023-10-22 00:50:36 +00:00
hsjobeki
0c6910060f add versions to group packages 2023-10-18 16:54:32 +00:00
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