Skip to content

Commit

Permalink
fix #50: validate relative references
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Nov 16, 2024
1 parent 614f3d9 commit 2ab24be
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 31 deletions.
4 changes: 2 additions & 2 deletions docs/binary-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ To specify `pre-commit-hooks` as a cache to pull from and `mycache` to pull from

You'll likely not want every user to push to the cache.

It's usually convenient to push [explicitly](./files-and-variables/#devenvlocalnix), for example as part of CI run:
It's usually convenient to push [explicitly](files-and-variables.md#devenvlocalnix), for example as part of CI run:

```shell-session
$ echo '{ cachix.push = "mycache"; }' > devenv.local.nix
```
```
2 changes: 1 addition & 1 deletion docs/community/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We have a rule that new features need to come with documentation and tests (`dev

## Preparing the `devenv` development environment

1. Follow the [installation instructions for Nix and Cachix](../../getting-started/#installation) and [install direnv](../../automatic-shell-activation/).
1. Follow the [installation instructions for Nix and Cachix](../getting-started.md#installation) and [install direnv](../automatic-shell-activation.md).

2. `git clone https://github.com/cachix/devenv.git`

Expand Down
4 changes: 2 additions & 2 deletions docs/composing-using-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For example, ``devenv up`` will start both the frontend and backend processes.
!!! note
While composing ``devenv.nix`` is a key feature,
While composing ``devenv.nix`` is a key feature,
composing ``devenv.yaml`` [hasn't been implemented yet](https://github.com/cachix/devenv/issues/14).
See [devenv.yaml reference](reference/yaml-options.md#inputs) for all supported imports.
See [devenv.yaml reference](reference/yaml-options.md#an-extensive-example) for all supported imports.
12 changes: 6 additions & 6 deletions docs/containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Examples of what `devenv container` can do:

- `devenv container build shell`: Generate a container and [start the environment](#entering-the-development-environment), equivalent of using `devenv shell`.
- `devenv container build processes`: Generate a container and [start processes](#running-processes), equivalent of using `devenv up`.
- `devenv container --registry docker://ghcr.io/ copy <name>`: [Copy the container](#copying-container-to-a-registry) `<name>` into the **GitHub package registry**.
- `devenv container --registry docker://ghcr.io/ copy <name>`: [Copy the container](#copying-a-container-to-a-registry) `<name>` into the **GitHub package registry**.
- `devenv container run <name>`: Run the container `<name>` using **Docker**.

## Entering the development environment
Expand Down Expand Up @@ -46,7 +46,7 @@ $ devenv container run shell
(devenv) bash-5.2# python
Python 3.10.9 (main, Dec 6 2022, 18:44:57) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
```

## Running processes
Expand All @@ -63,7 +63,7 @@ A common deployment strategy is to run each [process](./processes.md) as an entr
processes.hello-nix.exec = "while true; do echo 'Hello Nix!' && sleep 1; done";
# Exclude the source repo to make the container smaller.
containers."processes".copyToRoot = null;
containers."processes".copyToRoot = null;
}
```

Expand Down Expand Up @@ -108,7 +108,7 @@ If you're building binaries as part of the development environment, you can choo
{
# watch local changes and build the project to ./dist
processes.build.exec = "${pkgs.watchexec}/bin/watchexec my-build-tool";
containers."prod".copyToRoot = ./dist;
containers."prod".startupCommand = "/mybinary serve";
}
Expand All @@ -129,7 +129,7 @@ To copy a container into a registry use `copy` subcommand:
$ devenv container --registry docker:// copy processes
```

Another common example is deploying to [fly.io](https://fly.io).
Another common example is deploying to [fly.io](https://fly.io).
Any arguments passed to `--copy-args` are forwarded to [skopeo copy](https://github.com/containers/skopeo/blob/main/docs/skopeo-copy.1.md#options):


Expand Down Expand Up @@ -159,7 +159,7 @@ If you want to provide the `openssl` package to native and container environment
{ pkgs, config, lib, ... }:
{
packages = [ pkgs.openssl ]
packages = [ pkgs.openssl ]
++ lib.optionals (!config.container.isBuilding) [ pkgs.git ];
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ There are a few special inputs passed into `devenv.nix`:

- `pkgs` is a `nixpkgs` input containing [all of the available packages](./packages.md#searching) for your system.
- `lib` is [a collection of functions for working with Nix data structures](https://nixos.org/manual/nixpkgs/stable/#sec-functions-library). You can use [noogle](https://noogle.dev/) to search for a function.
- `config` is the final resolved configuration for your developer environment, which you can use to reference any other options set in [devenv.nix](./reference/options.md).
- `config` is the final resolved configuration for your developer environment, which you can use to reference any other options set in [devenv.nix](./reference/options.md).
Since Nix supports lazy evaluation, you can reference any option you define in the same file as long as it doesn't reference itself!

!!! note

``...`` is a catch-all pattern for any additional inputs, so you can safely omit the inputs you're not using.

See [devenv.yaml reference](reference/yaml-options.md#inputs) for all supported inputs.
See [devenv.yaml reference](reference/yaml-options.md) for all supported inputs.

## Locking and updating inputs

When you run any of the commands, `devenv` resolves inputs like `github:NixOS/nixpkgs/nixpkgs-unstable` into a commit revision and writes them to `devenv.lock`. This ensures that your environment is reproducible.

To update an input to a newer commit, run `devenv update` or read the [devenv.yaml reference](reference/yaml-options.md#inputs) to learn how to pin down the revision/branch at the input level.
To update an input to a newer commit, run `devenv update` or read the [devenv.yaml reference](reference/yaml-options.md) to learn how to pin down the revision/branch at the input level.
26 changes: 12 additions & 14 deletions docs/reference/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -29217,10 +29217,10 @@ string
''
[files]
ignore-dot = true

[default]
binary = false

[type.py]
extend-glob = []
''
Expand Down Expand Up @@ -30981,9 +30981,9 @@ string
```
''
---

extends: relaxed

rules:
indentation: enable
''
Expand Down Expand Up @@ -63007,10 +63007,10 @@ string
''
[files]
ignore-dot = true

[default]
binary = false

[type.py]
extend-glob = []
''
Expand Down Expand Up @@ -64771,9 +64771,9 @@ string
```
''
---

extends: relaxed

rules:
indentation: enable
''
Expand Down Expand Up @@ -65940,7 +65940,7 @@ strings concatenated with “\\n”
{
debug
}

# Site block
example.com {
encode gzip
Expand Down Expand Up @@ -66005,7 +66005,7 @@ string



Use saved config, if any (and prefer over configuration passed with [` caddy.config `](\#caddyconfig)).
Use saved config, if any (and prefer over configuration passed with [` caddy.config `](\#servicescaddyconfig)).



Expand Down Expand Up @@ -67866,7 +67866,7 @@ strings concatenated with “\\n”
```
''
log4j.rootLogger=INFO, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
Expand Down Expand Up @@ -71846,7 +71846,7 @@ strings concatenated with “\\n”
```
''
vcl 4.0;

backend default {
.host = "127.0.0.1";
.port = "80";
Expand Down Expand Up @@ -72527,5 +72527,3 @@ list of string

*Declared by:*
- [https://github.com/cachix/devenv/blob/main/src/modules/top-level.nix](https://github.com/cachix/devenv/blob/main/src/modules/top-level.nix)


4 changes: 2 additions & 2 deletions docs/supported-services/caddy.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ strings concatenated with “\\n”
{
debug
}
# Site block
example.com {
encode gzip
Expand Down Expand Up @@ -179,7 +179,7 @@ string



Use saved config, if any (and prefer over configuration passed with [` caddy.config `](\#caddyconfig))\.
Use saved config, if any (and prefer over configuration passed with [` caddy.config `](\#servicescaddyconfig))\.



Expand Down
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ site_url: "https://devenv.sh"
repo_name: "cachix/devenv"
repo_url: "https://github.com/cachix/devenv"
edit_uri: "edit/main/docs"
strict: true
validation:
omitted_files: warn
absolute_links: info # Or 'relative_to_docs' - new in MkDocs 1.6
unrecognized_links: warn
anchors: warn # New in MkDocs 1.6
extra_css:
- assets/top-level.css
theme:
Expand Down
2 changes: 1 addition & 1 deletion src/modules/services/caddy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ in
default = false;
type = types.bool;
description = ''
Use saved config, if any (and prefer over configuration passed with [`caddy.config`](#caddyconfig)).
Use saved config, if any (and prefer over configuration passed with [`caddy.config`](#servicescaddyconfig)).
'';
};

Expand Down

0 comments on commit 2ab24be

Please sign in to comment.