Commit Graph

69 Commits

Author SHA1 Message Date
DavHau
f347034b2b refactor: writePureShellScript: don't change to WORKDIR
Reverting a bad design choice.
This lead to weird effects if scripts are nested.
2022-08-20 18:37:08 +02:00
Martin Toman
4dca0944ab test: add integration test for #235 2022-08-11 12:28:47 -07:00
Wout Mertens
a840710c12 removed unused node2nix flake input 2022-08-01 18:58:00 +02:00
DavHau
130d71f9d5 feat: pre-commit-hook to cleanup leftover example artifacts 2022-07-29 14:17:40 +02:00
Yusuf Bera Ertan
df3d951db0
fix: make dream2nix evaluation work with --read-only flag 2022-07-24 18:58:24 +03:00
DavHau
7cd64d386d python improvements, docs and guide.
- add warning to readme and docs stating that dream2nix is unstable software
- refactor structure of docs: remove title .md pages, instead add titles via (# title) to SUMMARY
- change order of doc topics. move `guides` and `subsystems` to the front
- add docs for python subsystem
- add getting started guide for python
- extend ./examples/python to make use of translator options
- add new function to dlib `systemsFromFile` that allows to load the `supportedSystems` from a file. This alows changing the supported systems without touching the flake.
- move pip translator args to extra file `args.nix` to allow embedding in docs
- fix pip translator
- add a .gitignore to the basic flake template
- use new systemsFromFile function in basic flake template
2022-07-16 15:03:37 +02:00
DavHau
b83394e5f2
haskell: init cabal-plan translator (#192)
* haskell: init cabal-plan translator

* simplify cabal2json: take from new nixpkgs

* delete accidental copy of file

* fix example haskell-plan-json

* rename haskell examples
2022-07-12 21:45:29 +02:00
Yusuf Bera Ertan
52f7dd7b51
refactor: move docs cli nix expression 2022-06-22 21:13:27 +03:00
DavHau
78b14674cd fixup/improve python translator and builder
- translator: ensure setup requirements from pyproject.toml are respected
- builder: ensure setup requirements are installed first before the package is built
- simplify the python translator
- dont depend on mach-nix for dependency extraction
- use only pip download to extract dependencies
- allow impure pip translator to cache downloads
- fix dream-lock.json. location was missing
2022-06-22 13:16:09 +02:00
Yusuf Bera Ertan
709e4aa139
refactor: move docs script to seperate file 2022-06-15 23:44:18 +03:00
Yusuf Bera Ertan
7005441ceb
docs: setup mdbook book for documentation, add CLI app for docs (#173)
* docs: setup mdbook book for documentation

* ci: add github action for docs

* docs: add a cli command for showing docs in terminal

* Update docs/src/subsystems/rust.md

Co-authored-by: Ilan Joselevich <personal@ilanjoselevich.com>

* docs(rust): add example for crane overriding

* docs: add a further reading section to intro

* docs: fix a few links

* docs(readme): move documentation section up and fit some sections into 80 columns

Co-authored-by: Ilan Joselevich <personal@ilanjoselevich.com>
2022-06-13 22:27:05 +03:00
Yusuf Bera Ertan
90b353682e
chore: use numtide devshell instead of nixpkgs mkShell for dream2nix development shell (#169)
chore: use newer devShells output instead of devShell
2022-06-05 19:59:19 +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
f1f1633804 remove deprecated tests in ./tests/pure 2022-04-20 16:41:37 +02:00
DavHau
91c66f5946 fix template 2022-04-08 12:02:41 +01:00
DavHau
f59346d1d6 add flake template 2022-04-08 11:59:24 +01:00
DavHau
0f0fa91056 fix missing defaultApp 2022-04-04 12:47:02 +01:00
DavHau
f2d40e70cb remove tests-impure 2022-03-28 23:34:56 +07:00
DavHau
48439d7e8b rename: lib2 -> lib 2022-03-27 22:32:08 +07:00
DavHau
f7c034d4ee add ./examples with flake examples 2022-03-27 22:16:45 +07:00
Max
656a5d6af2
Add aarch64-linux support
I'd like to use dream2nix on an ARM64 machine. Passes `nix flake check`.
2022-03-13 02:06:23 +01:00
DavHau
e0c433078b add pre-commit shellHook 2022-03-07 18:25:38 +07:00
DavHau
6b015ff9f5 fixup formatting issues 2022-03-07 18:06:28 +07:00
DavHau
ae47597f4a formatting hook and include test into .#tests-all 2022-03-07 18:06:28 +07:00
DavHau
076a1c9aff treewide: format with alejandra 1.0.0
closes #84
2022-03-07 18:06:18 +07:00
DavHau
68478d0772 formatting: add flake apps + prepare hooks 2022-03-07 13:57:22 +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
31ff31b901 fix: add some missing crane paths to externalPaths 2022-02-28 12:12:15 +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
d76407b4cd expose project discovery via lib2 2022-02-27 17:26:13 +07:00
DavHau
b78958849d remove dependency nix-parsec 2022-02-23 19:12:33 +07:00
DavHau
7e78d8b37b move some translator funcs to system independent lib 2022-02-23 16:51:47 +07:00
DavHau
b4fef5baf0 make some translator functions system independent
- introduce `dlib` - system independent lib
- refactor all translators, to make functions extraArgs and conpatiblePaths system independent
2022-02-23 14:59:42 +07:00
DavHau
24c42d3eb3 fix flake.nix lib initialization 2022-02-22 15:00:32 +07:00
Justin Restivo
8a574bd152
Add darwin to architecture list 2022-01-29 16:45:36 -05:00
DavHau
1358e1a303 always use internal overrides 2021-12-08 23:18:21 +07:00
DavHau
d3a279875e feature: support multiple packages per source 2021-12-02 14:15:40 +07:00
DavHau
9d2d385273 test nix funcs with pytest via nix_ffi.py 2021-11-20 11:34:04 +07:00
DavHau
b4b7435ca3
Merge branch 'dev' into go 2021-11-17 11:28:22 +07:00
DavHau
3b5b9096e1 hercules ci + improvements
- yarn-lock: add nodejs version argument
 - add impure tests
 - add ci.nix for hercules
2021-11-17 11:23:31 +07:00
Akshat Agarwal
ff9e30b242 add go support using gomod2nix
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
2021-11-16 23:28:05 +05:30
DavHau
60d89f776f improve flake interfaces and apps
- improve exposing apps for other flakes
  - configure overridesDirs via config
2021-11-07 15:18:28 +07:00
DavHau
39db511926 improve override system
- add utils.satisfiesSemver (from poetry2nix)
  - nix-parsec add LICENSE from https://github.com/nprindle/nix-parsec/issues/5
  - remove builtin overrides (moved to dreampkgs)
2021-11-07 15:18:28 +07:00
DavHau
bccf3b25c7 multiple override dirs, nodejs improvements
- nodejs builder: symlink sub dependencies
  - allow multiple directories with overrides
  - rename app: cli -> dream2nix
2021-11-07 15:18:28 +07:00
DavHau
a1d0ed99a8 restructure / rename dream-lock attributes 2021-11-04 15:36:12 +07:00
DavHau
aa81800846 fixes and improvements for nodejs
- add system specific dream2nix to flake outputs
   - add more overrides
   - overrides allow regex as key
2021-11-02 15:13:34 +07:00
DavHau
b23e9ef8f3 make output packages flakes compatible
- closes #39
2021-11-01 00:14:36 +07:00
DavHau
0d1e36f770 init: dream2nix overrides 2021-10-31 10:38:51 +07:00
DavHau
52740e8f96 Tests + refactor externls
- add flake checks
  - refactor handling of external sources
  - rename 'dependenciesRemoved' -> 'cyclicDependencies'
2021-10-29 21:18:58 +07:00
DavHau
c4b110bc38 output schema flakes-style 2021-10-29 16:59:56 +07:00