mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-26 22:31:39 +03:00
docs: mv gettingstarted to guides/getting-started
This commit is contained in:
parent
7b48877133
commit
363a6996c3
@ -1,6 +1,6 @@
|
||||
nav:
|
||||
- "Home": index.md
|
||||
- "Getting Started": gettingstarted.md
|
||||
- Guides: guides
|
||||
- Concepts:
|
||||
- "Modules": modules.md
|
||||
- "Overriding Dependencies": overrides.md
|
||||
|
2
docs/src/guides/.pages
Normal file
2
docs/src/guides/.pages
Normal file
@ -0,0 +1,2 @@
|
||||
nav:
|
||||
- getting-started.md
|
@ -5,7 +5,7 @@
|
||||
If that's not the case, check out the official documentation site at [nix.dev](https://nix.dev/) first!
|
||||
|
||||
In this tutorial, we are going to package [GNU hello](https://gnu.org/s/hello), a traditional example for build systems, in order to get started
|
||||
with dream2nix and its [module system ](./modules.md).
|
||||
with dream2nix and its [module system ](../modules.md).
|
||||
|
||||
## Start a project
|
||||
|
||||
@ -15,7 +15,7 @@ We start by creating a new git repository with the following two files:
|
||||
The package is declared by calling `dream2nix.lib.evalModules` with the definitions in `hello.nix`, nixpkgs
|
||||
and a helper module to let dream2nix know about your directory layout.
|
||||
|
||||
- `hello.nix` declares a dream2nix module that imports [mkDerivation](./reference/mkDerivation/index.md) and
|
||||
- `hello.nix` declares a dream2nix module that imports [mkDerivation](../reference/mkDerivation/index.md) and
|
||||
uses that to build GNU hello.
|
||||
|
||||
Check out the code below and its annotations to learn more!
|
||||
@ -69,7 +69,7 @@ Check out the code below and its annotations to learn more!
|
||||
|
||||
1. Import dream2nix and tell nix to use whatever version of nixpkgs dream2nix declares. You can use other versions, but this it what we run our automated tests with.
|
||||
2. Define a helper function that allows us to reduce boilerplate and still support all of of the listed systems for our package.
|
||||
3. Create our package, called `hello` here, by *evaluating* the given dream2nix [modules](./modules.md).
|
||||
3. Create our package, called `hello` here, by *evaluating* the given dream2nix [modules](../modules.md).
|
||||
4. Pass the given instance of nixpkgs to build our package with as a *module argument*.
|
||||
5. Include our package definition from `hello.nix`. See below for its contents!
|
||||
6. Define relative paths to aid dream2nix to find lock files and so on during *evaluation time*. These settings should work for repos containing multiple python projects as simpler ones.
|
||||
@ -112,7 +112,7 @@ Check out the code below and its annotations to learn more!
|
||||
|
||||
1. Define a function, taking our *module arguments* and returning a *module*.
|
||||
Inputs include `dream2nix`, a reference to package itself in `config`, and the nixpkgs library in `lib`.
|
||||
2. Import the [`mkDerivation`](./reference/mkDerivation/index.md) module.
|
||||
2. Import the [`mkDerivation`](../reference/mkDerivation/index.md) module.
|
||||
3. Define `name` and `version` of the package. Unlike most other options, those are not namespaced and defined in dream2nix `core` module.
|
||||
4. Define a function that returns **dep**endencie**s** as *module options* from the given *package sets*.
|
||||
`hello` here needs a compiler already in the defaults of `mkDerivation`, we don't need `deps` here but include it for demonstration purposes.
|
||||
@ -145,7 +145,7 @@ Hello, World!
|
||||
|
||||
## Lock it
|
||||
|
||||
Some of our our modules such as [pip](./reference/pip/index.md) require a custom lock file
|
||||
Some of our our modules such as [pip](../reference/pip/index.md) require a custom lock file
|
||||
added to your repository in order to pin your dependencies and store metadata which we can't
|
||||
acquire during *evaluation time*.
|
||||
|
||||
@ -163,7 +163,7 @@ $ git add lock.json
|
||||
Check out our guides, the reference documentation and [examples](https://github.com/nix-community/dream2nix/tree/main/examples/packages/languages)
|
||||
to learn more about the various modules and options to learn more about language-specific helpers to package and distribute your software with dream2nix.
|
||||
|
||||
Once you have imported a module, this module will make ecosystem-dependent functions, such as [`mkDerivation`](./reference/mkDerivation/index.md) or [`buildPythonPackage`](./reference/buildPythonPackage/index.md), available to your package modules.
|
||||
Once you have imported a module, this module will make ecosystem-dependent functions, such as [`mkDerivation`](../reference/mkDerivation/index.md) or [`buildPythonPackage`](../reference/buildPythonPackage/index.md), available to your package modules.
|
||||
|
||||
And don't forget to join our communities at [matrix: #dream2nix:nixos.org](https://matrix.to/#/#dream2nix:nixos.org) and [github: nix-community/dream2nix](https://github.com/nix-community/dream2nix) to ask questions and learn from each other. Feedback we receive
|
||||
there helps us to improve code & documentation as we go.
|
Loading…
Reference in New Issue
Block a user