-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathflake.nix
53 lines (45 loc) · 1.29 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
49
50
51
52
53
{
description = "Homebrew installation manager for nix-darwin";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
brew-src = {
url = "github:Homebrew/brew/4.4.5";
flake = false;
};
};
outputs = { self, nixpkgs, nix-darwin, 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;
forAllSystems =
function:
nixpkgs.lib.genAttrs supportedSystems (
system: function nixpkgs.legacyPackages.${system}
);
in {
packages = forAllSystems (pkgs: pkgs.callPackage ./pkgs {
inherit inputs;
});
devShell = forAllSystems (pkgs: pkgs.mkShell {
nativeBuildInputs = with pkgs; [
];
BREW_SRC = brew-src;
});
ci = forAllSystems (pkgs: import ./ci (inputs // {
inherit pkgs;
}));
darwinModules = {
nix-homebrew = { lib, ... }: {
imports = [
./modules
];
nix-homebrew.package = lib.mkOptionDefault (brew-src // {
name = "brew-${brewVersion}";
version = brewVersion;
});
};
};
};
}