Files
nix-homebrew/flake.nix
T
Zhaofeng Li 445f7989e0 Patch Homebrew to embed version number
homebrew-bundle now depends on $HOMEBREW_VERSION, which is set by
`brew.sh` using the output of `git describe`. We don't have a git
repo, so let's embed the version directly.

Fixes #19.
2024-04-03 16:19:39 -06:00

49 lines
1.3 KiB
Nix

{
description = "Homebrew installation manager for nix-darwin";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
flake-utils.url = "github:numtide/flake-utils";
brew-src = {
url = "github:Homebrew/brew/4.2.16";
flake = false;
};
};
outputs = { self, nixpkgs, nix-darwin, flake-utils, brew-src, ... } @ inputs: let
# System types to support.
supportedSystems = [ "x86_64-darwin" "aarch64-darwin" ];
flakeLock = builtins.fromJSON (builtins.readFile ./flake.lock);
brewVersion = flakeLock.nodes.brew-src.original.ref;
in flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
packages = pkgs.callPackage ./pkgs {
inherit inputs;
};
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
];
BREW_SRC = brew-src;
};
}) // {
darwinModules = {
nix-homebrew = { lib, ... }: {
imports = [
./modules
];
nix-homebrew.package = lib.mkOptionDefault (brew-src // {
name = "brew-${brewVersion}";
version = brewVersion;
});
};
};
darwinConfigurations = {
ci = import ./ci inputs;
};
};
}