-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
151 lines (124 loc) · 3.49 KB
/
flake.nix
File metadata and controls
151 lines (124 loc) · 3.49 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
{
description = "My personal NixOS-based infrastructure";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixos-hardware.url = "nixos-hardware/master";
catppuccin = {
url = "github:catppuccin/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
ragenix = {
url = "github:yaxitech/ragenix";
inputs.agenix.follows = "agenix";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
###
# For input follows only
agenix = {
url = "github:ryantm/agenix";
inputs.darwin.follows = "";
inputs.home-manager.follows = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
systems.url = "github:nix-systems/default";
};
outputs =
{
self,
nixpkgs,
deploy-rs,
treefmt-nix,
...
}@inputs:
let
inherit (self) outputs;
eachSystem = nixpkgs.lib.genAttrs [
"aarch64-linux"
"x86_64-linux"
];
eachMachine = nixpkgs.lib.genAttrs [
"aether"
"zeus"
"hera"
# "hestia"
# "athena"
# "zephyrus"
# "boreas"
];
treefmt = eachSystem (
system: treefmt-nix.lib.evalModule nixpkgs.legacyPackages.${system} ./treefmt.nix
);
in
{
packages = eachSystem (system: import ./packages nixpkgs.legacyPackages.${system});
formatter = eachSystem (system: treefmt.${system}.config.build.wrapper);
checks = eachSystem (system: {
formatting = treefmt.${system}.config.build.check self;
});
overlays = import ./overlays { };
nixosConfigurations = eachMachine (
machine:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs outputs; };
modules = [
./presets/nixos
./machines/${machine}
];
}
);
deploy = {
fastConnection = true;
remoteBuild = true;
user = "root";
sshUser = "violet";
nodes = eachMachine (machine: {
hostname = "${machine}.wg";
profiles.system.path =
deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.${machine};
});
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
};
}