Skip to content

Commit

Permalink
Document how to get started on GitLab (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoverbear authored Feb 9, 2024
1 parent 15802f0 commit 58303b5
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A fast, friendly, and reliable tool to help you use Nix with Flakes everywhere.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```

The `nix-installer` has successfully completed over 1,000,000 installs in a number of environments, including [Github Actions](#as-a-github-action):
The `nix-installer` has successfully completed over 2,000,000 installs in a number of environments, including [Github Actions](#as-a-github-action) and [GitLab](#on-gitlab):

| Platform | Multi User | `root` only | Maturity |
|------------------------------|:------------------:|:-----------:|:-----------------:|
Expand Down Expand Up @@ -136,6 +136,24 @@ jobs:
run: nix build .
```
### On GitLab
GitLab CI runners are typically Docker based and run as the `root` user. This means `systemd` is not present, so the `--init none` option needs to be passed to the Linux planner.
On the default [GitLab.com](https://gitlab.com/) runners, `nix` can be installed and used like so:
```yaml
test:
script:
- curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --no-confirm --init none
- . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
- nix run nixpkgs#hello
- nix profile install nixpkgs#hello
- hello
```
If you are using different runners, the above example may need to be adjusted.
### Without systemd (Linux only)
> **Warning**
Expand Down

0 comments on commit 58303b5

Please sign in to comment.