...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
lazyjournal
You have 3 outdated formulae installed.
Usage: brew bundle [subcommand]
Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store,
Whalebrew and Visual Studio Code.
...
... (information about brew bundle command)
...
Error: invalid option: --no-lock
I believe autoupdate/autoupgrade with nix-homebrew is running --no-lock internally somewhere and that’s probably causing this? I’m not sure though, and have no idea how to debug this. Any help would be appreciated. I’m running rebuild after like a month or so.
Looks similar to
opened 10:06AM - 05 Mar 25 UTC
I have a macOS 15.3.1 (Sequioia) machine. I've installed Nix using the Determina… te Systems NIx installer (**not** the Determinate distro, but vanilla Nix) and installed nix-darwin per the nix-darwin README.
I then edited `/etc/nix-darwin/flake.nix`, to add a Homebrew section:
```
victorhooi@MacBook-Pro:/etc/nix-darwin/ > cat flake.nix
{
description = "Example nix-darwin system flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin/master";
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 =
[ pkgs.vim
];
homebrew = {
enable = true;
# onActivation.cleanup = "uninstall";
taps = [];
brews = [ "cowsay" ];
casks = [];
};
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Enable alternative shell support in nix-darwin.
# programs.fish.enable = 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 = 6;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#MacBook-Pro
darwinConfigurations."MacBook-Pro" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
};
};
}
```
After running `darwin-rebuild switch`, I get an error from Homebrew about `Error: invalid option: --no-lock`:
```
victorhooi@MacBook-Pro:/etc/nix-darwin/ > darwin-rebuild switch
building the system configuration...
Password:
setting up user launchd services...
Homebrew bundle...
Usage: brew bundle [subcommand]
Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store,
Whalebrew and Visual Studio Code.
brew bundle [install]:
Install and upgrade (by default) all dependencies from the Brewfile.
You can specify the Brewfile location using --file or by setting the
$HOMEBREW_BUNDLE_FILE environment variable.
You can skip the installation of dependencies by adding space-separated values
to one or more of the following environment variables:
$HOMEBREW_BUNDLE_BREW_SKIP, $HOMEBREW_BUNDLE_CASK_SKIP,
$HOMEBREW_BUNDLE_MAS_SKIP, $HOMEBREW_BUNDLE_WHALEBREW_SKIP,
$HOMEBREW_BUNDLE_TAP_SKIP.
brew bundle upgrade:
Shorthand for brew bundle install --upgrade.
brew bundle dump:
Write all installed casks/formulae/images/taps into a Brewfile in the
current directory.
brew bundle cleanup:
Uninstall all dependencies not present in the Brewfile.
This workflow is useful for maintainers or testers who regularly install lots of
formulae.
Unless --force is passed, this returns a 1 exit code if anything would be
removed.
brew bundle check:
Check if all dependencies present in the Brewfile are installed.
This provides a successful exit code if everything is up-to-date, making it
useful for scripting.
brew bundle list:
List all dependencies present in the Brewfile.
By default, only Homebrew formula dependencies are listed.
brew bundle edit:
Edit the Brewfile in your editor.
brew bundle exec command:
Run an external command in an isolated build environment based on the
Brewfile dependencies.
This sanitized build environment ignores unrequested dependencies, which makes
sure that things you didn't specify in your Brewfile won't get picked up by
commands like bundle install, npm install, etc. It will also add compiler
flags which will help with finding keg-only dependencies like openssl,
icu4c, etc.
brew bundle sh:
Run your shell in a brew bundle exec environment.
brew bundle env:
Print the environment variables that would be set in a brew bundle exec
environment.
--file Read the Brewfile from this location. Use
--file=- to pipe to stdin/stdout.
--global Read the Brewfile from
$HOMEBREW_BUNDLE_FILE_GLOBAL (if set),
${XDG_CONFIG_HOME}/homebrew/Brewfile (if
$XDG_CONFIG_HOME is set),
~/.homebrew/Brewfile or ~/.Brewfile
otherwise.
-v, --verbose install prints output from commands as they
are run. check lists all missing
dependencies.
--no-upgrade install does not run brew upgrade on
outdated dependencies. check does not check
for outdated dependencies. Note they may
still be upgraded by brew install if
needed. This is enabled by default if
$HOMEBREW_BUNDLE_NO_UPGRADE is set.
--upgrade install runs brew upgrade on outdated
dependencies, even if
$HOMEBREW_BUNDLE_NO_UPGRADE is set.
--install Run install before continuing to other
operations e.g. exec.
-f, --force install runs with --force/--overwrite.
dump overwrites an existing Brewfile.
cleanup actually performs its cleanup
operations.
--cleanup install performs cleanup operation, same as
running cleanup --force. This is enabled by
default if $HOMEBREW_BUNDLE_INSTALL_CLEANUP
is set and --global is passed.
--all list all dependencies.
--formula, --brews list or dump Homebrew formula
dependencies.
--cask, --casks list or dump Homebrew cask dependencies.
--tap, --taps list or dump Homebrew tap dependencies.
--mas list or dump Mac App Store dependencies.
--whalebrew list or dump Whalebrew dependencies.
--vscode list or dump VSCode extensions.
--no-vscode dump without VSCode extensions. This is
enabled by default if
$HOMEBREW_BUNDLE_DUMP_NO_VSCODE is set.
--describe dump adds a description comment above each
line, unless the dependency does not have a
description. This is enabled by default if
$HOMEBREW_BUNDLE_DUMP_DESCRIBE is set.
--no-restart dump does not add restart_service to
formula lines.
--zap cleanup casks using the zap command
instead of uninstall.
-d, --debug Display any debugging information.
-q, --quiet Make some output more quiet.
-h, --help Show this message.
Error: invalid option: --no-lock
```
And it seems like updating nix-darwin
by running nix flake update
fixes the issue.
Thank you so much! Didn’t find that github thread when I searched for it.
1 Like