-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
192 lines (158 loc) · 4.53 KB
/
configuration.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
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
programs.wireshark.enable = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "ffdatop";
networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin";
console = {
font = "Lat2-Terminus16";
keyMap = "de";
};
users.users.ffda = {
isNormalUser = true;
extraGroups = [
"wheel"
"wireshark"
"dialout"
];
};
services.xserver = {
enable = true;
displayManager = {
gdm.enable = true;
};
desktopManager.gnome.enable = true;
};
services.displayManager.autoLogin = {
enable = true;
user = "ffda";
};
environment.gnome.excludePackages = (with pkgs; [
gnome-photos
gnome-tour
]) ++ (with pkgs.gnome; [
cheese # webcam tool
epiphany # Browser
gnome-music
geary # email reader
gnome-characters
totem # video player
tali # poker game
iagno # go game
hitori # sudoku game
atomix # puzzle game
]);
environment.systemPackages = with pkgs; [
# editors
nano
vim
emacs-nox
# gui editors
gedit
jetbrains.pycharm-community
vscodium
# browsers
chromium
firefox
# command line tools
curl
dmidecode
ethtool
(import ./ffda-network-setup-mode.nix)
git
gnupg
htop
iperf3
iw
jq
lm_sensors
magic-wormhole
mtr
pciutils
picocom
python3
ripgrep
ripgrep-all
tcpdump
tmate
tmux
usbutils
unzip
wget
whois
yq
zip
# gui system and debug tools
gparted
isoimagewriter
wireshark-qt
# media tools
mpv
vlc
# office tools
libreoffice
(pkgs.writeShellScriptBin "nixos-system-upgrade" ''
export PATH="${pkgs.git}/bin:${pkgs.nixos-rebuild}/bin:$PATH"
set -eo pipefail
sudo echo -n "git: "
sudo git -C /etc/nixos/ pull
sudo nixos-rebuild switch --upgrade
exit 0
'')
];
users.motd = ''
· · · · · ·
· · · · · · ·
· · · · · Freifunk
· × · Darmstadt
· · ·
· · ·
·
'';
programs.ssh.extraConfig = ''
Host 192.168.0.1 192.168.1.1 192.168.8.1 192.168.88.1 192.168.1.254 192.168.1.20 fd01:67c:2ed8:10*::1:1
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Host *
LogLevel ERROR
User root
'';
environment.shellAliases = {
ssh_force_password = "ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no";
scp_force_password = "scp -o PreferredAuthentications=password -o PubkeyAuthentication=no";
sftp_force_password = "sftp -o PreferredAuthentications=password -o PubkeyAuthentication=no";
ssh_stupid = "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no";
scp_stupid = "scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no";
ssh_rsa = "ssh -o 'HostKeyAlgorithms +ssh-rsa' -o 'PubkeyAcceptedKeyTypes +ssh-rsa'";
scp_rsa = "scp -o 'HostKeyAlgorithms +ssh-rsa' -o 'PubkeyAcceptedKeyTypes +ssh-rsa'";
ssh_rsa_stupid = "ssh -o 'HostKeyAlgorithms +ssh-rsa' -o 'PubkeyAcceptedKeyTypes +ssh-rsa' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no";
scp_rsa_stupid = "scp -o 'HostKeyAlgorithms +ssh-rsa' -o 'PubkeyAcceptedKeyTypes +ssh-rsa' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no";
ssh_old = "ssh -o 'KexAlgorithms diffie-hellman-group1-sha1' -o 'HostKeyAlgorithms +ssh-dss' -o 'Ciphers aes128-cbc,3des-cbc'";
ssh_old_stupid = "ssh -o 'KexAlgorithms diffie-hellman-group1-sha1' -o 'HostKeyAlgorithms +ssh-dss' -o 'Ciphers aes128-cbc,3des-cbc' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no";
scp_old_stupid = "scp -o 'KexAlgorithms diffie-hellman-group1-sha1' -o 'HostKeyAlgorithms +ssh-dss' -o 'Ciphers aes128-cbc,3des-cbc' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no";
};
services.atftpd = {
enable = true;
root = "/var/tftp";
};
services.nginx = {
enable = true;
virtualHosts.default = {
root = "/var/tftp";
};
};
services.fwupd.enable = true;
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 5201 ];
allowedUDPPorts = [ 69 5201 ];
};
system.copySystemConfiguration = true;
system.stateVersion = "22.11"; # Did you read the comment?
}