-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
183 lines (183 loc) · 5.79 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
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
{
description = "nix config";
inputs = {
# Nixpkgs
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
# Home manager
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Nix-Darwin
nix-darwin.url = "github:LnL7/nix-darwin/nix-darwin-24.11";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
# Secret encryption
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
# Hardware
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Impermanance
impermanence.url = "github:nix-community/impermanence";
# Disko
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
# nix index for comma
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
# nixos generators
nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
# devenv
devenv.url = "github:cachix/devenv";
# flake.parts
flake-parts.url = "github:hercules-ci/flake-parts";
# microvms
microvm.url = "github:astro/microvm.nix";
microvm.inputs.nixpkgs.follows = "nixpkgs";
# nixos on wsl
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
# lix
lix.url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz";
lix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
home-manager,
nix-darwin,
nixos-generators,
flake-parts,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
# systems for which you want to build the `perSystem` attributes
"x86_64-linux"
"aarch64-darwin"
];
imports = [ inputs.devenv.flakeModule ];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
# flake's own devenv
devenv.shells.default = {
imports = [ ./Utilities/devenv/default.nix ];
};
};
# non-flake.parts outputs
flake = {
overlays = import ./modules/overlays { inherit inputs; };
### Host outputs
# NixOS configuration entrypoint
# Available through 'nixos-rebuild switch --flake .#your-hostname'
nixosConfigurations = {
blue = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/blue ];
};
azure = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/azure ];
};
# carob = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# specialArgs = {
# inherit inputs;
# };
# modules = [ ./hosts/carob ];
# };
teal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/teal ];
};
smalt = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/smalt ];
};
green = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/green ];
};
pearl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/pearl ];
};
wsl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/wsl ];
};
};
# Nix-darwin configuration entrypoint
# Available through 'darwin-rebuild switch --flake .#your-hostname'
darwinConfigurations = {
midnight = nix-darwin.lib.darwinSystem {
specialArgs = {
inherit inputs;
};
system = "aarch64-darwin";
modules = [ ./hosts/midnight ];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"carln@hostname" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {
inherit inputs;
};
modules = [ ./users/carln/homeManager ];
};
};
# Nixos-generators configuration entrypoints
# Available through 'nix build .#your-hostname'
packages.x86_64-linux = {
#### requires --impure, breaks `nix flake check`
# install-iso = nixos-generators.nixosGenerate {
# system = "x86_64-linux";
# format = "install-iso";
# specialArgs = { inherit inputs; };
# modules = [ ./hosts/install-iso ];
# };
};
### Module outputs
nixosModules = {
yomaq = import ./modules/hosts/nixos.nix;
# custom container modules
pods = import ./modules/containers;
};
darwinModules = {
yomaq = import ./modules/hosts/darwin.nix;
};
homeManagerModules = {
yomaq = import ./modules/home-manager;
};
};
};
}