dream2nix/examples/packages
dusk 44d4141168
refactor(rust): deduplicate vendor and utils code (#1054)
* refactor(rust): consolidate the separated vendoring code into rust-cargo-vendor

* refactor(rust): move the utility code in utils.nix to rust-cargo-lock and rust-cargo-vendor

* fix(rust-crane): add the necessary dependencies to config.deps for devshell

* refactor(rust-cargo-vendor): remove unnecessary mkMerge

* fix(rust-crane): override cargo in config.deps with our toolchain so that rust-cargo-vendor uses it too
2024-11-12 18:09:27 +03:00
..
basics tree-wide: make examples eval on all platforms... 2024-06-28 21:05:33 +02:00
languages refactor(rust): deduplicate vendor and utils code (#1054) 2024-11-12 18:09:27 +03:00
README.md docs: fix template attr in examples readme 2024-03-12 07:33:46 +00:00

package examples

This directory contains examples for modules defining packages. All modules can be used as templates to create new packages.

Each package module is defined by a directory containing a default.nix.

How to use

All examples are self contained via their own flake.nix.

To use multiple packages in a repository, keep only each packages' default.nix and put them under a top-level flake.nix instead, as shown in the repo examples in /examples.

Usage example

For example, in order to initialize a php-package from packages/languages/php-packaging/:

# create new single package repo for php
$ mkdir my-dream2nix-package
$ cd my-dream2nix-package
$ nix flake init -t github:nix-community/dream2nix#templates.php-packaging
wrote: /tmp/my-dream2nix-package/flake.nix
wrote: /tmp/my-dream2nix-package/default.nix

# git add (in case git is used)
git add .

# interact with the package
$ nix flake show
[...]
$ nix build
[...]