dream2nix/examples/packages
2024-01-07 17:40:55 +00:00
..
basics examples: add flake.nix to each example 2023-10-31 11:36:21 +00:00
multi-language/python-nodejs update nixpkgs 2023-12-12 09:52:44 +00:00
single-language pdm: refresh pdm.lock on 'nix run .#{package}.lock' 2024-01-07 17:40:55 +00:00
README.md examples: add readme for packages examples 2024-01-07 06:28:34 +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/single-language/php-package/:

# 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-package
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
[...]