Skip to content

Nix Installer Fails on OStree Based Systems #2760

@DePingus

Description

@DePingus

What happened?

I installed Devbox using the main install script and default options. Then I created an empty project with devbox init, and when I tried to add a package with devbox add platformio, it asked me to install Nix. I let it do its thing. But the Nix install failed.

user@mycomputer ~/repos/user/test $ devbox add platformio

Nix is not installed. Devbox will attempt to install it.

Press enter to continue or ctrl-c to exit.

 INFO nix-installer v3.15.1
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
[sudo] password for user: 
 INFO nix-installer v3.15.1
 INFO Step: Create directory `/nix`
ERROR Error saving receipt: RecordingReceipt("/nix", Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" })
Error: 
   0: Install failure
   1: Error executing action
   2: Action `create_directory` errored
   3: Creating directory `/nix`
   4: Read-only file system (os error 30)

Location:
   /build/nix-installer-source/src/cli/subcommand/install/mod.rs:303

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Consider reporting this error using this URL: https://github.com/DeterminateSystems/nix-installer/issues/new?title=%3Cautogenerated-issue%3E&body=%23%23+Error%0A%60%60%60%0AError%3A+%0A+++0%3A+Install+failure%0A+++1%3A+Error+executing+action%0A+++2%3A+Action+%60create_directory%60+errored%0A+++3%3A+Creating+directory+%60%2Fnix%60%0A+++4%3A+Read-only+file+system+%28os+error+30%29%0A%60%60%60%0A%0A%23%23+Metadata%0A%7Ckey%7Cvalue%7C%0A%7C--%7C--%7C%0A%7C**version**%7C3.15.1%7C%0A%7C**os**%7Clinux%7C%0A%7C**arch**%7Cx86_64%7C%0A
Error: run installer: exit status 1

This seems to be a problem with the Determinate Systems Nix Installer and ostree based systems like Fedora Silverblue, Kinoite, Bazzite, etc. Here is an open issue about it. DeterminateSystems/nix-installer#1682 Its been open for a few months now. Maybe y'all can poke someone over at Determinate Systems.

Steps to reproduce

  1. Use an ostree based os (Silverblue, Kinoite, Bazzite, etc)
  2. Install Devbox
  3. Have it try to install Nix

Command

add

devbox.json

{
    "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
    "packages": [],
    "shell": {
      "init_hook": [
        "echo 'Welcome to devbox!' > /dev/null"
      ],
      "scripts": {
        "test": [
          "echo \"Error: no test specified\" && exit 1"
        ]
      }
    }
  }

Devbox version

0.16.0

Nix version

na

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions