Skip to content

Possible to import a default.nix generated by {rix} in a devenv project? #511

@rpodcast

Description

@rpodcast

During the excellent R/Medicine 2025 workshop (recording available on YouTube), I caught glimpses of @b-rodrigues combining a sample project created with devenv and I believe {rix}. While most of the time I can easily get by with using {rix} to generate the Nix configuration, in certain esoteric situations I need to have a more complex Nix configuration that involves other system libraries (especially those around NodeJS) and it'd be terrific to let devenv manage those "outside of R or Python" system dependencies while {rix} handles my R package config. Is there a simple hello-world style of example that combines devenv and a Nix config generated by {rix}, or am I missing a better way?

Naively I tried bootstrapping a clean environment with devenv, then in that environment creating a new default.nix using {rix} in a temp nix-shell environment, exiting that temp shell and modifying devenv.yaml to import the default.nix but that resulted in numerous Nix syntax errors so that was clearly a no-go!

# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
  nixpkgs:
    url: github:cachix/devenv-nixpkgs/rolling

# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true

# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
#  - "openssl-1.1.1w"

# If you have more than one devenv you can merge them
imports:
 - ./default.nix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions