-
Notifications
You must be signed in to change notification settings - Fork 11
/
default.nix
164 lines (137 loc) · 3.73 KB
/
default.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
let
nixosConfig = builtins.toFile "configuration.nix" ''
builtins.trace "This machine is managed by Nixus, using dummy configuration file for evaluation" {
fileSystems."/".device = "/dev/sda1";
boot.loader.grub.device = "nodev";
assertions = [{
assertion = false;
message = "Not gonna do that for you";
}];
}
'';
deployer = { pkgs, ... }: {
environment.shellAliases = {
rb = "$HOME/cfg/rb";
};
};
sources = import ./nix/sources.nix {};
in
{ nodes ? []
, deployHost ? null
, ignoreFailingSystemdUnits ? true
, deploySystem ? builtins.currentSystem
}:
let
basePkgs = import sources.nixpkgs {
overlays = [];
config = {};
system = deploySystem;
};
nixpkgs = basePkgs.srcOnly {
name = "nixpkgs-patched";
src = sources.nixpkgs;
patches = [
./config/patches/zfs-hibernate.patch
# https://github.com/NixOS/nixpkgs/issues/349496
(basePkgs.fetchpatch {
url = "https://github.com/NixOS/nixpkgs/commit/2f4291af950f6edbcf2d80610c27380e5112f426.patch";
hash = "sha256-NVJtCKaCRyzJHDJ237jj/vTREU3+EiCQwnbl316AEPQ=";
revert = true;
})
(basePkgs.fetchpatch {
url = "https://github.com/NixOS/nixpkgs/compare/2b42c16efb3f200c4d32c1e5047b7750cf311148~...7da346bb57236b4ab88363f3cce66c2604c00bd0.patch";
hash = "sha256-HpD9Tmp61TFId4w6m6GFqHsdQMmYhSfZl70EI0vWYDY=";
revert = true;
})
];
};
in
import sources.nixus {
specialArgs.sources = sources;
inherit deploySystem;
nixpkgs = nixpkgs;
} {
_file = ./default.nix;
imports = [
./external/private
./config/multimods
];
inherit deployHost;
defaults = { name, lib, ... }: {
options.configuration = lib.mkOption {
type = lib.types.submoduleWith {
modules = [];
specialArgs.sources = sources;
};
};
config = {
enable = lib.elem name nodes;
nixpkgs = nixpkgs;
inherit ignoreFailingSystemdUnits;
configuration = { lib, pkgs, ... }: {
options.effectivePkgs = lib.mkOption {
type = lib.types.raw;
default = pkgs;
};
#config._module.args.sources = sources;
config.nix.nixPath = [
"nixos-config=${nixosConfig}"
"nixpkgs=/etc/nixpkgs"
];
config.environment.etc.nixpkgs.source = toString nixpkgs;
};
};
};
nodes.protos = {
host = "[email protected]";
switchTimeout = 240;
configuration = {
imports = [
./config
./external/private/default-old.nix
(sources.home-manager + "/nixos")
./config/machines/protos
];
networking.public.ipv4 = "206.81.23.189";
networking.public.ipv6 = "2a03:b0c0:3:d0::5f7f:5001";
system.stateVersion = "19.03";
home-manager.sharedModules = [
{ home.stateVersion = "22.11"; }
];
};
};
nodes.vario = {
deployFrom.zion.host = "[email protected]";
deployFrom.zion.hasFastConnection = true;
switchTimeout = 240;
configuration = {
imports = [
./config
./external/private/default-old.nix
(sources.home-manager + "/nixos")
./config/machines/vario
deployer
];
system.stateVersion = "22.11";
home-manager.sharedModules = [
{ home.stateVersion = "22.11"; }
];
};
};
nodes.zion = {
deployFrom.vario.host = "[email protected]";
deployFrom.vario.hasFastConnection = true;
configuration = {
imports = [
(sources.home-manager + "/nixos")
./config/machines/zion
deployer
];
home-manager.sharedModules = [
{ home.stateVersion = "22.11"; }
];
};
};
nodes.mac.enable = false;
nodes.phone.enable = false;
}