-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
152 lines (138 loc) · 4.4 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
{
description = "Simple flake to manage my NixOS Systems";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
winapps = {
url = "github:winapps-org/winapps";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak = {
url = "github:gmodena/nix-flatpak/?ref=v0.5.2";
};
#Always use the same nixpkgs for both system + <module>
nix-snapd = {
url = "github:nix-community/nix-snapd";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
nix-flatpak,
nix-snapd,
winapps,
...
}@inputs:
{
nixosConfigurations = {
server = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./modules/configs/minimal
./systems/server/configuration.nix
inputs.home-manager.nixosModules.default
];
};
phoenix = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./systems/phoenix
./modules/configs/minimal
inputs.home-manager.nixosModules.default
];
};
phoenix-arm = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "aarch64-linux";
modules = [
./systems/phoenix
./modules/configs/minimal
inputs.home-manager.nixosModules.default
];
};
omnix = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./systems/omnix
./modules/configs/full
inputs.home-manager.nixosModules.default
inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.nix-snapd.nixosModules.default
(
{ pkgs, ... }:
{
environment.systemPackages = [
winapps.packages.${system}.winapps
winapps.packages.${system}.winapps-launcher # optional
];
}
)
];
};
blade = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./systems/blade
./modules/configs/minimal
inputs.nix-snapd.nixosModules.default
inputs.home-manager.nixosModules.default
inputs.nix-flatpak.nixosModules.nix-flatpak
];
};
cospi = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./systems/cospi
./modules/configs/full
inputs.nix-snapd.nixosModules.default
inputs.home-manager.nixosModules.default
inputs.nix-flatpak.nixosModules.nix-flatpak
];
};
};
deploy.nodes = {
server = {
hostname = "server"; # should be same in ~/.ssh/config
sshUser = "root"; # should be same in ~/.ssh/config
profiles.system = {
user = "root";
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.server;
};
};
phoenix = {
hostname = "phoenix"; # should be same in ~/.ssh/config
sshUser = "root"; # should be same in ~/.ssh/config
profiles.system = {
user = "root";
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.phoenix;
};
};
phoenix-arm = {
hostname = "phoenix"; # should be same in ~/.ssh/config
sshUser = "root"; # should be same in ~/.ssh/config
profiles.system = {
user = "root";
path = inputs.deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.phoenix;
};
};
};
# This is highly advised, and will prevent many possible mistakes
checks = builtins.mapAttrs (
system: deployLib: deployLib.deployChecks self.deploy
) inputs.deploy-rs.lib;
};
}