NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.06k stars 14.12k forks source link

`virtualisation.containers` uses outdated configuration format #280288

Open mhutter opened 10 months ago

mhutter commented 10 months ago

Describe the bug

The virtualisation.containers module; specifically the registries bits generate the deprecated Version 1 Format of /etc/containers/registries.conf: https://github.com/containers/image/blob/f87d1edcbc2555ee59ac3ebf3f61feddba22b457/docs/containers-registries.conf.5.md

Steps To Reproduce

-

Expected behavior

Screenshots

-

Additional context

This poses a problem since v1 only allows a subset of the configuration options v2 does; specifically the configuration of registry mirrors is not possible with this approach.

Notify maintainers

(via teams/podman) @saschagrunert @vdemeester

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.71, NixOS, 24.05 (Uakari), 24.05.20240109.4b0751b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

mhutter commented 10 months ago

I'd be willing to provide a PR that fixes/improves this.

I see 2 possible solution approaches:

  1. Implement registriesConf.settings, convert the existing options into the structure needed, and merge everything together
  2. Implement registries.<prefix>.* with options that map to configuration parameters available (insecure, blocked, location, ...)
saschagrunert commented 9 months ago

@mhutter thank you for considering to work on this! I'd say we convert the existing options.