experimental-features is not considered but extra-experimental-features is? #28

Open
opened 2023-06-27 11:38:22 +00:00 by FRidh · 10 comments
FRidh commented 2023-06-27 11:38:22 +00:00 (Migrated from github.com)

I noticed that setting experimental-features in extra-conf has no effect, however, setting extra-experimental-features does. Is this expected behaviour? Could this be because by default it is set to include flakes?

name: "CI using nix"

on:
    push:
      branches:
        - develop
        - main

    pull_request:
      branches:
        - develop
        - main

jobs:
    check:
        runs-on: ubuntu-22.04
        steps:
        - uses: actions/checkout@v3
        - uses: DeterminateSystems/nix-installer-action@main
          with:
            extra-conf: |
              extra-experimental-features = nix-command flakes impure-derivations ca-derivations
        - uses: DeterminateSystems/magic-nix-cache-action@main
        - run: nix flake check
I noticed that setting `experimental-features` in `extra-conf` has no effect, however, setting `extra-experimental-features` does. Is this expected behaviour? Could this be because by default it is set to include flakes? ```yml name: "CI using nix" on: push: branches: - develop - main pull_request: branches: - develop - main jobs: check: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | extra-experimental-features = nix-command flakes impure-derivations ca-derivations - uses: DeterminateSystems/magic-nix-cache-action@main - run: nix flake check ```
FRidh commented 2023-06-27 12:09:51 +00:00 (Migrated from github.com)

Even more interesting. One run with extra-experimental-features succeeded (when I made a PR), and another run (post-merge) running the exact same job failed again with

error: experimental Nix feature 'impure-derivations' is disabled; use '--extra-experimental-features impure-derivations' to override
(use '--show-trace' to show detailed location information)
Error: Process completed with exit code 1.

So it is not just experimental-features but also extra-experimental-features that is not (always) considered.

Even more interesting. One run with `extra-experimental-features` succeeded (when I made a PR), and another run (post-merge) running the exact same job failed again with ```sh error: experimental Nix feature 'impure-derivations' is disabled; use '--extra-experimental-features impure-derivations' to override (use '--show-trace' to show detailed location information) Error: Process completed with exit code 1. ``` So it is not just `experimental-features` but also `extra-experimental-features` that is not (always) considered.
Hoverbear commented 2023-06-27 15:34:51 +00:00 (Migrated from github.com)

Trying to reproduce this, I tested with the binary directly:

ana@ephemeral-ubuntu:~/Downloads$ ./nix-installer install --extra-conf "experimental-features = impure-derivations"
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix install plan (v0.9.2-unreleased)
Planner: linux

Configured settings:
* extra_conf: ["experimental-features = impure-derivations"]

Planned actions:
* Create directory `/nix`
* Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-x86_64-linux.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 30000-30000) and group (GID 30000)
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configure Nix daemon related settings with systemd
* Remove directory `/nix/temp-install-dir`


Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Step: Create directory `/nix`
 INFO Step: Provision Nix
 INFO Step: Create build users (UID 30000-30000) and group (GID 30000)
 INFO Step: Configure Nix
 INFO Step: Configure Nix daemon related settings with systemd
 INFO Step: Remove directory `/nix/temp-install-dir`
Nix was installed successfully!
To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`

ana@ephemeral-ubuntu:~/Downloads$ cat /etc/nix/nix.conf 
# Generated by https://github.com/DeterminateSystems/nix-installer, version 0.9.2-unreleased.
experimental-features = impure-derivations nix-command flakes auto-allocate-uids
build-users-group = nixbld
auto-optimise-store = true
bash-prompt-prefix = (nix:$name)\040
auto-allocate-uids = true
extra-nix-path = nixpkgs=flake:nixpkgs

And using the env:

ana@ephemeral-ubuntu:~/Downloads$ NIX_INSTALLER_EXTRA_CONF="experimental-features = improve-derivations" ./nix-installer install
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix install plan (v0.9.2-unreleased)
Planner: linux

Configured settings:
* extra_conf: ["experimental-features = improve-derivations"]

Planned actions:
* Create directory `/nix`
* Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-x86_64-linux.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 30000-30000) and group (GID 30000)
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configure Nix daemon related settings with systemd
* Remove directory `/nix/temp-install-dir`


Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Step: Create directory `/nix`
 INFO Step: Provision Nix
 INFO Step: Create build users (UID 30000-30000) and group (GID 30000)
 INFO Step: Configure Nix
 INFO Step: Configure Nix daemon related settings with systemd
 INFO Step: Remove directory `/nix/temp-install-dir`
Nix was installed successfully!
To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`

ana@ephemeral-ubuntu:~/Downloads$ cat /etc/nix/nix.conf 
# Generated by https://github.com/DeterminateSystems/nix-installer, version 0.9.2-unreleased.
build-users-group = nixbld
auto-allocate-uids = true
extra-nix-path = nixpkgs=flake:nixpkgs
experimental-features = improve-derivations nix-command flakes auto-allocate-uids
auto-optimise-store = true
bash-prompt-prefix = (nix:$name)\040

Seems to have worked ok.

However testing in the action seems to not:

image
image

This lead me to consider maybe multiline configs are broken?

ana@ephemeral-ubuntu:~/Downloads$ NEWLINE='
        '
ana@ephemeral-ubuntu:~/Downloads$ NIX_INSTALLER_EXTRA_CONF="experimental-features = impure-derivations${NEWLINE}access-tokens = github.com=***${NEWLINE}trusted-users = root runner" ./nix-installer install
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix install plan (v0.9.2-unreleased)
Planner: linux

Configured settings:
* extra_conf: ["experimental-features = impure-derivations\n        access-tokens = github.com=***\n        trusted-users = root runner"]

Planned actions:
* Create directory `/nix`
* Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-x86_64-linux.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 30000-30000) and group (GID 30000)
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configure Nix daemon related settings with systemd
* Remove directory `/nix/temp-install-dir`


Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Step: Create directory `/nix`
 INFO Step: Provision Nix
 INFO Step: Create build users (UID 30000-30000) and group (GID 30000)
 INFO Step: Configure Nix
 INFO Step: Configure Nix daemon related settings with systemd
 INFO Step: Remove directory `/nix/temp-install-dir`
Nix was installed successfully!
To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`

ana@ephemeral-ubuntu:~/Downloads$ cat /etc/nix/nix.conf 
# Generated by https://github.com/DeterminateSystems/nix-installer, version 0.9.2-unreleased.
build-users-group = nixbld
trusted-users = root runner
extra-nix-path = nixpkgs=flake:nixpkgs
auto-allocate-uids = true
bash-prompt-prefix = (nix:$name)\040
access-tokens = github.com=***
auto-optimise-store = true
experimental-features = impure-derivations nix-command flakes auto-allocate-uids

Testing in the action, I noticed while this doesn't work:

extra-conf: |
    experimental-features = impure-derivations

This other option is working ok?

extra-conf: "experimental-features = impure-derivations"

This is also working ok.

extra-conf: |-
  experimental-features = impure-derivations

image

Is this some goofy yaml thing???

Trying to reproduce this, I tested with the binary directly: ``` ana@ephemeral-ubuntu:~/Downloads$ ./nix-installer install --extra-conf "experimental-features = impure-derivations" `nix-installer` needs to run as `root`, attempting to escalate now via `sudo`... Nix install plan (v0.9.2-unreleased) Planner: linux Configured settings: * extra_conf: ["experimental-features = impure-derivations"] Planned actions: * Create directory `/nix` * Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-x86_64-linux.tar.xz` to `/nix/temp-install-dir` * Create a directory tree in `/nix` * Move the downloaded Nix into `/nix` * Create build users (UID 30000-30000) and group (GID 30000) * Setup the default Nix profile * Place the Nix configuration in `/etc/nix/nix.conf` * Configure the shell profiles * Configure Nix daemon related settings with systemd * Remove directory `/nix/temp-install-dir` Proceed? ([Y]es/[n]o/[e]xplain): y INFO Step: Create directory `/nix` INFO Step: Provision Nix INFO Step: Create build users (UID 30000-30000) and group (GID 30000) INFO Step: Configure Nix INFO Step: Configure Nix daemon related settings with systemd INFO Step: Remove directory `/nix/temp-install-dir` Nix was installed successfully! To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh` ana@ephemeral-ubuntu:~/Downloads$ cat /etc/nix/nix.conf # Generated by https://github.com/DeterminateSystems/nix-installer, version 0.9.2-unreleased. experimental-features = impure-derivations nix-command flakes auto-allocate-uids build-users-group = nixbld auto-optimise-store = true bash-prompt-prefix = (nix:$name)\040 auto-allocate-uids = true extra-nix-path = nixpkgs=flake:nixpkgs ``` And using the env: ``` ana@ephemeral-ubuntu:~/Downloads$ NIX_INSTALLER_EXTRA_CONF="experimental-features = improve-derivations" ./nix-installer install `nix-installer` needs to run as `root`, attempting to escalate now via `sudo`... Nix install plan (v0.9.2-unreleased) Planner: linux Configured settings: * extra_conf: ["experimental-features = improve-derivations"] Planned actions: * Create directory `/nix` * Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-x86_64-linux.tar.xz` to `/nix/temp-install-dir` * Create a directory tree in `/nix` * Move the downloaded Nix into `/nix` * Create build users (UID 30000-30000) and group (GID 30000) * Setup the default Nix profile * Place the Nix configuration in `/etc/nix/nix.conf` * Configure the shell profiles * Configure Nix daemon related settings with systemd * Remove directory `/nix/temp-install-dir` Proceed? ([Y]es/[n]o/[e]xplain): y INFO Step: Create directory `/nix` INFO Step: Provision Nix INFO Step: Create build users (UID 30000-30000) and group (GID 30000) INFO Step: Configure Nix INFO Step: Configure Nix daemon related settings with systemd INFO Step: Remove directory `/nix/temp-install-dir` Nix was installed successfully! To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh` ana@ephemeral-ubuntu:~/Downloads$ cat /etc/nix/nix.conf # Generated by https://github.com/DeterminateSystems/nix-installer, version 0.9.2-unreleased. build-users-group = nixbld auto-allocate-uids = true extra-nix-path = nixpkgs=flake:nixpkgs experimental-features = improve-derivations nix-command flakes auto-allocate-uids auto-optimise-store = true bash-prompt-prefix = (nix:$name)\040 ``` Seems to have worked ok. However testing in the action seems to not: ![image](https://github.com/DeterminateSystems/nix-installer-action/assets/130903/b9aa89e8-3838-472c-9623-20b4fedb525f) ![image](https://github.com/DeterminateSystems/nix-installer-action/assets/130903/b955700a-6521-4422-8a98-b7c0ac19cc38) This lead me to consider maybe multiline configs are broken? ``` ana@ephemeral-ubuntu:~/Downloads$ NEWLINE=' ' ana@ephemeral-ubuntu:~/Downloads$ NIX_INSTALLER_EXTRA_CONF="experimental-features = impure-derivations${NEWLINE}access-tokens = github.com=***${NEWLINE}trusted-users = root runner" ./nix-installer install `nix-installer` needs to run as `root`, attempting to escalate now via `sudo`... Nix install plan (v0.9.2-unreleased) Planner: linux Configured settings: * extra_conf: ["experimental-features = impure-derivations\n access-tokens = github.com=***\n trusted-users = root runner"] Planned actions: * Create directory `/nix` * Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-x86_64-linux.tar.xz` to `/nix/temp-install-dir` * Create a directory tree in `/nix` * Move the downloaded Nix into `/nix` * Create build users (UID 30000-30000) and group (GID 30000) * Setup the default Nix profile * Place the Nix configuration in `/etc/nix/nix.conf` * Configure the shell profiles * Configure Nix daemon related settings with systemd * Remove directory `/nix/temp-install-dir` Proceed? ([Y]es/[n]o/[e]xplain): y INFO Step: Create directory `/nix` INFO Step: Provision Nix INFO Step: Create build users (UID 30000-30000) and group (GID 30000) INFO Step: Configure Nix INFO Step: Configure Nix daemon related settings with systemd INFO Step: Remove directory `/nix/temp-install-dir` Nix was installed successfully! To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh` ana@ephemeral-ubuntu:~/Downloads$ cat /etc/nix/nix.conf # Generated by https://github.com/DeterminateSystems/nix-installer, version 0.9.2-unreleased. build-users-group = nixbld trusted-users = root runner extra-nix-path = nixpkgs=flake:nixpkgs auto-allocate-uids = true bash-prompt-prefix = (nix:$name)\040 access-tokens = github.com=*** auto-optimise-store = true experimental-features = impure-derivations nix-command flakes auto-allocate-uids ``` Testing in the action, I noticed while this doesn't work: ``` extra-conf: | experimental-features = impure-derivations ``` This other option is working ok? ``` extra-conf: "experimental-features = impure-derivations" ``` This is also working ok. ``` extra-conf: |- experimental-features = impure-derivations ``` ![image](https://github.com/DeterminateSystems/nix-installer-action/assets/130903/b558a8a6-4ead-4485-8dcc-d23d9cbc9a15) Is this some goofy yaml thing???
Hoverbear commented 2023-06-27 16:53:37 +00:00 (Migrated from github.com)

@cole-h and I confirmed this is fixed on our main branch and we were planning to make a new release, so hopefully this will be fixed with that! Expect by Friday it will be fixed.

(EDIT by @cole-h: The commit that fixed this was 7c9dfacf8e.)

@cole-h and I confirmed this is fixed on our `main` branch and we were planning to make a new release, so hopefully this will be fixed with that! Expect by Friday it will be fixed. (EDIT by @cole-h: The commit that fixed this was https://github.com/DeterminateSystems/nix-installer/commit/7c9dfacf8e9b2021a973240f1a415d36b3e82b1f.)
FRidh commented 2023-06-28 07:22:50 +00:00 (Migrated from github.com)

Is this some goofy yaml thing???

The horror called yaml!

Thank you for looking into this.

> Is this some goofy yaml thing??? The horror called yaml! Thank you for looking into this.
FRidh commented 2023-07-02 15:24:10 +00:00 (Migrated from github.com)

Using the override to 0.10.0 for now.

name: "CI using nix"

on:
    push:
      branches:
        - develop
        - main

    pull_request:
      branches:
        - develop
        - main

jobs:
    check:
        runs-on: ubuntu-22.04
        steps:
        - uses: actions/checkout@v3
        - uses: DeterminateSystems/nix-installer-action@main
          with:
            nix-installer-tag: v0.10.0
            extra-conf: |
              extra-experimental-features = nix-command flakes impure-derivations ca-derivations
        - uses: DeterminateSystems/magic-nix-cache-action@main
        - run: nix flake check
Using the override to 0.10.0 for now. ``` name: "CI using nix" on: push: branches: - develop - main pull_request: branches: - develop - main jobs: check: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: DeterminateSystems/nix-installer-action@main with: nix-installer-tag: v0.10.0 extra-conf: | extra-experimental-features = nix-command flakes impure-derivations ca-derivations - uses: DeterminateSystems/magic-nix-cache-action@main - run: nix flake check ```
FRidh commented 2023-07-02 15:56:55 +00:00 (Migrated from github.com)

That was not sufficient.

That was not sufficient.
Hoverbear commented 2023-07-14 19:39:38 +00:00 (Migrated from github.com)
May be related to https://github.com/DeterminateSystems/nix-installer/issues/562
FRidh commented 2023-07-26 14:17:31 +00:00 (Migrated from github.com)

Changing from extra-conf: | to extra-conf: |- indeed works. I just made this change and that's good enough for me.

Changing from `extra-conf: |` to `extra-conf: |-` indeed works. I just made this change and that's good enough for me.
Hoverbear commented 2023-09-08 15:29:05 +00:00 (Migrated from github.com)

This should be resolved partially by #620

This *should* be resolved partially by #620
FRidh commented 2023-09-08 15:47:43 +00:00 (Migrated from github.com)

For me it can be closed since the yaml change is fine for me.

For me it can be closed since the yaml change is fine for me.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix-install-action#28
No description provided.