-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
214 lines (181 loc) · 5.31 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
{
description = "SoxinCFG by Wael";
inputs = {
deploy-rs.url = "github:serokell/deploy-rs";
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus/v1.5.1";
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
darwin = {
url = "github:LnL7/nix-darwin";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
nixvim = {
url = "github:kalbasit/nixvim";
# NOTE: nixvim fails to build on NixOS 24.11
# inputs. nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:cachix/pre-commit-hooks.nix";
};
secret-flake-work = {
url = "flake:secret-flake-work";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
soxin = {
url = "github:SoxinOS/soxin";
inputs = {
darwin.follows = "darwin";
deploy-rs.follows = "deploy-rs";
flake-utils-plus.follows = "flake-utils-plus";
home-manager.follows = "home-manager";
nixpkgs-unstable.follows = "nixpkgs-unstable";
nixpkgs.follows = "nixpkgs";
nur.follows = "nur";
sops-nix.follows = "sops-nix";
};
};
};
outputs =
inputs@{
flake-utils-plus,
nixos-hardware,
nixpkgs,
pre-commit-hooks,
self,
sops-nix,
soxin,
...
}:
let
# Enable deploy-rs support
withDeploy = true;
# Enable sops support
withSops = true;
inherit (nixpkgs) lib;
inherit (lib) optionalAttrs recursiveUpdate singleton;
inherit (flake-utils-plus.lib) flattenTree;
# Channel definitions. `channels.<name>.{input,overlaysBuilder,config,patches}`
channels = {
nixpkgs = {
# Channel specific overlays
overlaysBuilder = channels: [
(_: super: {
inherit (channels.nixpkgs-unstable)
# inherit packages from unstable.
debootstrap
devbox
protonvpn-gui
;
})
];
# Channel specific configuration. Overwrites `channelsConfig` argument
config = {
permittedInsecurePackages = [ ];
};
# Yep, you see it first folks - you can patch nixpkgs!
patches = [ ];
};
};
# Default configuration values for `channels.<name>.config = {...}`
channelsConfig = {
# allowBroken = true;
allowUnfree = true;
# allowUnsupportedSystem = true;
permittedInsecurePackages = [ ];
};
nixosModules = (import ./modules) // {
soxin = import ./mysoxin/soxin.nix; # TODO: Get rid of this!
soxincfg = import ./modules/soxincfg.nix;
profiles = import ./profiles;
};
nixosModule = nixosModules.soxincfg;
in
soxin.lib.mkFlake {
inherit
channels
channelsConfig
inputs
withDeploy
withSops
nixosModules
nixosModule
;
# add Soxin's main module to all builders
extraGlobalModules = [
nixosModule
nixosModules.profiles.core
# import mysoxin
# TODO: Get rid of this!
nixosModules.soxin
];
# Supported systems, used for packages, apps, devShell and multiple other definitions. Defaults to `flake-utils.lib.defaultSystems`
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
outputsBuilder =
channels:
let
pkgs = channels.nixpkgs;
pre-commit-check = pre-commit-hooks.lib.${pkgs.hostPlatform.system}.run {
src = ./.;
hooks = {
# TODO: Fix all errors and enable statix
# statix.enable = true;
nixfmt-rfc-style.enable = true;
};
};
in
{
checks = {
inherit pre-commit-check;
};
devShell =
with pkgs;
mkShell {
inherit (pre-commit-check) shellHook;
buildInputs = [
nixfmt-rfc-style
nix-output-monitor
];
};
formatter = pkgs.nixfmt-rfc-style;
};
# pull in all hosts
hosts = import ./hosts inputs;
# create all home-managers
home-managers = import ./home-managers inputs;
# Evaluates to `packages.<system>.<pname> = <unstable-channel-reference>.<pname>`.
packagesBuilder = channels: flattenTree (import ./pkgs channels);
# declare the vars
vars = import ./vars inputs;
# include all overlays
overlay = import ./overlays;
# set the nixos specialArgs
nixosSpecialArgs = {
inherit nixos-hardware;
};
extraHomeManagerModules = [ "${sops-nix.sourceInfo.outPath}/modules/home-manager/sops.nix" ];
};
}