-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfiguration.nix
More file actions
263 lines (230 loc) · 6.15 KB
/
configuration.nix
File metadata and controls
263 lines (230 loc) · 6.15 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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
{
config,
hostname,
localpkgs,
pkgs,
lib,
...
}:
let
packageset = pkgs.callPackage ./packages.nix { inherit localpkgs; };
in
{
documentation.man.generateCaches = false; # building the cache takes forver and I don't use it
services.fwupd.enable = true;
nixpkgs.overlays = [
(final: prev: {
})
];
networking.hosts = {
# TODO: ewww VPN FIXE THIS
"100.100.57.46" = [
"nixcache.turb.io"
"int.turb.io"
"bt.int.turb.io"
"jelly.int.turb.io"
"ollama.int.turb.io"
"sync.int.turb.io"
"home.int.turb.io"
];
};
nix = {
#autoOptimiseStore = true;
gc = lib.mkIf (hostname != "ballos") {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
settings = {
trusted-users = [ "turbio" ];
# todo(turbio): lol
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
"https://nixcache.turb.io"
];
trusted-public-keys = [
"nixcache.turb.io:FFCylJ0fphGs8IdYdpZBczLpUM9QRDzlN1oIUf2VxHI=" # TODO(turbio): key management
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
#package = pkgs.nixVersions.latest;
extraOptions = ''
experimental-features = nix-command flakes pipe-operators auto-allocate-uids no-url-literals
builders-use-substitutes = true
'';
};
programs.nix-index-database.comma.enable = true;
nixpkgs.config.allowUnfree = true; # welp
networking.hostName = hostname;
i18n.defaultLocale = "en_US.UTF-8";
environment.systemPackages = packageset.core;
users.mutableUsers = false;
security.sudo.wheelNeedsPassword = false;
users.users.turbio = {
home = "/home/turbio";
isNormalUser = true;
extraGroups = [
"wheel"
"networkmanager"
"audio"
"video"
"wireshark"
"dialout" # /dev/tty stuff
"rfkill" # gotta poke some devices
"input" # spooky haxxxx for push to talk
"media"
# raspi stuff
"gpio"
"i2c"
];
uid = 1000;
hashedPasswordFile = config.age.secrets.userpassword.path;
shell = pkgs.zsh;
#shell = pkgs.fish;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIONmQgB3t8sb7r+LJ/HeaAY9Nz2aPS1XszXTub8A1y4n turbio" # TODO(turbio): key management
];
};
programs.ssh.extraConfig = ''
ControlMaster auto
Host *
StrictHostKeyChecking accept-new
'';
programs.fish.enable = true;
programs.zsh.enable = true;
programs.mtr.enable = true;
#programs.gnupg.agent = {
#enable = true;
#enableSSHSupport = true;
#};
programs.mosh.enable = true;
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
services.chrony.enable = true;
programs.htop.enable = true;
programs.htop.settings = {
hide_kernel_threads = false;
hide_running_in_container = false;
hide_userland_threads = true;
show_program_path = false;
column_meters_0 = [
"LeftCPUs2"
"Memory"
"Swap"
"DiskIO"
"NetworkIO"
];
column_meter_modes_0 = [
1
1
1
2
2
];
column_meters_1 = [
"RightCPUs2"
"Tasks"
"LoadAverage"
"Uptime"
];
column_meter_modes_1 = [
1
2
2
2
];
};
/*
services.wgvpn = {
enable = true;
networks.yep = {
subnet = "10.38.0.0/24"; # choose something unlikely to conflict
generatePrivateKeyFile = true;
privateKeyFile = "/tmp/TODO";
listenPort = 51820;
mtu = 1420;
forwardPorts = [
{
destinationHost = "ballos";
destinationPort = 80;
sourceHost = "balrog";
sourcePort = 80;
proto = "tcp";
}
{
destinationHost = "ballos";
destinationPort = 443;
sourceHost = "balrog";
sourcePort = 443;
proto = "tcp";
}
];
hosts = [
{
hostname = "balrog";
ip = "10.100.0.1";
pubkey = "z8vFtmrdwBEFTe49UykBbz9sQS8XvoDBGcsf/7dZ9R8=";
endpoint = "gateway.turb.io";
router = true;
}
{
hostname = "gero";
ip = "10.100.0.3";
pubkey = "6QkyXbJ4orCVjGlw03Aa0R1GeUiEoalVdWCAxQH6Qkw=";
}
{
hostname = "itoh";
ip = "10.100.0.4";
pubkey = "nl9gri7OsWGYWj+LbbtUBv8dKxFVOz4wlunm7dUhAgk=";
}
{
hostname = "star";
ip = "10.100.0.5";
pubkey = "lfUVvROJvEyOHlzBxWsEpp7rWvY0Pt9J7cTKsPra92w=";
}
{
hostname = "pando";
ip = "10.100.0.6";
pubkey = "Y9TKTr/fVYVxogi9vYYKo/xFjUk2Z5XFRuEdkSDN7yI=";
}
{
hostname = "ios";
pubkey = "8RPnvY0Vy641THmmnkGiz37oN65VGKplEZkOKuUqly8=";
ip = "10.100.0.11";
}
{
hostname = "ballos";
ip = "10.100.0.10";
pubkey = "7u9v3uGkvTY0fAZwz1ACMHSHyD+ocPXFrccDSuPPzUQ=";
endpoint = "ballos.lan";
}
];
};
};
*/
# TODO(turbio):
services.tailscale.enable = lib.mkIf (hostname != "zote") true;
services.tailscale.useRoutingFeatures = "both";
networking.firewall.allowedUDPPorts = [ 48000 ]; # TODO: ts relay
networking.nameservers = [
"100.100.100.100"
"8.8.8.8"
"1.1.1.1"
];
networking.nftables = {
enable = true;
};
networking.useNetworkd = true;
services.resolved.enable = true;
boot.supportedFilesystems = [ "nfs" ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
}