-
Notifications
You must be signed in to change notification settings - Fork 16
/
flake.nix
48 lines (44 loc) · 1.25 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
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.4.5";
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;
};
ci = import ./ci (inputs // {
inherit pkgs;
});
}) // {
darwinModules = {
nix-homebrew = { lib, ... }: {
imports = [
./modules
];
nix-homebrew.package = lib.mkOptionDefault (brew-src // {
name = "brew-${brewVersion}";
version = brewVersion;
});
};
};
};
}