-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
204 lines (181 loc) · 5.63 KB
/
flake.nix
File metadata and controls
204 lines (181 loc) · 5.63 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{
description = "Bryan's NixOS and macOS Configuration";
inputs = {
# Standard NixOS unstable branch
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
localpkgs = {
url = "github:bzvestey/dotfiles?dir=packages";
inputs.nixpkgs.follows = "nixpkgs";
};
# Darwin specific inputs ###############################
# nix-darwin packages
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
# Homebrew management via nix-darwin
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
# Homebrew: Declarative tap management
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
nixpkgs-darwin,
home-manager,
agenix,
localpkgs,
# Darwin
nix-darwin,
nix-homebrew,
homebrew-core,
homebrew-cask,
...
}@inputs:
let
linuxSystem = "x86_64-linux";
darwinSystem = "aarch64-darwin";
# Common home manager configuration
homeManagerUser = "bzvestey";
homeManagerConfig = import ./modules/home/home.nix;
in
{
# NixOS Configurations (Linux)
nixosConfigurations.framework16nix = nixpkgs.lib.nixosSystem {
system = linuxSystem;
specialArgs = { inherit inputs self; };
modules = [
{ nixpkgs.overlays = [ localpkgs.overlays.default ]; }
./hosts/framework16nix/default.nix
# Agenix
agenix.nixosModules.default
# Import the Home Manager NixOS module
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.${homeManagerUser} = homeManagerConfig;
}
];
};
nixosConfigurations.framework13nix = nixpkgs.lib.nixosSystem {
system = linuxSystem;
specialArgs = { inherit inputs; };
modules = [
{ nixpkgs.overlays = [ localpkgs.overlays.default ]; }
./hosts/framework13nix/default.nix
agenix.nixosModules.default
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${homeManagerUser} = homeManagerConfig;
home-manager.extraSpecialArgs = { inherit inputs; };
}
];
};
# nix-darwin Configurations (macOS)
darwinConfigurations.minastas-ai-mini = nix-darwin.lib.darwinSystem {
system = darwinSystem;
specialArgs = { inherit inputs self; };
modules = [
{
nixpkgs.overlays = [
localpkgs.overlays.default
nix-darwin.overlays.default
];
}
./hosts/darwin-minastas-ai-mini/default.nix
agenix.nixosModules.default
nix-homebrew.darwinModules.nix-homebrew
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.${homeManagerUser} = homeManagerConfig;
home-manager.extraSpecialArgs = { inherit inputs; };
}
];
};
# Expose the darwin configuration for standalone use
darwinPackages.${darwinSystem} = self.darwinConfigurations.minastas-ai-mini.pkgs;
# Formatters
formatter.${linuxSystem} = nixpkgs.legacyPackages.${linuxSystem}.nixfmt;
formatter.${darwinSystem} = nixpkgs-darwin.legacyPackages.${darwinSystem}.nixfmt;
# Development Shells
devShells.${linuxSystem}.default =
let
pkgs = import nixpkgs {
system = linuxSystem;
config.allowUnfree = true;
};
in
pkgs.mkShell {
buildInputs = with pkgs; [
# Nix tools
nil
nixfmt
statix
deadnix
agenix.packages.${linuxSystem}.default
# Development tools
zellij
# AI tools
opencode
claude-code
gemini-cli
];
shellHook = ''
echo "Welcome to your Nix development environment!"
# zellij -l ./development.kdl
'';
};
devShells.${darwinSystem}.default =
let
pkgs = import nixpkgs-darwin {
system = darwinSystem;
config.allowUnfree = true;
};
in
pkgs.mkShell {
buildInputs = with pkgs; [
# Nix tools
nil
nixfmt
statix
deadnix
# Development tools
zellij
# AI tools
opencode
claude-code
];
shellHook = ''
echo "Welcome to your macOS Nix development environment!"
# zellij -l ./development.kdl
'';
};
};
}