-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
107 lines (95 loc) · 3.18 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
description = "Darwin configuration";
inputs = {
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1";
nixpkgs.url = "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1.704822.tar.gz";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "https://flakehub.com/f/nix-community/home-manager/0.2405.*";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
nix-homebrew.inputs.nixpkgs.follows = "nixpkgs";
# Formatter
alejandra.url = "github:kamadorueda/alejandra/3.1.0";
alejandra.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
determinate,
nix-darwin,
home-manager,
nix-homebrew,
alejandra,
nixpkgs-stable,
...
}: let
system = "aarch64-darwin";
specialArgs = {
inherit self system;
pkgs-stable = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
};
in {
formatter.aarch64-darwin = alejandra;
darwinConfigurations.raikusy = nix-darwin.lib.darwinSystem {
inherit system specialArgs;
modules = [
determinate.darwinModules.default
home-manager.darwinModules.home-manager
nix-homebrew.darwinModules.nix-homebrew
./configuration.nix
{
_module.args = {
inherit self;
};
# System-wide overlays
nixpkgs.overlays = [
# Add ARM-specific optimizations
(final: prev: {
# Example: Override packages with ARM-optimized versions
stdenv =
prev.stdenv
// {
isAarch64 = true;
isDarwin = true;
};
})
];
}
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = true;
# User owning the Homebrew prefix
user = "raikusy";
# Automatically migrate existing Homebrew installations
autoMigrate = true;
# Optional: Declarative tap management
# taps = {
# "homebrew/homebrew-core" = homebrew-core;
# "homebrew/homebrew-cask" = homebrew-cask;
# "homebrew/homebrew-bundle" = homebrew-bundle;
# };
# Optional: Enable fully-declarative tap management
#
# With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`.
# mutableTaps = false;
};
}
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.raikusy = import ./home.nix;
home-manager.backupFileExtension = "backup";
}
];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."raikusy".pkgs;
};
}