LnL7 / nix-darwin

nix modules for darwin
MIT License
3.19k stars 457 forks source link

Encountering an mdDoc related error when updating nix-darwin via flake #933

Closed yoav-lavi closed 7 months ago

yoav-lavi commented 7 months ago
error:
       … while calling the 'derivationStrict' builtin

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

       … while evaluating derivation 'darwin-system-24.05.20240414.2748d22+darwin4.36524ad'
         whose name attribute is located at /nix/store/qjgi80svyhfcwbnlvzzaqg0nyr7h2w59-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'activationScript' of derivation 'darwin-system-24.05.20240414.2748d22+darwin4.36524ad'

         at /nix/store/87clbsxcf2wawlhi49k96ffb805sa3v0-source/modules/system/default.nix:95:7:

           94|
           95|       activationScript = cfg.activationScripts.script.text;
             |       ^
           96|       activationUserScript = cfg.activationScripts.userScript.text;

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

       error: attribute 'mdDoc' missing

       at /nix/store/87clbsxcf2wawlhi49k96ffb805sa3v0-source/modules/documentation/default.nix:121:21:

          120|       default = true;
          121|       description = lib.mdDoc ''
             |                     ^
          122|         Whether to install documentation distributed in packages' `/share/doc`.
purcell commented 7 months ago

I see that in home-manager there has been at least one recent change removing references to lib.mdDoc, following up on bulk changes last July. Now lib.mdDoc has been removed from upstream Nixpkgs entirely: https://github.com/NixOS/nixpkgs/pull/303841

So the fix here should be to remove the lib.mdDoc falls, which should already be redundant. I'll make a quick PR.

purcell commented 7 months ago

Ah, in fact there's already #932.

yonkeltron commented 7 months ago

Can confirm this issue when trying to install on an M1 MacBook Pro running macOS Sonoma 14.4.1 (23E224). Happy to help test any fixes!

purcell commented 7 months ago

You can update your flake source to point the URL for darwin at "github:wegank/nix-darwin/mddoc-remove" — I've done this myself and #932 indeed solves the problem for me.

yonkeltron commented 7 months ago

You can update your flake source to point the URL for darwin at "github:wegank/nix-darwin/mddoc-remove" — I've done this myself and #932 indeed solves the problem for me.

Fantastic, testing it now on the clean install using the flake method. Feedback forthcoming. Please stand by!

yonkeltron commented 7 months ago

This works great, I have run a couple of little tests locally and everything seems perfecto. Thanks a ton for the effort!

NINJA EDIT: Although I notice that pkg-config seems to be broken at first glance. Not sure if related at all or if I am overlooking something silly. LMK and I'll file a separate issue if need be.

Thanks again!

Love, +Jonathan

purcell commented 7 months ago

Thanks a ton for the effort! ... Although I notice that pkg-config seems to be broken at first glance.

I'm not the author of PR #932, so I'd suggest leaving any feedback there. 😁

wegank commented 7 months ago

The lib.mdDoc removal has been deferred to 24.11 in nixpkgs (NixOS/nixpkgs#304277), so the PR is likely unneeded for now.

rkitover commented 7 months ago

Unstable channel still broken.

wegank commented 7 months ago

The commit hasn't landed on unstable yet: https://nixpk.gs/pr-tracker.html?pr=304277

triarius commented 7 months ago

The lib.mdDoc removal has been deferred to 24.11 in nixpkgs (NixOS/nixpkgs#304277), so the PR is likely unneeded for now.

Well it will spam

trace: warning: lib.mdDoc will be removed from nixpkgs in 24.11. Option descriptions are now in Markdown by default; you can remove any remaining uses of lib.mdDoc.

whenever darwin-rebuild is run, so I still think it's useful to merge https://github.com/LnL7/nix-darwin/pull/932.

yonkeltron commented 7 months ago

This appears to be fixed by https://github.com/LnL7/nix-darwin/pull/932 on my macOS device.

Enzime commented 7 months ago

Should be fixed by #932