I’m trying to rebuild my nix-darwin packages on an M1 MacBook pro, and that fails. In the meantime I haven’t changed anything, so I consider my flake unlikely as a potential cause of this.
Here’s the set of shell commands I use to update:
cd ~/nix-darwin-config
nix flake update
darwin-rebuild switch --flake .
# For now I omit garbage collection, as that seems to delete the derivations referred to in the error:
# DURATION=60d
# nix-collect-garbage --delete-older-than $DURATION
For completeness, here’s my flake:
{
description = "Example Darwin system flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nix-darwin, nixpkgs }:
let
configuration = { pkgs, ... }: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
aspell
bandwhich # Bandwidth monitor
bat
bottom # replacement for top
broot # file navigation tool
cargo-audit
cargo-bloat
cargo-edit
cargo-expand # Rust macro expansion utility
cargo-outdated # Find outdated Rust crate dependencies
cargo-make # build tool on top of cargo
cargo-msrv # Find the Minimum Supported Rust Version for a crate
cargo-ndk # Android build support for Rust
cargo-watch # Execute commands when Rust project files change
cargo-workspaces
diesel-cli
dua
dust
emacs
eza # nicer replacement for ls
fd
ffmpeg # TODO: broken on MacOS, at least for now
git
graphviz
htop
hyperfine
lldb
mplayer
nerdfonts
nodejs_21
nushell # A newfangled, more FP-oriented shell
powerline-fonts
resvg
ripgrep
rustup
tokei
vim
wasm-pack # A tool to make WASM & Rust play nicely
wezterm
wget
youtube-dl
yt-dlp
zellij
];
system.defaults = {
dock.autohide = true;
dock.mru-spaces = false;
dock.show-recents = false; # Don't show recent applications in the Dock
finder.AppleShowAllExtensions = true;
finder.FXPreferredViewStyle = "Nlsv";
finder.ShowPathbar = true;
finder.ShowStatusBar = true;
screencapture.location = "~/Screenshots";
screensaver.askForPasswordDelay = 1; # Require a password in the screensaver after 1 second
# universalaccess.reduceTransparency = true;
};
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# nix.package = pkgs.nix;
# Cross-compile GNU/Linux binaries, or even full GNU/Linux system images
nix.linux-builder.enable = true;
nix.settings.trusted-users = ["j"];
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina
# programs.fish.enable = true;
# Enable sudo authentication using fingerprint biometrics
security.pam.enableSudoTouchIdAuth = true;
# Set Git commit hash for darwin-version.
system.configurationRevision = self.rev or self.dirtyRev or null;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#simple
darwinConfigurations."cassio" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."cassio".pkgs;
};
}
The error I get looks like this:
j@Cassio> ~/bin/update-nix-darwin.sh ~
building the system configuration...
error:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'darwin-system-24.05.20240415.2b80ce7+darwin4.36524ad'
whose name attribute is located at /nix/store/z5q9bd70zix9j2gib5ijy31y4w0cw25l-source/pkgs/stdenv/generic/make-derivation.nix:331:7
… while evaluating attribute 'activationScript' of derivation 'darwin-system-24.05.20240415.2b80ce7+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`.
It seems to be that the lib
input passed to the darwin-system-24.05.20240415.2b80ce7+darwin4.36524ad
derivation is missing mdDoc
?
Can anybody help me out and tell me what exactly is broken here, and how to fix it? I’d of course like it fixed, but I’d also like to understand what is going wrong here.
Documentation on this kind of thing seems to be rather sparse.