Skip to content

Nix feature should support "flakeUri": "../flake.nix" to local file instead of remote Nix URI #1518

@vorburger

Description

@vorburger

https://github.com/devcontainers/features/tree/main/src/nix#location-of-flakes :

Currently flakeUri works best with a remote URI (e.g., github:nixos/nixpkgs/nixpkgs-unstable#hello) as local files need to be in the image.

makes the Nix feature of fairly limited use for dev containers in Nix package style repos which contain a flake.nix (e.g. like this one; for [my] enola-dev/enola#1921).

I've tried both "flakeUri": "../flake.nix" and "flakeUri": "flake.nix" but they both fail with error: getting status of '/tmp/dev-container-features/flake.nix': No such file or directory, because the base URL is wrong.

Given that https://github.com/devcontainers/features/tree/main/src/nix#location-of-flakes also says:

Proposed support for lifecycle hooks in Features (devcontainers/spec#60) would allow for expressions files or Flakes to exist in the source tree to be automatically installed on initial container startup

and seeing that devcontainers/spec#60 is now implemented, perhaps support for this could now be added?

@Chuxel

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