Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update documentation #94

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion docs/articles/en/built-in-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Tags:
---

> **Note**
> At the time of writing, Vib is in active development and the list of built-in modules may grow over time. This article covers the modules available in Vib v0.5.0.
> At the time of writing, Vib is in active development and the list of built-in modules may grow over time. This article covers the modules available in Vib v0.8.1.

Vib supports a variety of built-in modules that you can use to build your recipes. These modules are designed to automate common tasks, such as installing packages, building software, and running custom scripts.

Expand All @@ -28,6 +28,7 @@ To keep this article concise, we'll cover only the fields that are specific to e
- [Make](#make)
- [Meson](#meson)
- [Shell](#shell)
- [Flatpak](#flatpak)

## Package manager

Expand Down Expand Up @@ -227,3 +228,33 @@ The following specific fields are available:
- "echo Hello, World!"
- "apt update && apt install -y curl"
```

## Flatpak

The Flatpak module installs Flatpak packages using the `flatpak` command.

The following specific fields are available:

- `system`: If configured, the module will install the applications system-wide.
- `user`: If configured, the module will install the applications user-wide.

### Example

```yaml
- name: install-flatpak-app
type: flatpak
system:
repourl: "https://flathub.org/repo/flathub.flatpakrepo"
reponame: "flathub"
install:
- "org.gnome.Epiphany"
remove:
- "org.gnome.Epiphany"
user:
repourl: "https://flathub.org/repo/flathub.flatpakrepo"
reponame: "flathub"
install:
- "org.gnome.Epiphany"
remove:
- "org.gnome.Epiphany"
```
15 changes: 15 additions & 0 deletions docs/articles/en/making-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
Title: Making a Plugin
Description: How to build a custom plugin for Vib.
PublicationDate: 2024-02-14
Listed: true
Authors:
- mirkobrombin
Tags:
- github
- build
---

This documentation is still being written. Please check back later.
If you are a developer, please have a look at the reference documentation for [Vib](https://dev-vib.vanillaos.org/).
You may also want to check out the [vib-plugin template](https://github.com/Vanilla-OS/vib-plugin).
20 changes: 20 additions & 0 deletions docs/articles/en/recipe-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,26 @@ Refer to the [Use Modules](/vib/en/use-modules) article for more information on

You can also write your custom modules by making a Vib plugin, see the [Making a Plugin](/vib/en/making-plugin) article for more information.

#### Setting up the working directory

Each module can have a `workdir` field that changes the directory before executing the rest of the module operations. The following is an example of how to use the `workdir` field:

```yml
- name: example-module
type: shell
workdir: /app
commands:
- touch file.txt

- name: example-module-2
type: shell
workdir: /app
commands:
- ls -la
```

In this example, the `example-module` module creates a file named `file.txt` in the `/app` directory, and the `example-module-2` module lists the contents of the `/app` directory.

### Copying files between stages

You can copy files between stages using the `copy` field. This consists of a list of files or directories to copy from another stage. Each item in the list is a YAML snippet that defines the source and destination of the copy operation. The common structure is:
Expand Down
Loading