Skip to content

minimal install cd.iso can't be built with nixpkgs.config.contentAddressedByDefault = true; #261512

@trofi

Description

@trofi

Describe the bug

Ideally install .iso should be buildable against ca-derivations via nixpkgs.config.contentAddressedByDefault = true;. This fails today as:

  error: A definition for option `system.extraDependencies."[definition 1-entry 1]"' is not of type `path in the Nix store'. Definition values:
       - In `/nix/store/m90lvfa50gc7s1ysa9zzx2drdm10pmyc-source/nixos/modules/profiles/installation-device.nix': <derivation stdenv-linux>

Steps To Reproduce

Executable reproducer:

  1. Create iso.nix with the following contents:
# iso.nix
{ config, pkgs, ... }:
{
  imports = [
    <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
  ];
  # This breaks the build:
  nixpkgs.config.contentAddressedByDefault = true;
}
  1. Try to build an .iso:
$ nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=iso.nix

       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nixos-23.11pre-git-x86_64-linux.iso'
         whose name attribute is located at /nix/store/m90lvfa50gc7s1ysa9zzx2drdm10pmyc-source/pkgs/stdenv/generic/make-derivation.nix:300:7

       … while evaluating attribute 'sources' of derivation 'nixos-23.11pre-git-x86_64-linux.iso'

         at /nix/store/m90lvfa50gc7s1ysa9zzx2drdm10pmyc-source/nixos/lib/make-iso9660-image.nix:57:3:

           56|
           57|   sources = map (x: x.source) contents;
             |   ^
           58|   targets = map (x: x.target) contents;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: A definition for option `system.extraDependencies."[definition 1-entry 1]"' is not of type `path in the Nix store'. Definition values:
       - In `/nix/store/m90lvfa50gc7s1ysa9zzx2drdm10pmyc-source/nixos/modules/profiles/installation-device.nix': <derivation stdenv-linux>

Expected behavior

.iso should build successfully.

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"

 - system: `"x86_64-linux"`
 - host os: `Linux 6.5.7, NixOS, 23.11 (Tapir), 23.11.20231016.17c847f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `""`
 - channels(slyfox): `""`
 - nixpkgs: `/run/current-system/sw/share/nixos-flakes/inputs/nixpkgs`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions