Commit Graph

102 Commits

Author SHA1 Message Date
Yusuf Bera Ertan
39eeaaa450
refactor: use new flake output schema for default package and devshells (#168) 2022-06-05 13:17:41 +02:00
Yusuf Bera Ertan
a46486a67e
fix(builder/crane): remove code that triggers IFD, remove dependency on full project source for deps only drv (#166)
* fix(builder/crane): remove code that triggers IFD, remove dependency on full project source for deps only drv

* fix(rust/builders): pass pkgs to utils.nix

* fix(builder/crane): break dependency on whole project source in dependency derivation

* refactor(rust/builders): change nix version to be more close to when reading toFile paths was made non-IFD

* docs(translator/cargo-lock): make the safety comment about unsafeDiscardStringContext usage more clear

* chore(deps): update crane

* fix: use builtins.path to make paths content addressed and named properly in a few places, fix cargo-lock path replacements

* refactor(rust/builders): remove nix version check for writing cargo.lock to store

* tests: update dream2nix input before overriding it

* tests: remove 'flake.lock's, overriding input generates flake.lock correctly

* tests: use nixpkgs from dream2nix input in d2n-init-pkgs

* refactor: remove useless builtins.path calls

* fix: use writeText for writing generated Cargo.lock, toFile causes problems
2022-06-05 13:14:20 +02:00
Yusuf Bera Ertan
9b6638a1a7
feat: implement makeOutputs that outputs systemless structure (#161)
* feat: return underlying d2n instance if pkgs was passed to init, document init pkgs

* feat: implement makeOutputs

* tests: dont fail if resolveImpure fails

* feat: make init return a dream2nix instance, rework makeFlakeOutputs code

* feat: default to source if config.projectRoot is not specified, update examples and readme

* fix: update the simple template

* docs: clarify init in readme

* docs: change readme numbering to back to 1

* refactor: dont default projectRoot to source

* docs: make extensive example use makeFlakeOutputs, link per-pkgs d2n example in readme

* fix: call loadConfig correctly
2022-06-01 22:53:46 +02:00
Yusuf Bera Ertan
8d275a1dc9
fix: expose all builder outputs (#162)
* fix: expose all builder outputs

* fix: don't recursively update into derivations
2022-05-29 22:16:44 +02:00
Yusuf Bera Ertan
645c6fd98e
refactor: implement a validation system for builders / translators, reorganize files (#155)
* refactor: implement a validation system for builders / translators etc, organize files

* refactor: use seq instead of complicated validation function for validator

* feat: allow adding discoverers, translators and builders via config

* refactor: rework discoverers to use makeSubsystemModules as well

* fix: validate extra modules properly

* feat: support inline modules

* feat: use extra attribute for extending

* feat: make fetchers extensible properly

* fix: add name to extra fetchers

* feat: support list for extra

* docs: add some comment to lib/modules.nix

* fix: get extra module args from extraArgs

* fix: collect all modules instead of only collecting modules for built-in subsystems

* refactor: minor improvements

* refactor: improve how default subsystem modules are declared

* fix: translators and builders are directly under subsystem now

* fix: correct attribute path, remove unused argument

* fix: correct translators attribute paths

* fix: correct file paths and translators attribute paths

* fix: use correct translator attr path in wrapPureTranslator

* fix: update unit tests code

* fix: remove extra paranthesis in unit tests code

* tests: add an extended dream2nix example

* refactor: replace recursiveUpdate usage with normal update op

* tests: fix and extend d2n-extended example

* fix: pass config to d2n instance in wrap pure translator script

* fix: correct toFile usage

* fix: pass config to dlib in more places

* fix: pass config to d2n instance in aggregated hashes cli and gomod2nix translator

* refactor: remove unused extra modules validation, add warning for function modules

* fix: remove non-existent inherited variable

* docs: update translator attr path in contributors guide

* docs: add docs for extending dream2nix

* refactor: comment more code, warn for function modules only if extra is an attrset decl

* docs: fix some typos

* docs: explain some stuff in extending d2n better

* fix: print function modules warning when it is a function

* tests: add a new example that tests adding new subsystem and config.extra as nix file

* tests: use cargo-toml as translator on d2n-extended to potentially catch more bugs

* feat: add ifd warning for builders

* tests: use build-rust-package builder instead of crane builder in d2n-extended to also test it instead of only testing crane builder

* fix(rust/builders): always write the generated Cargo.lock so it doesnt get out of sync with our dream-lock

* fix(rust/builders): delete cargo lock before writing it?

* refactor: also print ifd warnings for translators

* docs: link extending d2n doc in readme, link examples in extending d2n

* docs: example naming (translators.new -> translators.example-translator)

* feat: allow setting nix files for modules declarations (eg. subsystems, subsystems.translators)

* refactor: move IFD warnings to src/lib/builders.nix / translators.nix respectively

* refactor: throw instead of warning if function declarations for modules are used

* refactor: fix throw usage

* refactor: improve modules code

* chore(deps): update nixpkgs

* fix: correct some map usages

* fix: use correct attr path for extra modules

* chore: update examples flake inputs

* style: minor formatting changes
2022-05-29 21:42:47 +02:00
DavHau
efe9698305 refactor: clean up builder interface 2022-05-19 16:54:32 +02:00
DavHau
ad48c2134c Merge remote-tracking branch 'jaen/resolve-path-sources-relative-to-source-root' 2022-05-17 20:11:55 +02:00
Yusuf Bera Ertan
34a272a39c
fix(fetcher): make sourceRoot be used after rootName and rootVersion are tried for path sources 2022-05-15 23:11:37 +03:00
Tomek Mańko
15b822a040 Resolve path sources relative to the source root 2022-05-08 21:29:01 +02:00
Yusuf Bera Ertan
a2cbbb576c
feat: expose makeOutputsForDreamLock 2022-05-02 13:05:55 +03:00
dusk
1c8faf4882
Another round of rust fixes (#130)
* fix(builder/build-rust-package): don't hardcode cargo config path

* refactor(rust): vendor every dependency in cargo lock to fix some build issues, clarify some code

* fix(builder/build-rust-package): cargoCheckFlags -> cargoTestFlags
2022-04-27 11:57:41 +02:00
DavHau
40d3e16050 improve resolveImpure error message
closes #111
2022-04-24 12:46:02 +02:00
DavHau
3a293cc914 automatic unit tests for pure translators
- translators can now enable unit tests via `generateUnitTestsForProjects`
2022-04-24 12:04:08 +02:00
DavHau
3b81f4e35b refactor: translatorsV2 -> translators 2022-04-23 14:48:00 +02:00
DavHau
34f1ff3e23 remove deprecated interfaces:
- makeOutputs
- translators.translators
2022-04-20 16:58:38 +02:00
Yusuf Bera Ertan
aa6099ecf2
feat(translator/cargo-lock): use discoveredProjects to find dependencies that are outside of a packages source 2022-04-10 17:22:58 +03:00
DavHau
502a2fefc5 fix aggregated fetching 2022-03-28 23:20:44 +07:00
DavHau
065c283b75 add sourceOverrides to lib2 2022-03-27 21:45:31 +07:00
DavHau
783a64d33a allow selecting builder via lib2 2022-03-27 20:08:22 +07:00
DavHau
0ef1821bdc toposort discovered projects to improve selection of main project 2022-03-14 10:15:19 +07:00
DavHau
d0cfed18e7 add inject for lib2 2022-03-10 17:05:34 +07:00
DavHau
ae169b42ac fix: path of path dependencies not computer correctly 2022-03-10 14:41:29 +07:00
DavHau
076a1c9aff treewide: format with alejandra 1.0.0
closes #84
2022-03-07 18:06:18 +07:00
DavHau
90649d117a fix invalidationHash logic + remove .#resolve messages 2022-03-06 00:38:06 +07:00
DavHau
bc3c3820b0 fix fallback on existing dream-lock.json 2022-03-05 23:55:42 +07:00
DavHau
924bb494e6 feature: nix run .#resolveImpure 2022-03-05 23:34:09 +07:00
DavHau
1878b8f247 feature: add .resolve to every package 2022-03-05 18:44:01 +07:00
DavHau
e7f65555cb translator v2 iface to accept only one project 2022-03-05 16:17:14 +07:00
DavHau
4828105acb translateProjects: return resolved projects 2022-03-05 15:13:48 +07:00
DavHau
b97b84f943 rename: resolveProjectsFromSource -> translateProjects 2022-03-05 14:48:17 +07:00
DavHau
f8f37dd50e lib2: enable packageOverrides 2022-03-05 14:29:55 +07:00
DavHau
2a696e7198 nodejs: filter projects duric dicovery 2022-03-05 10:49:43 +07:00
DavHau
b1b80111d2 automatically add dreamLockPath to discovered projects 2022-03-04 21:24:47 +07:00
zimbatm
46dd1ab167
use one nixpkgs instance
Push the nix configuration into the CLI so we don't need the overlay,
and so we don't need to create another instance of nixpkgs.

This also means that the python CLI can be executed directly as long as
the user has a recent-enough version of nix and make iterations a bit
faster.

For more details, see
https://zimbatm.com/notes/1000-instances-of-nixpkgs
2022-03-04 13:26:16 +01:00
DavHau
848c424c03 fix: don't error out on impure unresolved projects 2022-03-03 15:58:07 +07:00
DavHau
2b6bcb7b75 add settings argument to lib2.makeFlakeOutputs 2022-03-03 15:48:30 +07:00
DavHau
1fc9998b0f add flake output projectsJson 2022-03-01 14:21:26 +07:00
DavHau
e075f98a90 fix: externalDir not copied to store 2022-02-28 12:11:55 +07:00
DavHau
958bdd6699 Squashed commit of the following:
commit c580c24b82
Author: Yusuf Bera Ertan <y.bera003.06@protonmail.com>
Date:   Sun Feb 27 21:51:58 2022 +0300

    feat: expose builders in lib.init

commit 2fe01e1715
Author: Yusuf Bera Ertan <y.bera003.06@protonmail.com>
Date:   Sun Feb 27 18:37:39 2022 +0300

    fix(rust/crane): make sure cargo only builds the package we want

...(more)
2022-02-28 11:25:39 +07:00
DavHau
7ff0d5d0e8 add field _generic.location to dream-lock 2022-02-27 19:06:38 +07:00
DavHau
c470172eea improve realizeProjects & resolveProjectsFromSource 2022-02-27 17:25:24 +07:00
DavHau
6a232399ad improve error handling when invalid args passed 2022-02-27 15:48:05 +07:00
DavHau
ed9bdd2fa2 small fixes in translators and resolving 2022-02-27 15:37:09 +07:00
DavHau
14954c7d14 init translatorV2 downwards compatibility 2022-02-27 14:07:51 +07:00
DavHau
cca2b5c402 introduce realizeProjects 2022-02-26 20:52:26 +07:00
DavHau
838db1097e make V1 translators V2 comaptible 2022-02-26 10:59:06 +07:00
DavHau
b1872eb866 fixup resolveAllProjects 2022-02-26 00:54:52 +07:00
DavHau
57bc7e9c41 WIP: init resolveAllProjects 2022-02-25 21:36:15 +07:00
DavHau
025c4d059f refactor makeOutputs: init makeOutputsForDreamLock 2022-02-25 18:35:13 +07:00
DavHau
b78958849d remove dependency nix-parsec 2022-02-23 19:12:33 +07:00