devcontainers / devcontainers/features

Nix feature should provide a way to access `flake#devShell`

Abierto
#274 1 comentario 0 reacciones 0 asignados Ver en GitHub
enhancement help wanted
Lenguaje dominante
Shell
Estrellas
1.5k
Forks
621
Merge medio
6 d 53 min
PR fusionados (30 d)
9

Descripción

It is common for repositories which provide flakes to provide development shells under a top-level attribute `flake#devShells`, with `flake#devShell` being the default one (an alias for `flake#devShells."".default`). These are accessed with the command `nix develop flake#myShell`; an excerpt from https://nixos.wiki/wiki/Flakes:

```
# Used by `nix develop .#`
devShells.""."" = derivation;
# Used by `nix develop`
devShells."".default = derivation;
```

However, you can't pass something like `"flakeUri": "github:owner/repo#devShell"` to the Nix feature provided here, because it (rightly) complains that this isn't a derivation (the correct derivation would be `github:owner/repo#devShell.x86_64-linux`). Fundamentally, this is because the implementation uses `nix profile install`, which searches for derivations under the `flake#packages` top-level attribute:

https://github.com/devcontainers/features/blob/f7f05f76fabda70f4fbcaefd55e6fe6fd09a8145/src/nix/post-install-steps.sh#L11-L15

Ideally, somewhere in this feature a call should be made to `nix develop` to enable access to the development shells provided by a flake, rather than having to use the workaround of `flake#devShell.x86_64-linux`.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con src/nix/post-install-steps.sh en la llamada referenciada de instalación de un perfil de nix y, a continuación, revisa cómo la funcionalidad de Nix recibe y gestiona los valores de flakeUri. Comprueba el comportamiento de nix develop para flake#devShell y compáralo con la ruta actual de instalación de paquetes. Se considera terminado cuando la funcionalidad puede acceder al shell de desarrollo predeterminado de un flake sin requerir un sufijo de sistema explícito.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
shell
Área
devops
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.