alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
configs: remove dead modules
author
lassulus
date
2 weeks ago
(Oct 2, 2026, 9:45 PM CEST)
commit
510e3436
510e3436cc9204d118df87c61b08ec7d0f176822
parent
e01333fe
e01333fe8be7da5a3a5e07487a185332244400e5
-1895
53 changed files
Expand all
Collapse all
Unified
Split
configs
antimicrox
default.nix
empty.gamecontroller.amgp
mouse.gamecontroller.amgp
bgt-bot
bgt-check.sh
default.nix
binary-cache
client.nix
proxy.nix
server.nix
bitcoin.nix
c-base.nix
container-networking.nix
default.nix
hfos.nix
home-manager.nix
home-media.nix
hw
brcmfmac4356-pcie.txt
iodined.nix
libvirt.nix
minecraft.nix
monitoring
alert-rules.nix
prometheus.nix
murmur.nix
news-host.nix
nextcloud.nix
privoxy-retiolum.nix
privoxy.nix
shadowsocks.nix
tests
dummy-secrets
cbase.txt
icecast-admin-pw
icecast-source-pw
initrd
ssh.ed25519_key
lassul.us.dkim.priv
mysql_rootPassword
nix-serve.key
nordvpn.txt
retiolum.rsa_key.priv
searx.key
ssh-tor.priv
ssh.id_ed25519
ssh.id_rsa
syncthing.cert
syncthing.key
torrent-auth
transmission-pw
websites
domsen.nix
flix.lassul.us.nix
util.nix
weron
client.nix
wiregrill.nix
machines
aergia
config.nix
physical.nix
ignavia
config.nix
neoprism
config.nix
-35
configs/bitcoin.nix
Reviewed
···
1
1
-
{ config, pkgs, ... }:
2
2
-
3
3
-
let
4
4
-
mainUser = config.users.extraUsers.mainUser;
5
5
-
in
6
6
-
{
7
7
-
8
8
-
users.extraUsers = {
9
9
-
bitcoin = {
10
10
-
name = "bitcoin";
11
11
-
description = "user for bitcoin stuff";
12
12
-
home = "/home/bitcoin";
13
13
-
useDefaultShell = true;
14
14
-
createHome = true;
15
15
-
packages = [ pkgs.electrum ];
16
16
-
isNormalUser = true;
17
17
-
};
18
18
-
monero = {
19
19
-
name = "monero";
20
20
-
description = "user for monero stuff";
21
21
-
home = "/home/monero";
22
22
-
useDefaultShell = true;
23
23
-
createHome = true;
24
24
-
packages = [
25
25
-
pkgs.monero-cli
26
26
-
pkgs.monero-gui
27
27
-
];
28
28
-
isNormalUser = true;
29
29
-
};
30
30
-
};
31
31
-
security.sudo.extraConfig = ''
32
32
-
${mainUser.name} ALL=(bitcoin) ALL
33
33
-
${mainUser.name} ALL=(monero) ALL
34
34
-
'';
35
35
-
}
-128
configs/c-base.nix
Reviewed
···
1
1
-
{ config, pkgs, ... }:
2
2
-
3
3
-
{
4
4
-
5
5
-
environment.systemPackages = [
6
6
-
pkgs.cifs-utils
7
7
-
];
8
8
-
9
9
-
clan.core.vars.generators.c-base = {
10
10
-
files."c-base.txt" = { };
11
11
-
prompts.user.description = "c-base nickname";
12
12
-
prompts.pass.description = "c-base password";
13
13
-
script = ''
14
14
-
cat "$prompts"/user > "$out/c-base.txt"
15
15
-
cat "$prompts"/pass >> "$out/c-base.txt"
16
16
-
'';
17
17
-
};
18
18
-
19
19
-
systemd.network.networks.c-base = {
20
20
-
matchConfig.Name = "c-base";
21
21
-
networkConfig = {
22
22
-
IgnoreCarrierLoss = "3s";
23
23
-
KeepConfiguration = "static";
24
24
-
DNS = "10.0.1.254";
25
25
-
Domains = "cbrp3.c-base.org";
26
26
-
};
27
27
-
routes = [
28
28
-
{
29
29
-
routeConfig = {
30
30
-
Destination = "10.0.0.0/23";
31
31
-
Gateway = "172.31.77.1";
32
32
-
};
33
33
-
}
34
34
-
{
35
35
-
routeConfig = {
36
36
-
Destination = "91.102.9.99/32"; # vorstand.c-base.org
37
37
-
Gateway = "172.31.77.1";
38
38
-
};
39
39
-
}
40
40
-
];
41
41
-
};
42
42
-
services.openvpn.servers.c-base = {
43
43
-
config = ''
44
44
-
remote vpn.ext.c-base.org 1194
45
45
-
verify-x509-name vpn.ext.c-base.org name
46
46
-
client
47
47
-
proto udp
48
48
-
dev-type tun
49
49
-
dev c-base
50
50
-
resolv-retry infinite
51
51
-
nobind
52
52
-
# user openvpn
53
53
-
# group openvpn
54
54
-
persist-key
55
55
-
persist-tun
56
56
-
comp-lzo
57
57
-
# register-dns
58
58
-
# block-outside-dns
59
59
-
script-security 2
60
60
-
auth-user-pass ${config.clan.core.vars.generators.c-base.files."c-base.txt".path}
61
61
-
#auth-user-pass
62
62
-
key-direction 1
63
63
-
<tls-auth>
64
64
-
#
65
65
-
# 2048 bit OpenVPN static key
66
66
-
#
67
67
-
-----BEGIN OpenVPN Static key V1-----
68
68
-
54a66ed1048bed7508703347e89d68d6
69
69
-
5586e6a5d1218cf8675941031d540be6
70
70
-
993e07200a16ad3b770b659932ee71e5
71
71
-
f8080b5c9fa2acb3893abd40fad2552c
72
72
-
fdaf17565e617ae450efcccf5652dca5
73
73
-
a16419509024b075941098731eb25ac0
74
74
-
a64f963ece3dca1d2a64a9c5e17839d7
75
75
-
5b5080165a9b2dc90ef111879d7d3173
76
76
-
2d1027ae42d869394aca08da4472a9d0
77
77
-
6b724b4ed43a957feef7d6dfc86da241
78
78
-
74828fa0e1240941586f0d937cac32fc
79
79
-
13cc81e7bed58817353d6afaff7e6a26
80
80
-
4f9cc086af79c1cdca660d86e18cff96
81
81
-
69dd3d392caf09a468894a8504f4cc7c
82
82
-
7ae0072e6d9ad90b166ad13a39c57b3c
83
83
-
3a869e27a1d89deb161c255227551713
84
84
-
-----END OpenVPN Static key V1-----
85
85
-
</tls-auth>
86
86
-
<ca>
87
87
-
-----BEGIN CERTIFICATE-----
88
88
-
MIIGsDCCBJigAwIBAgIJAPkM1l2zA306MA0GCSqGSIb3DQEBCwUAMIGWMQswCQYD
89
89
-
VQQGEwJERTEPMA0GA1UEBxMGQmVybGluMRswGQYDVQQLExJ2cG4uZXh0LmMtYmFz
90
90
-
ZS5vcmcxGzAZBgNVBAMTEnZwbi5leHQuYy1iYXNlLm9yZzEbMBkGA1UEKRMSdnBu
91
91
-
LmV4dC5jLWJhc2Uub3JnMR8wHQYJKoZIhvcNAQkBFhBhZG1heEBjLWJhc2Uub3Jn
92
92
-
MB4XDTE2MDcwOTE4MjkyMFoXDTI2MDcxMDE4MjkyMFowgZYxCzAJBgNVBAYTAkRF
93
93
-
MQ8wDQYDVQQHEwZCZXJsaW4xGzAZBgNVBAsTEnZwbi5leHQuYy1iYXNlLm9yZzEb
94
94
-
MBkGA1UEAxMSdnBuLmV4dC5jLWJhc2Uub3JnMRswGQYDVQQpExJ2cG4uZXh0LmMt
95
95
-
YmFzZS5vcmcxHzAdBgkqhkiG9w0BCQEWEGFkbWF4QGMtYmFzZS5vcmcwggIiMA0G
96
96
-
CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXEs+uWCXLNmm+lgP9x7u3FqWa4pPI
97
97
-
h64c6EWIULMATrhEw+Ej4fpCXwU9otFaO04fAeJmZGkDcnAYdBDiCeI0luOSdj44
98
98
-
Bg9KecSei/TskqjhDVnEBp65hiz0rZE6c1baPdLYmD5xrXWb3i0zrlBYFawuL6C2
99
99
-
lwVCEm3cadvkDJ2DleMuu3NblV8ViIDN0HZqzJNP72g1I0MgohkpetACXlf7MzQV
100
100
-
PFHfzvb04Rj2lJ8BDhceQ0WmjtVV/Ag6nka5oi954OeHMujRuH+rZYiQZDZpJLHK
101
101
-
Kh1KWTVlWPRy+AvCi9lweDWSmLccq7Ug4xMtDF4I5qW3tjCd0xqpZ21Xmo2JyKtY
102
102
-
4h8wEDPqiJvgwvkXsH17GLn5ZxiMcQuRJQYZqJephkzR9uccJeWSS76kwm/vLqG3
103
103
-
+eORlYnyjiNXtiMIhmAEFjpWUrGH8v4CijpUNP6E63ynGrRVXK684YQXkqL+xPAt
104
104
-
t6dsMBUwf94a2S1o2kgvuRCim1wlHvf1QsHrO/Hwgpzc8no/daWL+Z9Rq9okTHNK
105
105
-
nc1G5dv8TkmxIDYnLm07QMzzBoOT36BcGtkEBA+0xhQlX5PyQdM5/jnZVhdSBmoP
106
106
-
MbZXPoU/gJAIuuBuwdTlgCzYf44/9/YU/AnW8eLrbhm9KtMtoMpatrWorKqk/GPv
107
107
-
/lGNRQuNffrbiQIDAQABo4H+MIH7MB0GA1UdDgQWBBTf5cYbK+KCF9u9aobFlLbu
108
108
-
ilwX4jCBywYDVR0jBIHDMIHAgBTf5cYbK+KCF9u9aobFlLbuilwX4qGBnKSBmTCB
109
109
-
ljELMAkGA1UEBhMCREUxDzANBgNVBAcTBkJlcmxpbjEbMBkGA1UECxMSdnBuLmV4
110
110
-
dC5jLWJhc2Uub3JnMRswGQYDVQQDExJ2cG4uZXh0LmMtYmFzZS5vcmcxGzAZBgNV
111
111
-
BCkTEnZwbi5leHQuYy1iYXNlLm9yZzEfMB0GCSqGSIb3DQEJARYQYWRtYXhAYy1i
112
112
-
YXNlLm9yZ4IJAPkM1l2zA306MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQAD
113
113
-
ggIBAMs1moiS7UZ4neOivQjqwKrBbm1j3tgmPLhDfNMmXYarGhnBGAlLxLAQWtG+
114
114
-
Fnbx8KcsJnrsWcGfZcst1z45S4a5oBdVNKOfgkMOG0glZorIDO8Odrb51rpyzU0v
115
115
-
0wcNumMNWhkFuo2OTBHPnnJIWEAFwwCCSCL0I0hQxxoaV36kphjuIwzrMJhd+XAT
116
116
-
24En58cNp6sPRDd+FzOH08uFINevyzKWYxkMgVj+e3fbuiyOB8RqvndKvtfBBcpB
117
117
-
cCO86lGnj/ETMDciTczUShxaMn9wV1zr1KH1xvT3ohUeOcQZGbGTcjG4mxlns8ZO
118
118
-
U5J3Yrcd1eMfJq9Bwd3zPsTLnT8LwIS8vfYRav9b34XdqcBG73dhrjsicMK0Qy0z
119
119
-
Qz7vKJzcvrEnKuaMyB3mCxz/UvbNc2Bupwm4FmzN5eFjDs+7paYFdfOzqMjoRP+8
120
120
-
bcXSqDN5P2eUd7cdsZXaFNcsf1FkWlE3GudVBOmNJqz9zBab/T5J+l4Z90Pd6OUX
121
121
-
GNozEvLhcJkvPKA526TegHTGC8hMquxKc9tpOzNRqZJMFa+UG1mgMrMepRmM/B3s
122
122
-
QrKI1C11iCVYfb9J0tQUkfENHMx4J7mG2DZAhnKWQDU2awM41qU4A7aBYaJvDPnQ
123
123
-
RRcbaT0D794lKUQwH/mZuyKzF22oZNk1o1TV2SaFXqgX5tDt
124
124
-
-----END CERTIFICATE-----
125
125
-
</ca>
126
126
-
'';
127
127
-
};
128
128
-
}
-58
configs/container-networking.nix
Reviewed
···
1
1
-
{ lib, ... }:
2
2
-
3
3
-
{
4
4
-
krebs.iptables.tables.filter.FORWARD.rules = [
5
5
-
# { v6 = false; predicate = "-d 10.233.2.0/24 -o ve-+ -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
6
6
-
# { v6 = false; predicate = "-s 10.233.2.0/24 -i ve-+"; target = "ACCEPT"; }
7
7
-
{
8
8
-
v6 = false;
9
9
-
predicate = "-o ctr+ -m conntrack --ctstate RELATED,ESTABLISHED";
10
10
-
target = "ACCEPT";
11
11
-
}
12
12
-
{
13
13
-
v6 = false;
14
14
-
predicate = "-i ctr+";
15
15
-
target = "ACCEPT";
16
16
-
}
17
17
-
{
18
18
-
v6 = false;
19
19
-
predicate = "-o ve-+ -m conntrack --ctstate RELATED,ESTABLISHED";
20
20
-
target = "ACCEPT";
21
21
-
}
22
22
-
{
23
23
-
v6 = false;
24
24
-
predicate = "-i ve-+";
25
25
-
target = "ACCEPT";
26
26
-
}
27
27
-
# { v6 = false; predicate = "-i ve-+ -o ve-+"; target = "ACCEPT"; }
28
28
-
# { v6 = false; predicate = "-o ve-+"; target = "REJECT --reject-with icmp-port-unreachable"; }
29
29
-
# { v6 = false; predicate = "-i ve-+"; target = "REJECT --reject-with icmp-port-unreachable"; }
30
30
-
];
31
31
-
krebs.iptables.tables.nat.PREROUTING.rules = lib.mkBefore [
32
32
-
{
33
33
-
v6 = false;
34
34
-
predicate = "-i ctr+";
35
35
-
target = "ACCEPT";
36
36
-
}
37
37
-
{
38
38
-
v6 = false;
39
39
-
predicate = "-i ve-+";
40
40
-
target = "ACCEPT";
41
41
-
}
42
42
-
];
43
43
-
krebs.iptables.tables.nat.POSTROUTING.rules = [
44
44
-
# { v6 = false; predicate = "-o et0"; target = "MASQUERADE"; }
45
45
-
46
46
-
{
47
47
-
v6 = false;
48
48
-
predicate = "-s 10.233.0.0/16 ! -d 10.233.0.0/16";
49
49
-
target = "MASQUERADE";
50
50
-
}
51
51
-
# { v6 = false; predicate = "-s 10.233.2.0/24 -d 224.0.0.0/24"; target = "RETURN"; }
52
52
-
# { v6 = false; predicate = "-s 10.233.2.0/24 -d 255.255.255.255"; target = "RETURN"; }
53
53
-
# { v6 = false; predicate = "-s 10.233.2.0/24 ! -d 10.233.2.0/24"; target = "MASQUERADE"; }
54
54
-
# { v6 = false; predicate = "-s 10.233.2.0/24 ! -d 10.233.2.0/24 -p tcp"; target = "MASQUERADE --to-ports 1024-65535"; }
55
55
-
# { v6 = false; predicate = "-s 10.233.2.0/24 ! -d 10.233.2.0/24 -p udp"; target = "MASQUERADE --to-ports 1024-65535"; }
56
56
-
];
57
57
-
boot.kernel.sysctl."net.ipv4.ip_forward" = lib.mkDefault 1;
58
58
-
}
-1
configs/default.nix
View file
Reviewed
···
24
24
25
25
# Import individual configurations
26
26
./security-workarounds.nix
27
27
-
# ./binary-cache/client.nix
28
27
./gc.nix
29
28
./mc.nix
30
29
./zsh.nix
-83
configs/hfos.nix
Reviewed
···
1
1
-
{ pkgs, ... }:
2
2
-
{
3
3
-
users.users.riot = {
4
4
-
uid = genid "riot";
5
5
-
isNormalUser = true;
6
6
-
extraGroups = [ "libvirtd" ];
7
7
-
openssh.authorizedKeys.keys = [
8
8
-
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMkyCwdwBrsbs3qrNQcy/SqQpex4aaQoAMuT+NDefFc8KVHOMfmkDccEyAggDTgQhUrEVIvo/fFUmGBd9sm1vN1IthO2Qh5nX+qiK/A2R7sxci0Ry6piU03R27JfpZqi6g8TSPNi1C9rC8eBqOfO3OB8oQOkFmM48Q9cmS8AV3ERLR0LaHoEqUbs86JELbtHrMdKk4Hzo8zTM/isP3GO8iDHRt4dBS/03Ve7+WVxgNwWU2HW3a3jJd3tWHrqGmS/ZfCEC/47eIj4WSW+JiH9Q0BarNEbkkMV1Mvm32MX52stGPd5FaIIUtFqD4745iVSiw8esUGFUxJ1RjWgUHr99h riot@vortex"
9
9
-
];
10
10
-
};
11
11
-
12
12
-
networking.interfaces."eth0:0".ip4 = [
13
13
-
{
14
14
-
address = "213.239.205.246";
15
15
-
prefixLength = 24;
16
16
-
}
17
17
-
];
18
18
-
19
19
-
krebs.iptables.tables.nat.PREROUTING.rules = mkBefore [
20
20
-
{
21
21
-
v6 = false;
22
22
-
predicate = "-d 213.239.205.246 -p tcp --dport 22";
23
23
-
target = "DNAT --to-destination 192.168.122.208:22";
24
24
-
}
25
25
-
{
26
26
-
v6 = false;
27
27
-
predicate = "-d 213.239.205.246 -p tcp --dport 25";
28
28
-
target = "DNAT --to-destination 192.168.122.208:25";
29
29
-
}
30
30
-
{
31
31
-
v6 = false;
32
32
-
predicate = "-d 213.239.205.246 -p tcp --dport 80";
33
33
-
target = "DNAT --to-destination 192.168.122.208:1080";
34
34
-
}
35
35
-
{
36
36
-
v6 = false;
37
37
-
predicate = "-d 213.239.205.246 -p tcp --dport 443";
38
38
-
target = "DNAT --to-destination 192.168.122.208:1443";
39
39
-
}
40
40
-
];
41
41
-
42
42
-
krebs.iptables.tables.filter.FORWARD.rules = mkBefore [
43
43
-
{
44
44
-
v6 = false;
45
45
-
predicate = "-d 192.168.122.208 -p tcp --dport 22 -m state --state NEW,ESTABLISHED,RELATED";
46
46
-
target = "ACCEPT";
47
47
-
}
48
48
-
{
49
49
-
v6 = false;
50
50
-
predicate = "-d 192.168.122.208 -p tcp --dport 25 -m state --state NEW,ESTABLISHED,RELATED";
51
51
-
target = "ACCEPT";
52
52
-
}
53
53
-
{
54
54
-
v6 = false;
55
55
-
predicate = "-d 192.168.122.208 -p tcp --dport 1080 -m state --state NEW,ESTABLISHED,RELATED";
56
56
-
target = "ACCEPT";
57
57
-
}
58
58
-
{
59
59
-
v6 = false;
60
60
-
predicate = "-d 192.168.122.208 -p tcp --dport 1443 -m state --state NEW,ESTABLISHED,RELATED";
61
61
-
target = "ACCEPT";
62
62
-
}
63
63
-
];
64
64
-
65
65
-
krebs.iptables.tables.nat.OUTPUT.rules = mkBefore [
66
66
-
{
67
67
-
v6 = false;
68
68
-
predicate = "-d 213.239.205.246 -p tcp --dport 443";
69
69
-
target = "DNAT --to-destination 192.168.122.208:1443";
70
70
-
}
71
71
-
];
72
72
-
73
73
-
# TODO use bridge interfaces instead of this crap
74
74
-
systemd.services.libvirtd.serviceConfig.ExecStartPost =
75
75
-
let
76
76
-
restart-iptables = pkgs.writeDash "restart-iptables" ''
77
77
-
#soo hacky
78
78
-
${pkgs.coreutils}/bin/sleep 5s
79
79
-
${pkgs.systemd}/bin/systemctl restart krebs-iptables.service
80
80
-
'';
81
81
-
in
82
82
-
restart-iptables;
83
83
-
}
-31
configs/home-manager.nix
Reviewed
···
1
1
-
{
2
2
-
lib,
3
3
-
pkgs,
4
4
-
...
5
5
-
}:
6
6
-
let
7
7
-
vim_nix = import ./vim.nix {
8
8
-
inherit lib pkgs;
9
9
-
config = { };
10
10
-
};
11
11
-
in
12
12
-
{
13
13
-
programs.git = {
14
14
-
enable = true;
15
15
-
userName = "lassulus";
16
16
-
userEmail = "lassulus@lassul.us";
17
17
-
extraConfig = {
18
18
-
rebase.autostash = true;
19
19
-
};
20
20
-
};
21
21
-
22
22
-
home.packages = [
23
23
-
(pkgs.writers.writeDashBin "vim" ''
24
24
-
${vim_nix.environment.etc.vim.source}/bin/vim -u ${vim_nix.environment.etc.vimrc.source} "$@"
25
25
-
'')
26
26
-
pkgs.mosh
27
27
-
pkgs.direnv
28
28
-
];
29
29
-
30
30
-
programs.home-manager.enable = true;
31
31
-
}
-105
configs/home-media.nix
Reviewed
···
1
1
-
{ self, pkgs, ... }:
2
2
-
{
3
3
-
imports = [
4
4
-
];
5
5
-
users.users.media = {
6
6
-
isNormalUser = true;
7
7
-
uid = self.inputs.stockholm.lib.genid_uint31 "media";
8
8
-
extraGroups = [
9
9
-
"video"
10
10
-
"audio"
11
11
-
"pipewire"
12
12
-
];
13
13
-
packages = [
14
14
-
(pkgs.writers.writeDashBin "mpv" ''
15
15
-
if test -e "$1"; then
16
16
-
mpv-ipc-cli loadfile "$(realpath "$1")"
17
17
-
else
18
18
-
mpv-ipc-cli loadfile "$1"
19
19
-
fi
20
20
-
'')
21
21
-
];
22
22
-
};
23
23
-
24
24
-
users.users.mainUser.packages = [
25
25
-
(pkgs.writers.writeDashBin "mpv" ''
26
26
-
if test -e "$1"; then
27
27
-
mpv-ipc-cli loadfile "$(realpath "$1")"
28
28
-
else
29
29
-
mpv-ipc-cli loadfile "$1"
30
30
-
fi
31
31
-
'')
32
32
-
];
33
33
-
34
34
-
services.xserver.displayManager.autoLogin = {
35
35
-
enable = true;
36
36
-
user = "media";
37
37
-
};
38
38
-
39
39
-
hardware.pulseaudio.configFile = pkgs.writeText "pulse.pa" ''
40
40
-
.include ${pkgs.pulseaudioFull}/etc/pulse/default.pa
41
41
-
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;10.42.0.0/24 auth-anonymous=1
42
42
-
'';
43
43
-
44
44
-
environment.systemPackages = [
45
45
-
(pkgs.writers.writeDashBin "mpv-ipc-cli" ''
46
46
-
set -efux
47
47
-
${pkgs.jq}/bin/jq -nc '{ "command": $ARGS.positional }' --args "$@" | ${pkgs.socat}/bin/socat - /tmp/mpv.ipc
48
48
-
'')
49
49
-
(pkgs.writers.writeDashBin "ipc-mpv" ''
50
50
-
/run/current-system/sw/bin/mpv \
51
51
-
--audio-display=no --audio-channels=stereo \
52
52
-
--audio-samplerate=48000 --audio-format=s16 \
53
53
-
--ao-pcm-file=/run/snapserver/snapfifo --ao=pcm \
54
54
-
--audio-delay=-1 \
55
55
-
"$@"
56
56
-
'')
57
57
-
pkgs.mpvc
58
58
-
(pkgs.writers.writeDashBin "iptv" ''
59
59
-
curl -Ssf 'https://iptv-org.github.io/iptv/index.nsfw.m3u' |
60
60
-
sed 's/.*,//' |
61
61
-
sed -z 's/\nhttp/,http/g' |
62
62
-
fzf --bind='enter:execute(echo {} | cut -d ',' -f 2 | xargs -0 mpv-ipc-cli loadfile)'
63
63
-
'')
64
64
-
];
65
65
-
66
66
-
environment.variables.SOCKET = "/tmp/mpv.ipc";
67
67
-
systemd.services.mpvd = {
68
68
-
wantedBy = [ "multi-user.target" ];
69
69
-
environment.DISPLAY = ":0";
70
70
-
serviceConfig = {
71
71
-
User = "media";
72
72
-
RemainAfterExit = true;
73
73
-
Nice = "-10";
74
74
-
ExecStart = ''
75
75
-
${pkgs.tmux}/bin/tmux -2 new-session -d -s mpvd -- /run/current-system/sw/bin/ipc-mpv \
76
76
-
--audio-display=no --audio-channels=stereo \
77
77
-
--audio-samplerate=48000 --audio-format=s16 \
78
78
-
--ao-pcm-file=/run/snapserver/snapfifo --ao=pcm \
79
79
-
--audio-delay=-1 \
80
80
-
--network-timeout=3 \
81
81
-
--untimed --cache-pause=no \
82
82
-
--idle=yes --force-window=yes \
83
83
-
--loop-playlist=inf \
84
84
-
--input-ipc-server=/tmp/mpv.ipc
85
85
-
'';
86
86
-
ExecStop = "${pkgs.tmux}/bin/tmux kill-session -t mpvd";
87
87
-
ExecStartPre = [
88
88
-
"+${pkgs.writers.writeDash "remove_socket" ''
89
89
-
set -efux
90
90
-
rm -f /tmp/mpv.ipc
91
91
-
''}"
92
92
-
];
93
93
-
ExecStartPost = [
94
94
-
"+${pkgs.writers.writeDash "fix_permissions" ''
95
95
-
set -efux
96
96
-
until test -e /tmp/mpv.ipc; do
97
97
-
sleep 1
98
98
-
done
99
99
-
# sleep 2
100
100
-
chmod 666 /tmp/mpv.ipc || :
101
101
-
''}"
102
102
-
];
103
103
-
};
104
104
-
};
105
105
-
}
-18
configs/iodined.nix
Reviewed
···
1
1
-
{ config, ... }:
2
2
-
3
3
-
let
4
4
-
# TODO: make this a parameter
5
5
-
domain = "io.lassul.us";
6
6
-
in
7
7
-
{
8
8
-
9
9
-
services.iodine.server = {
10
10
-
enable = true;
11
11
-
domain = domain;
12
12
-
ip = "172.16.10.1/24";
13
13
-
extraConfig = "-c -l ${config.krebs.build.host.nets.internet.ip4.addr}";
14
14
-
};
15
15
-
16
16
-
networking.firewall.allowedUDPPorts = [ 53 ];
17
17
-
18
18
-
}
-97
configs/libvirt.nix
Reviewed
···
1
1
-
{ lib, ... }:
2
2
-
3
3
-
{
4
4
-
virtualisation.libvirtd.enable = true;
5
5
-
security.polkit.enable = true;
6
6
-
7
7
-
krebs.iptables.tables.filter.INPUT.rules = [
8
8
-
{
9
9
-
v6 = false;
10
10
-
predicate = "-i virbr0 -p udp -m udp --dport 53";
11
11
-
target = "ACCEPT";
12
12
-
}
13
13
-
{
14
14
-
v6 = false;
15
15
-
predicate = "-i virbr0 -p tcp -m tcp --dport 53";
16
16
-
target = "ACCEPT";
17
17
-
}
18
18
-
{
19
19
-
v6 = false;
20
20
-
predicate = "-i virbr0 -p udp -m udp --dport 67";
21
21
-
target = "ACCEPT";
22
22
-
}
23
23
-
{
24
24
-
v6 = false;
25
25
-
predicate = "-i virbr0 -p tcp -m tcp --dport 67";
26
26
-
target = "ACCEPT";
27
27
-
}
28
28
-
];
29
29
-
krebs.iptables.tables.filter.FORWARD.rules = [
30
30
-
{
31
31
-
v6 = false;
32
32
-
predicate = "-d 192.168.122.0/24 -o virbr0 -m conntrack --ctstate RELATED,ESTABLISHED";
33
33
-
target = "ACCEPT";
34
34
-
}
35
35
-
{
36
36
-
v6 = false;
37
37
-
predicate = "-s 192.168.122.0/24 -i virbr0";
38
38
-
target = "ACCEPT";
39
39
-
}
40
40
-
{
41
41
-
v6 = false;
42
42
-
predicate = "-i virbr0 -o virbr0";
43
43
-
target = "ACCEPT";
44
44
-
}
45
45
-
{
46
46
-
v6 = false;
47
47
-
predicate = "-o virbr0";
48
48
-
target = "REJECT --reject-with icmp-port-unreachable";
49
49
-
}
50
50
-
{
51
51
-
v6 = false;
52
52
-
predicate = "-i virbr0";
53
53
-
target = "REJECT --reject-with icmp-port-unreachable";
54
54
-
}
55
55
-
];
56
56
-
krebs.iptables.tables.filter.OUTPUT.rules = [
57
57
-
{
58
58
-
v6 = false;
59
59
-
predicate = "-o virbr0 -p udp -m udp --dport 68";
60
60
-
target = "ACCEPT";
61
61
-
}
62
62
-
];
63
63
-
krebs.iptables.tables.nat.PREROUTING.rules = lib.mkBefore [
64
64
-
{
65
65
-
v6 = false;
66
66
-
predicate = "-s 192.168.122.0/24";
67
67
-
target = "ACCEPT";
68
68
-
}
69
69
-
];
70
70
-
krebs.iptables.tables.nat.POSTROUTING.rules = [
71
71
-
{
72
72
-
v6 = false;
73
73
-
predicate = "-s 192.168.122.0/24 -d 224.0.0.0/24";
74
74
-
target = "RETURN";
75
75
-
}
76
76
-
{
77
77
-
v6 = false;
78
78
-
predicate = "-s 192.168.122.0/24 -d 255.255.255.255";
79
79
-
target = "RETURN";
80
80
-
}
81
81
-
{
82
82
-
v6 = false;
83
83
-
predicate = "-s 192.168.122.0/24 ! -d 192.168.122.0/24";
84
84
-
target = "MASQUERADE";
85
85
-
}
86
86
-
{
87
87
-
v6 = false;
88
88
-
predicate = "-s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp";
89
89
-
target = "MASQUERADE --to-ports 1024-65535";
90
90
-
}
91
91
-
{
92
92
-
v6 = false;
93
93
-
predicate = "-s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp";
94
94
-
target = "MASQUERADE --to-ports 1024-65535";
95
95
-
}
96
96
-
];
97
97
-
}
-9
configs/minecraft.nix
Reviewed
···
1
1
-
{ ... }:
2
2
-
{
3
3
-
services.minecraft-server = {
4
4
-
enable = true;
5
5
-
eula = true;
6
6
-
};
7
7
-
networking.firewall.allowedTCPPorts = [ 25565 ];
8
8
-
networking.firewall.allowedUDPPorts = [ 25565 ];
9
9
-
}
-43
configs/murmur.nix
Reviewed
···
1
1
-
{ lib, ... }:
2
2
-
{
3
3
-
services.murmur = {
4
4
-
enable = true;
5
5
-
allowHtml = false;
6
6
-
bandwidth = 10000000;
7
7
-
registerName = "lassul.us";
8
8
-
autobanTime = 30;
9
9
-
};
10
10
-
krebs.iptables.tables.filter.INPUT.rules = [
11
11
-
{
12
12
-
predicate = "-p tcp --dport 64738";
13
13
-
target = "ACCEPT";
14
14
-
}
15
15
-
{
16
16
-
predicate = "-p udp --dport 64738";
17
17
-
target = "ACCEPT";
18
18
-
}
19
19
-
];
20
20
-
21
21
-
systemd.services.docker-mumble-web.serviceConfig = {
22
22
-
StandardOutput = lib.mkForce "journal";
23
23
-
StandardError = lib.mkForce "journal";
24
24
-
};
25
25
-
virtualisation.oci-containers.containers.mumble-web = {
26
26
-
image = "rankenstein/mumble-web:0.5";
27
27
-
environment = {
28
28
-
MUMBLE_SERVER = "lassul.us:64738";
29
29
-
};
30
30
-
ports = [
31
31
-
"64739:8080"
32
32
-
];
33
33
-
};
34
34
-
35
35
-
services.nginx.virtualHosts."mumble.lassul.us" = {
36
36
-
enableACME = true;
37
37
-
forceSSL = true;
38
38
-
locations."/" = {
39
39
-
proxyPass = "http://localhost:64739";
40
40
-
proxyWebsockets = true;
41
41
-
};
42
42
-
};
43
43
-
}
-11
configs/news-host.nix
Reviewed
···
1
1
-
{ config, pkgs, ... }:
2
2
-
{
3
3
-
krebs.sync-containers3.containers.news = {
4
4
-
sshKey = "${config.krebs.secret.directory}/news.sync.key";
5
5
-
startCommand = ''
6
6
-
export PATH=$PATH:${pkgs.git}/bin
7
7
-
until ${pkgs.dig.host}/bin/host github.com; do sleep 1; done
8
8
-
${pkgs.nixos-rebuild}/bin/nixos-rebuild --refresh --flake git+https://cgit.lassul.us/stockholm#news switch
9
9
-
'';
10
10
-
};
11
11
-
}
-39
configs/nextcloud.nix
Reviewed
···
1
1
-
{ config, pkgs, ... }:
2
2
-
{
3
3
-
services.nextcloud = {
4
4
-
enable = true;
5
5
-
hostName = "c.lassul.us";
6
6
-
package = pkgs.nextcloud31;
7
7
-
database.createLocally = true;
8
8
-
config.dbtype = "pgsql";
9
9
-
config.adminpassFile = "/var/lib/nextcloud/admin.pass";
10
10
-
https = true;
11
11
-
};
12
12
-
13
13
-
services.nginx.virtualHosts.${config.services.nextcloud.hostName} = {
14
14
-
forceSSL = true;
15
15
-
enableACME = true;
16
16
-
};
17
17
-
18
18
-
systemd.services.nextcloud-setup.serviceConfig.ExecStartPre = [
19
19
-
"+${pkgs.writers.writeDash "install_admin_pw" ''
20
20
-
mkdir -p /var/lib/nextcloud
21
21
-
chown nextcloud:nextcloud /var/lib/nextcloud
22
22
-
install -o nextcloud -g nextcloud -Dm0600 \
23
23
-
${config.clan.core.vars.generators.nextcloud.files."nextcloud_adminpass".path} \
24
24
-
/var/lib/nextcloud/admin.pass
25
25
-
''}"
26
26
-
];
27
27
-
28
28
-
clan.core.vars.generators.nextcloud = {
29
29
-
files."nextcloud_adminpass" = { };
30
30
-
prompts.password = {
31
31
-
description = "please enter the admin password for nextcloud";
32
32
-
type = "hidden";
33
33
-
};
34
34
-
runtimeInputs = with pkgs; [ coreutils ];
35
35
-
script = ''
36
36
-
echo "$prompts/password" > "$out"/nextcloud_adminpass
37
37
-
'';
38
38
-
};
39
39
-
}
-27
configs/privoxy-retiolum.nix
Reviewed
···
1
1
-
{ config, ... }:
2
2
-
3
3
-
let
4
4
-
r_ip = config.krebs.build.host.nets.retiolum.ip4.addr;
5
5
-
in
6
6
-
{
7
7
-
imports = [
8
8
-
./privoxy.nix
9
9
-
];
10
10
-
11
11
-
services.privoxy.settings.listen-address = "${r_ip}:8118";
12
12
-
13
13
-
krebs.iptables = {
14
14
-
tables = {
15
15
-
filter.INPUT.rules = [
16
16
-
{
17
17
-
predicate = "-i retiolum -p tcp --dport 8118";
18
18
-
target = "ACCEPT";
19
19
-
}
20
20
-
{
21
21
-
predicate = "-i dns0 -p tcp --dport 8118";
22
22
-
target = "ACCEPT";
23
23
-
}
24
24
-
];
25
25
-
};
26
26
-
};
27
27
-
}
-7
configs/privoxy.nix
Reviewed
···
1
1
-
{ ... }:
2
2
-
3
3
-
{
4
4
-
services.privoxy = {
5
5
-
enable = true;
6
6
-
};
7
7
-
}
-21
configs/shadowsocks.nix
Reviewed
···
1
1
-
{ config, pkgs, ... }:
2
2
-
{
3
3
-
services.shadowsocks = {
4
4
-
enable = true;
5
5
-
passwordFile = config.clan.core.vars.generators.shadowsocks.files.shadowsocks_password.path;
6
6
-
};
7
7
-
networking.firewall.allowedTCPPorts = [ 8388 ];
8
8
-
clan.core.vars.generators.shadowsocks = {
9
9
-
files."shadowsocks_password" = { };
10
10
-
prompts.password = {
11
11
-
description = "please enter your shadowsocks password";
12
12
-
type = "hidden";
13
13
-
};
14
14
-
runtimeInputs = with pkgs; [
15
15
-
coreutils
16
16
-
];
17
17
-
script = ''
18
18
-
cp "$prompts"/password "$out"/shadowsocks_password
19
19
-
'';
20
20
-
};
21
21
-
}
-113
configs/wiregrill.nix
Reviewed
···
1
1
-
{
2
2
-
config,
3
3
-
lib,
4
4
-
pkgs,
5
5
-
...
6
6
-
}:
7
7
-
with lib;
8
8
-
let
9
9
-
10
10
-
self = config.krebs.build.host.nets.wiregrill;
11
11
-
isRouter = !isNull self.via;
12
12
-
13
13
-
in
14
14
-
mkIf (hasAttr "wiregrill" config.krebs.build.host.nets) {
15
15
-
#hack for modprobe inside containers
16
16
-
systemd.services."wireguard-wiregrill".path = mkIf config.boot.isContainer (mkBefore [
17
17
-
(pkgs.writeDashBin "modprobe" ":")
18
18
-
]);
19
19
-
20
20
-
boot.kernel.sysctl = mkIf isRouter {
21
21
-
"net.ipv6.conf.all.forwarding" = 1;
22
22
-
};
23
23
-
krebs.iptables.tables.filter.INPUT.rules = [
24
24
-
{
25
25
-
predicate = "-p udp --dport ${toString self.wireguard.port}";
26
26
-
target = "ACCEPT";
27
27
-
}
28
28
-
];
29
29
-
krebs.iptables.tables.filter.FORWARD.rules = mkIf isRouter (mkBefore [
30
30
-
{
31
31
-
predicate = "-i wiregrill -o wiregrill";
32
32
-
target = "ACCEPT";
33
33
-
}
34
34
-
{
35
35
-
predicate = "-i wiregrill -o retiolum";
36
36
-
target = "ACCEPT";
37
37
-
}
38
38
-
{
39
39
-
predicate = "-i retiolum -o wiregrill";
40
40
-
target = "ACCEPT";
41
41
-
}
42
42
-
{
43
43
-
predicate = "-i wiregrill -o eth0";
44
44
-
target = "ACCEPT";
45
45
-
}
46
46
-
{
47
47
-
predicate = "-o wiregrill -m conntrack --ctstate RELATED,ESTABLISHED";
48
48
-
target = "ACCEPT";
49
49
-
}
50
50
-
]);
51
51
-
52
52
-
clan.core.vars.generators.wiregrill = {
53
53
-
files."wiregrill.key" = { };
54
54
-
files."wiregrill.pub" = { };
55
55
-
runtimeInputs = with pkgs; [
56
56
-
coreutils
57
57
-
wireguard-tools
58
58
-
];
59
59
-
script = ''
60
60
-
wg genkey > "$out"/wiregrill.key
61
61
-
cat "$out"/wiregrill.key | wg pubkey > "$out"/wiregrill.pub
62
62
-
'';
63
63
-
};
64
64
-
65
65
-
systemd.network.networks.wiregrill = {
66
66
-
matchConfig.Name = "wiregrill";
67
67
-
address =
68
68
-
(optional (!isNull self.ip4) "${self.ip4.addr}/16")
69
69
-
++ (optional (!isNull self.ip6) "${self.ip6.addr}/48");
70
70
-
networkConfig = {
71
71
-
IgnoreCarrierLoss = "10s";
72
72
-
};
73
73
-
};
74
74
-
75
75
-
networking.wireguard.interfaces.wiregrill = {
76
76
-
ips =
77
77
-
(optional (!isNull self.ip4 && !config.systemd.network.enable) self.ip4.addr)
78
78
-
++ (optional (!isNull self.ip6 && !config.systemd.network.enable) self.ip6.addr);
79
79
-
listenPort = 51820;
80
80
-
privateKeyFile = config.clan.core.vars.generators.wiregrill.files."wiregrill.key".path;
81
81
-
allowedIPsAsRoutes = true;
82
82
-
peers =
83
83
-
mapAttrsToList
84
84
-
(_name: host: {
85
85
-
# inherit name;
86
86
-
allowedIPs =
87
87
-
if isRouter then
88
88
-
(optional (!isNull host.nets.wiregrill.ip4) host.nets.wiregrill.ip4.addr)
89
89
-
++ (optional (!isNull host.nets.wiregrill.ip6) host.nets.wiregrill.ip6.addr)
90
90
-
else
91
91
-
host.nets.wiregrill.wireguard.subnets;
92
92
-
endpoint = mkIf (!isNull host.nets.wiregrill.via) (
93
93
-
host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}"
94
94
-
);
95
95
-
persistentKeepalive = mkIf (!isNull host.nets.wiregrill.via) 61;
96
96
-
publicKey = (replaceStrings [ "\n" ] [ "" ] host.nets.wiregrill.wireguard.pubkey);
97
97
-
})
98
98
-
(
99
99
-
filterAttrs (
100
100
-
_: h:
101
101
-
hasAttr "wiregrill" h.nets
102
102
-
&& hasAttr "wireguard" h.nets.wiregrill
103
103
-
&& !isNull h.nets.wiregrill.wireguard
104
104
-
&& (
105
105
-
let
106
106
-
pk = builtins.tryEval h.nets.wiregrill.wireguard.pubkey;
107
107
-
in
108
108
-
pk.success && !isNull pk.value
109
109
-
)
110
110
-
) config.krebs.hosts
111
111
-
);
112
112
-
};
113
113
-
}
-44
configs/antimicrox/default.nix
Reviewed
···
1
1
-
{
2
2
-
config,
3
3
-
lib,
4
4
-
pkgs,
5
5
-
...
6
6
-
}:
7
7
-
{
8
8
-
systemd.services.antimicrox = {
9
9
-
after = [ "display-manager.service" ];
10
10
-
wantedBy = [ "multi-user.target" ];
11
11
-
environment = {
12
12
-
DISPLAY = ":0";
13
13
-
};
14
14
-
serviceConfig = {
15
15
-
User = config.users.users.mainUser.name;
16
16
-
ExecStartPre = lib.singleton (pkgs.writeDash "init_state" "echo 0 > /tmp/gamepad.state");
17
17
-
ExecStart = "${pkgs.antimicrox}/bin/antimicrox --hidden --profile ${./mouse.gamecontroller.amgp}";
18
18
-
};
19
19
-
};
20
20
-
21
21
-
services.udev.extraRules = ''
22
22
-
KERNEL=="uinput", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"
23
23
-
'';
24
24
-
25
25
-
environment.systemPackages = [
26
26
-
pkgs.antimicrox
27
27
-
(pkgs.writers.writeDashBin "gamepad_mouse_disable" ''
28
28
-
echo 1 > /tmp/gamepad.state
29
29
-
${pkgs.antimicrox}/bin/antimicrox --profile ${./empty.gamecontroller.amgp}
30
30
-
'')
31
31
-
(pkgs.writers.writeDashBin "gamepad_mouse_enable" ''
32
32
-
echo 0 > /tmp/gamepad.state
33
33
-
${pkgs.antimicrox}/bin/antimicrox --profile ${./mouse.gamecontroller.amgp}
34
34
-
'')
35
35
-
(pkgs.writers.writeDashBin "gamepad_mouse_toggle" ''
36
36
-
state=$(${pkgs.coreutils}/bin/cat /tmp/gamepad.state)
37
37
-
if [ "$state" = 1 ]; then
38
38
-
/run/current-system/sw/bin/gamepad_mouse_enable
39
39
-
else
40
40
-
/run/current-system/sw/bin/gamepad_mouse_disable
41
41
-
fi
42
42
-
'')
43
43
-
];
44
44
-
}
-20
configs/antimicrox/empty.gamecontroller.amgp
Reviewed
···
1
1
-
<?xml version="1.0" encoding="UTF-8"?>
2
2
-
<gamecontroller configversion="19" appversion="3.3.2">
3
3
-
<!--The SDL name for a joystick is included for informational purposes only.-->
4
4
-
<sdlname>XInput Controller</sdlname>
5
5
-
<!--The Unique ID for a joystick is included for informational purposes only.-->
6
6
-
<uniqueID>030000005e0400008e020000010100001118654</uniqueID>
7
7
-
<stickAxisAssociation index="2" xAxis="3" yAxis="4"/>
8
8
-
<stickAxisAssociation index="1" xAxis="1" yAxis="2"/>
9
9
-
<vdpadButtonAssociations index="1">
10
10
-
<vdpadButtonAssociation axis="0" button="12" direction="1"/>
11
11
-
<vdpadButtonAssociation axis="0" button="13" direction="4"/>
12
12
-
<vdpadButtonAssociation axis="0" button="14" direction="8"/>
13
13
-
<vdpadButtonAssociation axis="0" button="15" direction="2"/>
14
14
-
</vdpadButtonAssociations>
15
15
-
<names>
16
16
-
<controlstickname index="2">R Stick</controlstickname>
17
17
-
<controlstickname index="1">L Stick</controlstickname>
18
18
-
</names>
19
19
-
<sets/>
20
20
-
</gamecontroller>
-281
configs/antimicrox/mouse.gamecontroller.amgp
Reviewed
···
1
1
-
<?xml version="1.0" encoding="UTF-8"?>
2
2
-
<gamecontroller configversion="19" appversion="3.3.2">
3
3
-
<!--The SDL name for a joystick is included for informational purposes only.-->
4
4
-
<sdlname>XInput Controller</sdlname>
5
5
-
<!--The Unique ID for a joystick is included for informational purposes only.-->
6
6
-
<uniqueID>030000005e0400008e020000010100001118654</uniqueID>
7
7
-
<stickAxisAssociation index="2" xAxis="3" yAxis="4"/>
8
8
-
<stickAxisAssociation index="1" xAxis="1" yAxis="2"/>
9
9
-
<vdpadButtonAssociations index="1">
10
10
-
<vdpadButtonAssociation axis="0" button="12" direction="1"/>
11
11
-
<vdpadButtonAssociation axis="0" button="13" direction="4"/>
12
12
-
<vdpadButtonAssociation axis="0" button="14" direction="8"/>
13
13
-
<vdpadButtonAssociation axis="0" button="15" direction="2"/>
14
14
-
</vdpadButtonAssociations>
15
15
-
<names>
16
16
-
<controlstickname index="2">Stick 2</controlstickname>
17
17
-
<controlstickname index="1">Stick 1</controlstickname>
18
18
-
</names>
19
19
-
<sets>
20
20
-
<set index="1">
21
21
-
<stick index="2">
22
22
-
<deadZone>1</deadZone>
23
23
-
<maxZone>29501</maxZone>
24
24
-
<modifierZone>1412</modifierZone>
25
25
-
<diagonalRange>90</diagonalRange>
26
26
-
<squareStick>100</squareStick>
27
27
-
<stickbutton index="1">
28
28
-
<mousespeedx>74</mousespeedx>
29
29
-
<mousespeedy>74</mousespeedy>
30
30
-
<accelerationmultiplier>4</accelerationmultiplier>
31
31
-
<startaccelmultiplier>20</startaccelmultiplier>
32
32
-
<minaccelthreshold>3</minaccelthreshold>
33
33
-
<extraaccelerationcurve>easeoutquad</extraaccelerationcurve>
34
34
-
<slots>
35
35
-
<slot>
36
36
-
<code>1</code>
37
37
-
<mode>mousemovement</mode>
38
38
-
</slot>
39
39
-
</slots>
40
40
-
</stickbutton>
41
41
-
<stickbutton index="3">
42
42
-
<mousespeedx>74</mousespeedx>
43
43
-
<mousespeedy>74</mousespeedy>
44
44
-
<accelerationmultiplier>4</accelerationmultiplier>
45
45
-
<startaccelmultiplier>20</startaccelmultiplier>
46
46
-
<minaccelthreshold>3</minaccelthreshold>
47
47
-
<extraaccelerationcurve>easeoutquad</extraaccelerationcurve>
48
48
-
<slots>
49
49
-
<slot>
50
50
-
<code>4</code>
51
51
-
<mode>mousemovement</mode>
52
52
-
</slot>
53
53
-
</slots>
54
54
-
</stickbutton>
55
55
-
<stickbutton index="2">
56
56
-
<mousespeedx>74</mousespeedx>
57
57
-
<mousespeedy>74</mousespeedy>
58
58
-
</stickbutton>
59
59
-
<stickbutton index="5">
60
60
-
<mousespeedx>74</mousespeedx>
61
61
-
<mousespeedy>74</mousespeedy>
62
62
-
<accelerationmultiplier>4</accelerationmultiplier>
63
63
-
<startaccelmultiplier>20</startaccelmultiplier>
64
64
-
<minaccelthreshold>3</minaccelthreshold>
65
65
-
<extraaccelerationcurve>easeoutquad</extraaccelerationcurve>
66
66
-
<slots>
67
67
-
<slot>
68
68
-
<code>2</code>
69
69
-
<mode>mousemovement</mode>
70
70
-
</slot>
71
71
-
</slots>
72
72
-
</stickbutton>
73
73
-
<stickbutton index="4">
74
74
-
<mousespeedx>74</mousespeedx>
75
75
-
<mousespeedy>74</mousespeedy>
76
76
-
</stickbutton>
77
77
-
<stickbutton index="7">
78
78
-
<mousespeedx>74</mousespeedx>
79
79
-
<mousespeedy>74</mousespeedy>
80
80
-
<accelerationmultiplier>4</accelerationmultiplier>
81
81
-
<startaccelmultiplier>20</startaccelmultiplier>
82
82
-
<minaccelthreshold>3</minaccelthreshold>
83
83
-
<extraaccelerationcurve>easeoutquad</extraaccelerationcurve>
84
84
-
<slots>
85
85
-
<slot>
86
86
-
<code>3</code>
87
87
-
<mode>mousemovement</mode>
88
88
-
</slot>
89
89
-
</slots>
90
90
-
</stickbutton>
91
91
-
<stickbutton index="6">
92
92
-
<mousespeedx>74</mousespeedx>
93
93
-
<mousespeedy>74</mousespeedy>
94
94
-
</stickbutton>
95
95
-
<stickbutton index="8">
96
96
-
<mousespeedx>74</mousespeedx>
97
97
-
<mousespeedy>74</mousespeedy>
98
98
-
</stickbutton>
99
99
-
</stick>
100
100
-
<stick index="1">
101
101
-
<deadZone>2578</deadZone>
102
102
-
<maxZone>30799</maxZone>
103
103
-
<stickbutton index="1">
104
104
-
<mouseacceleration>linear</mouseacceleration>
105
105
-
<slots>
106
106
-
<slot>
107
107
-
<code>4</code>
108
108
-
<mode>mousebutton</mode>
109
109
-
</slot>
110
110
-
</slots>
111
111
-
</stickbutton>
112
112
-
<stickbutton index="3">
113
113
-
<mouseacceleration>linear</mouseacceleration>
114
114
-
<slots>
115
115
-
<slot>
116
116
-
<code>7</code>
117
117
-
<mode>mousebutton</mode>
118
118
-
</slot>
119
119
-
</slots>
120
120
-
</stickbutton>
121
121
-
<stickbutton index="2">
122
122
-
<mouseacceleration>linear</mouseacceleration>
123
123
-
</stickbutton>
124
124
-
<stickbutton index="5">
125
125
-
<mouseacceleration>linear</mouseacceleration>
126
126
-
<slots>
127
127
-
<slot>
128
128
-
<code>5</code>
129
129
-
<mode>mousebutton</mode>
130
130
-
</slot>
131
131
-
</slots>
132
132
-
</stickbutton>
133
133
-
<stickbutton index="4">
134
134
-
<mouseacceleration>linear</mouseacceleration>
135
135
-
</stickbutton>
136
136
-
<stickbutton index="7">
137
137
-
<mouseacceleration>linear</mouseacceleration>
138
138
-
<slots>
139
139
-
<slot>
140
140
-
<code>6</code>
141
141
-
<mode>mousebutton</mode>
142
142
-
</slot>
143
143
-
</slots>
144
144
-
</stickbutton>
145
145
-
<stickbutton index="6">
146
146
-
<mouseacceleration>linear</mouseacceleration>
147
147
-
</stickbutton>
148
148
-
<stickbutton index="8">
149
149
-
<mouseacceleration>linear</mouseacceleration>
150
150
-
</stickbutton>
151
151
-
</stick>
152
152
-
<dpad index="1">
153
153
-
<dpadbutton index="12">
154
154
-
<wheelspeedx>2</wheelspeedx>
155
155
-
<wheelspeedy>10</wheelspeedy>
156
156
-
</dpadbutton>
157
157
-
<dpadbutton index="1">
158
158
-
<wheelspeedx>10</wheelspeedx>
159
159
-
<wheelspeedy>10</wheelspeedy>
160
160
-
<slots>
161
161
-
<slot>
162
162
-
<code>0x1000013</code>
163
163
-
<mode>keyboard</mode>
164
164
-
</slot>
165
165
-
</slots>
166
166
-
</dpadbutton>
167
167
-
<dpadbutton index="3">
168
168
-
<wheelspeedx>2</wheelspeedx>
169
169
-
<wheelspeedy>10</wheelspeedy>
170
170
-
</dpadbutton>
171
171
-
<dpadbutton index="2">
172
172
-
<wheelspeedx>2</wheelspeedx>
173
173
-
<wheelspeedy>10</wheelspeedy>
174
174
-
<slots>
175
175
-
<slot>
176
176
-
<code>0x1000014</code>
177
177
-
<mode>keyboard</mode>
178
178
-
</slot>
179
179
-
</slots>
180
180
-
</dpadbutton>
181
181
-
<dpadbutton index="4">
182
182
-
<wheelspeedx>2</wheelspeedx>
183
183
-
<wheelspeedy>10</wheelspeedy>
184
184
-
<slots>
185
185
-
<slot>
186
186
-
<code>0x1000015</code>
187
187
-
<mode>keyboard</mode>
188
188
-
</slot>
189
189
-
</slots>
190
190
-
</dpadbutton>
191
191
-
<dpadbutton index="6">
192
192
-
<wheelspeedx>2</wheelspeedx>
193
193
-
<wheelspeedy>10</wheelspeedy>
194
194
-
</dpadbutton>
195
195
-
<dpadbutton index="9">
196
196
-
<wheelspeedx>2</wheelspeedx>
197
197
-
<wheelspeedy>10</wheelspeedy>
198
198
-
</dpadbutton>
199
199
-
<dpadbutton index="8">
200
200
-
<wheelspeedx>2</wheelspeedx>
201
201
-
<wheelspeedy>10</wheelspeedy>
202
202
-
<slots>
203
203
-
<slot>
204
204
-
<code>0x1000012</code>
205
205
-
<mode>keyboard</mode>
206
206
-
</slot>
207
207
-
</slots>
208
208
-
</dpadbutton>
209
209
-
</dpad>
210
210
-
<trigger index="6">
211
211
-
<deadZone>2000</deadZone>
212
212
-
<throttle>positivehalf</throttle>
213
213
-
<triggerbutton index="1">
214
214
-
<mousespeedx>100</mousespeedx>
215
215
-
<mousespeedy>100</mousespeedy>
216
216
-
</triggerbutton>
217
217
-
<triggerbutton index="2">
218
218
-
<mousespeedx>100</mousespeedx>
219
219
-
<mousespeedy>100</mousespeedy>
220
220
-
<slots>
221
221
-
<slot>
222
222
-
<code>250</code>
223
223
-
<mode>mousespeedmod</mode>
224
224
-
</slot>
225
225
-
</slots>
226
226
-
</triggerbutton>
227
227
-
</trigger>
228
228
-
<trigger index="5">
229
229
-
<throttle>positivehalf</throttle>
230
230
-
</trigger>
231
231
-
<button index="11">
232
232
-
<slots>
233
233
-
<slot>
234
234
-
<code>1</code>
235
235
-
<mode>mousebutton</mode>
236
236
-
</slot>
237
237
-
</slots>
238
238
-
</button>
239
239
-
<button index="2">
240
240
-
<slots>
241
241
-
<slot>
242
242
-
<code>3</code>
243
243
-
<mode>mousebutton</mode>
244
244
-
</slot>
245
245
-
</slots>
246
246
-
</button>
247
247
-
<button index="1">
248
248
-
<slots>
249
249
-
<slot>
250
250
-
<code>1</code>
251
251
-
<mode>mousebutton</mode>
252
252
-
</slot>
253
253
-
</slots>
254
254
-
</button>
255
255
-
<button index="4">
256
256
-
<slots>
257
257
-
<slot>
258
258
-
<code>0x1000004</code>
259
259
-
<mode>keyboard</mode>
260
260
-
</slot>
261
261
-
</slots>
262
262
-
</button>
263
263
-
<button index="3">
264
264
-
<slots>
265
265
-
<slot>
266
266
-
<code>2</code>
267
267
-
<mode>mousebutton</mode>
268
268
-
</slot>
269
269
-
</slots>
270
270
-
</button>
271
271
-
<button index="5">
272
272
-
<slots>
273
273
-
<slot>
274
274
-
<code>1</code>
275
275
-
<mode>mousebutton</mode>
276
276
-
</slot>
277
277
-
</slots>
278
278
-
</button>
279
279
-
</set>
280
280
-
</sets>
281
281
-
</gamecontroller>
-57
configs/bgt-bot/bgt-check.sh
Reviewed
···
1
1
-
#!/bin/sh
2
2
-
# needs in path:
3
3
-
# curl gnugrep jq
4
4
-
# creates and manages $PWD/state
5
5
-
set -xeuf
6
6
-
7
7
-
send_reaktor(){
8
8
-
# usage: send_reaktor "text"
9
9
-
echo "send_reaktor: $1"
10
10
-
curl -fsS "http://localhost:$REAKTOR_PORT" \
11
11
-
-H content-type:application/json \
12
12
-
-d "$(jq -n \
13
13
-
--arg text "$1" \
14
14
-
--arg channel "$IRC_CHANNEL" \
15
15
-
'{
16
16
-
command:"PRIVMSG",
17
17
-
params:[$channel,$text]
18
18
-
}'
19
19
-
)"
20
20
-
}
21
21
-
22
22
-
live=$(shuf -n1 <<EOF
23
23
-
Binärgewitter Liveshow hat begonnen! http://stream.radiotux.de:8000/binaergewitter.mp3
24
24
-
EOF
25
25
-
)
26
26
-
27
27
-
offline=$(shuf -n1 <<EOF
28
28
-
Live stream vorbei
29
29
-
EOF
30
30
-
)
31
31
-
error=$(shuf -n1 <<EOF
32
32
-
something went wrong
33
33
-
EOF
34
34
-
)
35
35
-
36
36
-
if curl -Ss http://stream.radiotux.de:8000 | grep -q 'Mount Point /binaergewitter'; then
37
37
-
state='live'
38
38
-
else
39
39
-
state='offline'
40
40
-
fi
41
41
-
prevstate=$(cat state ||:)
42
42
-
43
43
-
if test "$state" = "$(cat state)";then
44
44
-
#echo "current and last state is the same ($state), doing nothing"
45
45
-
:
46
46
-
else
47
47
-
echo "API state and last state differ ( '$state' != '$prevstate')"
48
48
-
if test "$state" = 'live';then
49
49
-
send_reaktor "$live"
50
50
-
elif test "$state" = 'offline';then
51
51
-
send_reaktor "$offline"
52
52
-
else
53
53
-
send_reaktor "$error"
54
54
-
fi
55
55
-
echo 'updating state'
56
56
-
printf "%s" "$state" > state
57
57
-
fi
-46
configs/bgt-bot/default.nix
Reviewed
···
1
1
-
{ self, pkgs, ... }:
2
2
-
let
3
3
-
4
4
-
bot_port = "7654";
5
5
-
irc_channel = "#binaergewitter";
6
6
-
in
7
7
-
{
8
8
-
imports = [
9
9
-
self.inputs.stockholm.nixosModules.reaktor2
10
10
-
];
11
11
-
krebs.reaktor2.bgt-announce = {
12
12
-
hostname = "irc.libera.chat";
13
13
-
port = "6697";
14
14
-
nick = "bgt-announce";
15
15
-
API.listen = "inet://127.0.0.1:${bot_port}";
16
16
-
plugins = [
17
17
-
{
18
18
-
plugin = "register";
19
19
-
config = {
20
20
-
channels = [
21
21
-
irc_channel
22
22
-
];
23
23
-
};
24
24
-
}
25
25
-
];
26
26
-
};
27
27
-
systemd.services.check_bgt_show = {
28
28
-
startAt = "*:0/5";
29
29
-
environment = {
30
30
-
IRC_CHANNEL = irc_channel;
31
31
-
REAKTOR_PORT = bot_port;
32
32
-
};
33
33
-
path = with pkgs; [
34
34
-
curl
35
35
-
gnugrep
36
36
-
jq
37
37
-
];
38
38
-
script = builtins.readFile ./bgt-check.sh;
39
39
-
serviceConfig = {
40
40
-
DynamicUser = true;
41
41
-
StateDirectory = "bgt-announce";
42
42
-
WorkingDirectory = "/var/lib/bgt-announce";
43
43
-
PrivateTmp = true;
44
44
-
};
45
45
-
};
46
46
-
}
-12
configs/binary-cache/client.nix
Reviewed
···
1
1
-
{
2
2
-
nix.settings = {
3
3
-
substituters = [
4
4
-
"http://cache.neoprism.r"
5
5
-
"https://cache.nixos.org/"
6
6
-
];
7
7
-
trusted-public-keys = [
8
8
-
"cache.prism-2:YwmCm3/s/D+SxrPKN/ETjlpw/219pNUbpnluatp6FKI="
9
9
-
"hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs="
10
10
-
];
11
11
-
};
12
12
-
}
-13
configs/binary-cache/proxy.nix
Reviewed
···
1
1
-
{ ... }:
2
2
-
{
3
3
-
services.nginx = {
4
4
-
enable = true;
5
5
-
virtualHosts."cache.krebsco.de" = {
6
6
-
enableACME = true;
7
7
-
forceSSL = true;
8
8
-
locations."/".extraConfig = ''
9
9
-
proxy_pass http://cache.neoprism.r/;
10
10
-
'';
11
11
-
};
12
12
-
};
13
13
-
}
-41
configs/binary-cache/server.nix
Reviewed
···
1
1
-
{ config, pkgs, ... }:
2
2
-
{
3
3
-
# nixpkgs.config.packageOverrides = p: {
4
4
-
# nix-serve = p.haskellPackages.nix-serve-ng;
5
5
-
# };
6
6
-
# generate private key with:
7
7
-
# nix-store --generate-binary-cache-key my-secret-key my-public-key
8
8
-
clan.core.vars.generators.nix-serve = {
9
9
-
files."nix-serve.key" = { };
10
10
-
files."nix-serve.pub" = { };
11
11
-
runtimeInputs = with pkgs; [
12
12
-
coreutils
13
13
-
nix
14
14
-
];
15
15
-
script = ''
16
16
-
nix-store --generate-binary-cache-key "$out"/nix-serve.key "$out"/nix-serve.pub
17
17
-
'';
18
18
-
};
19
19
-
services.nix-serve = {
20
20
-
enable = true;
21
21
-
secretKeyFile = config.clan.core.vars.generators.nix-serve.files."nix-serve.key".path;
22
22
-
port = 5005;
23
23
-
};
24
24
-
25
25
-
services.nginx = {
26
26
-
enable = true;
27
27
-
virtualHosts.nix-serve = {
28
28
-
serverAliases = [ "cache.${config.networking.hostName}.r" ];
29
29
-
locations."/".extraConfig = ''
30
30
-
proxy_pass http://localhost:${toString config.services.nix-serve.port};
31
31
-
'';
32
32
-
locations."= /nix-cache-info".extraConfig = ''
33
33
-
alias ${pkgs.writeText "cache-info" ''
34
34
-
StoreDir: /nix/store
35
35
-
WantMassQuery: 1
36
36
-
Priority: 42
37
37
-
''};
38
38
-
'';
39
39
-
};
40
40
-
};
41
41
-
}
-125
configs/hw/brcmfmac4356-pcie.txt
Reviewed
···
1
1
-
# Sample variables file for BCM94356Z NGFF 22x30mm iPA, iLNA board with PCIe for production package
2
2
-
NVRAMRev=$Rev: 492104 $
3
3
-
#4356 chip = 4354 A2 chip
4
4
-
sromrev=11
5
5
-
boardrev=0x1102
6
6
-
boardtype=0x073e
7
7
-
boardflags=0x02400201
8
8
-
#0x2000 enable 2G spur WAR
9
9
-
boardflags2=0x00802000
10
10
-
boardflags3=0x0000000a
11
11
-
#boardflags3 0x00000100 /* to read swctrlmap from nvram*/
12
12
-
#define BFL3_5G_SPUR_WAR 0x00080000 /* enable spur WAR in 5G band */
13
13
-
#define BFL3_AvVim 0x40000000 /* load AvVim from nvram */
14
14
-
macaddr=00:90:4c:1a:10:01
15
15
-
ccode=0x5854
16
16
-
regrev=205
17
17
-
antswitch=0
18
18
-
pdgain5g=4
19
19
-
pdgain2g=4
20
20
-
tworangetssi2g=0
21
21
-
tworangetssi5g=0
22
22
-
paprdis=0
23
23
-
femctrl=10
24
24
-
vendid=0x14e4
25
25
-
devid=0x43ec
26
26
-
manfid=0x2d0
27
27
-
#prodid=0x052e
28
28
-
nocrc=1
29
29
-
otpimagesize=502
30
30
-
xtalfreq=37400
31
31
-
rxgains2gelnagaina0=0
32
32
-
rxgains2gtrisoa0=7
33
33
-
rxgains2gtrelnabypa0=0
34
34
-
rxgains5gelnagaina0=0
35
35
-
rxgains5gtrisoa0=11
36
36
-
rxgains5gtrelnabypa0=0
37
37
-
rxgains5gmelnagaina0=0
38
38
-
rxgains5gmtrisoa0=13
39
39
-
rxgains5gmtrelnabypa0=0
40
40
-
rxgains5ghelnagaina0=0
41
41
-
rxgains5ghtrisoa0=12
42
42
-
rxgains5ghtrelnabypa0=0
43
43
-
rxgains2gelnagaina1=0
44
44
-
rxgains2gtrisoa1=7
45
45
-
rxgains2gtrelnabypa1=0
46
46
-
rxgains5gelnagaina1=0
47
47
-
rxgains5gtrisoa1=10
48
48
-
rxgains5gtrelnabypa1=0
49
49
-
rxgains5gmelnagaina1=0
50
50
-
rxgains5gmtrisoa1=11
51
51
-
rxgains5gmtrelnabypa1=0
52
52
-
rxgains5ghelnagaina1=0
53
53
-
rxgains5ghtrisoa1=11
54
54
-
rxgains5ghtrelnabypa1=0
55
55
-
rxchain=3
56
56
-
txchain=3
57
57
-
aa2g=3
58
58
-
aa5g=3
59
59
-
agbg0=2
60
60
-
agbg1=2
61
61
-
aga0=2
62
62
-
aga1=2
63
63
-
tssipos2g=1
64
64
-
extpagain2g=2
65
65
-
tssipos5g=1
66
66
-
extpagain5g=2
67
67
-
tempthresh=255
68
68
-
tempoffset=255
69
69
-
rawtempsense=0x1ff
70
70
-
pa2ga0=-147,6192,-705
71
71
-
pa2ga1=-161,6041,-701
72
72
-
pa5ga0=-194,6069,-739,-188,6137,-743,-185,5931,-725,-171,5898,-715
73
73
-
pa5ga1=-190,6248,-757,-190,6275,-759,-190,6225,-757,-184,6131,-746
74
74
-
subband5gver=0x4
75
75
-
pdoffsetcckma0=0x4
76
76
-
pdoffsetcckma1=0x4
77
77
-
pdoffset40ma0=0x0000
78
78
-
pdoffset80ma0=0x0000
79
79
-
pdoffset40ma1=0x0000
80
80
-
pdoffset80ma1=0x0000
81
81
-
maxp2ga0=76
82
82
-
maxp5ga0=74,74,74,74
83
83
-
maxp2ga1=76
84
84
-
maxp5ga1=74,74,74,74
85
85
-
cckbw202gpo=0x0000
86
86
-
cckbw20ul2gpo=0x0000
87
87
-
mcsbw202gpo=0x99644422
88
88
-
mcsbw402gpo=0x99644422
89
89
-
dot11agofdmhrbw202gpo=0x6666
90
90
-
ofdmlrbw202gpo=0x0022
91
91
-
mcsbw205glpo=0x88766663
92
92
-
mcsbw405glpo=0x88666663
93
93
-
mcsbw805glpo=0xbb666665
94
94
-
mcsbw205gmpo=0xd8666663
95
95
-
mcsbw405gmpo=0x88666663
96
96
-
mcsbw805gmpo=0xcc666665
97
97
-
mcsbw205ghpo=0xdc666663
98
98
-
mcsbw405ghpo=0xaa666663
99
99
-
mcsbw805ghpo=0xdd666665
100
100
-
mcslr5glpo=0x0000
101
101
-
mcslr5gmpo=0x0000
102
102
-
mcslr5ghpo=0x0000
103
103
-
sb20in40hrpo=0x0
104
104
-
sb20in80and160hr5glpo=0x0
105
105
-
sb40and80hr5glpo=0x0
106
106
-
sb20in80and160hr5gmpo=0x0
107
107
-
sb40and80hr5gmpo=0x0
108
108
-
sb20in80and160hr5ghpo=0x0
109
109
-
sb40and80hr5ghpo=0x0
110
110
-
sb20in40lrpo=0x0
111
111
-
sb20in80and160lr5glpo=0x0
112
112
-
sb40and80lr5glpo=0x0
113
113
-
sb20in80and160lr5gmpo=0x0
114
114
-
sb40and80lr5gmpo=0x0
115
115
-
sb20in80and160lr5ghpo=0x0
116
116
-
sb40and80lr5ghpo=0x0
117
117
-
dot11agduphrpo=0x0
118
118
-
dot11agduplrpo=0x0
119
119
-
phycal_tempdelta=255
120
120
-
temps_period=15
121
121
-
temps_hysteresis=15
122
122
-
rssicorrnorm_c0=4,4
123
123
-
rssicorrnorm_c1=4,4
124
124
-
rssicorrnorm5g_c0=1,2,3,1,2,3,6,6,8,6,6,8
125
125
-
rssicorrnorm5g_c1=1,2,3,2,2,2,7,7,8,7,7,8
-208
configs/monitoring/alert-rules.nix
Reviewed
···
1
1
-
# inspiration from https://github.com/Mic92/dotfiles/blob/master/nixos/eva/modules/prometheus/alert-rules.nix
2
2
-
{ lib }:
3
3
-
4
4
-
lib.mapAttrsToList
5
5
-
(name: opts: {
6
6
-
alert = name;
7
7
-
expr = opts.condition;
8
8
-
for = opts.time or "2m";
9
9
-
labels = { };
10
10
-
annotations.description = opts.description;
11
11
-
})
12
12
-
({
13
13
-
prometheus_too_many_restarts = {
14
14
-
condition = ''changes(process_start_time_seconds{job=~"prometheus|pushgateway|alertmanager|telegraf"}[15m]) > 2'';
15
15
-
description = "Prometheus has restarted more than twice in the last 15 minutes. It might be crashlooping.";
16
16
-
};
17
17
-
18
18
-
alert_manager_config_not_synced = {
19
19
-
condition = ''count(count_values("config_hash", alertmanager_config_hash)) > 1'';
20
20
-
description = "Configurations of AlertManager cluster instances are out of sync.";
21
21
-
};
22
22
-
23
23
-
prometheus_not_connected_to_alertmanager = {
24
24
-
condition = "prometheus_notifications_alertmanagers_discovered < 1";
25
25
-
description = "Prometheus cannot connect the alertmanager\n VALUE = {{ $value }}\n LABELS = {{ $labels }}";
26
26
-
};
27
27
-
28
28
-
prometheus_rule_evaluation_failures = {
29
29
-
condition = "increase(prometheus_rule_evaluation_failures_total[3m]) > 0";
30
30
-
description = "Prometheus encountered {{ $value }} rule evaluation failures, leading to potentially ignored alerts.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}";
31
31
-
};
32
32
-
33
33
-
prometheus_template_expansion_failures = {
34
34
-
condition = "increase(prometheus_template_text_expansion_failures_total[3m]) > 0";
35
35
-
time = "0m";
36
36
-
description = "Prometheus encountered {{ $value }} template text expansion failures\n VALUE = {{ $value }}\n LABELS = {{ $labels }}";
37
37
-
};
38
38
-
39
39
-
promtail_request_errors = {
40
40
-
condition = ''100 * sum(rate(promtail_request_duration_seconds_count{status_code=~"5..|failed"}[1m])) by (namespace, job, route, instance) / sum(rate(promtail_request_duration_seconds_count[1m])) by (namespace, job, route, instance) > 10'';
41
41
-
time = "15m";
42
42
-
description = ''{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors.'';
43
43
-
};
44
44
-
45
45
-
promtail_file_lagging = {
46
46
-
condition = "abs(promtail_file_bytes_total - promtail_read_bytes_total) > 1e6";
47
47
-
time = "15m";
48
48
-
description = "{{ $labels.instance }} {{ $labels.job }} {{ $labels.path }} has been lagging by more than 1MB for more than 15m.";
49
49
-
};
50
50
-
51
51
-
filesystem_full_80percent = {
52
52
-
condition = ''disk_used_percent{mode!="ro"} >= 95'';
53
53
-
time = "10m";
54
54
-
description = "{{$labels.instance}} device {{$labels.device}} on {{$labels.path}} got less than 20% space left on its filesystem.";
55
55
-
};
56
56
-
57
57
-
filesystem_full_krebs = {
58
58
-
condition = ''disk_used_percent{mode!="ro", org="krebs"} >= 95'';
59
59
-
time = "10m";
60
60
-
description = "{{$labels.instance}} device {{$labels.device}} on {{$labels.path}} got less than 5% space left on its filesystem.";
61
61
-
};
62
62
-
63
63
-
filesystem_inodes_full = {
64
64
-
condition = "disk_inodes_free / disk_inodes_total < 0.10";
65
65
-
time = "10m";
66
66
-
description = "{{$labels.instance}} device {{$labels.device}} on {{$labels.path}} got less than 10% inodes left on its filesystem.";
67
67
-
};
68
68
-
69
69
-
daily_task_not_run = {
70
70
-
# give 6 hours grace period
71
71
-
condition = ''time() - task_last_run{state="ok",frequency="daily"} > (24 + 6) * 60 * 60'';
72
72
-
description = "{{$labels.host}}: {{$labels.name}} was not run in the last 24h";
73
73
-
};
74
74
-
75
75
-
daily_task_failed = {
76
76
-
condition = ''task_last_run{state="fail"}'';
77
77
-
description = "{{$labels.host}}: {{$labels.name}} failed to run";
78
78
-
};
79
79
-
80
80
-
swap_using_30percent = {
81
81
-
condition = "mem_swap_total - (mem_swap_cached + mem_swap_free) > mem_swap_total * 0.3";
82
82
-
time = "30m";
83
83
-
description = "{{$labels.host}} is using 30% of its swap space for at least 30 minutes.";
84
84
-
};
85
85
-
86
86
-
systemd_service_failed = {
87
87
-
condition = ''systemd_units_active_code{name!~"nixpkgs-update-.*.service"} == 3'';
88
88
-
description = "{{$labels.host}} failed to (re)start service {{$labels.name}}.";
89
89
-
};
90
90
-
91
91
-
service_not_running = {
92
92
-
condition = ''systemd_units_active_code{name=~"teamspeak3-server.service|tt-rss.service", sub!="running"}'';
93
93
-
description = "{{$labels.host}} should have a running {{$labels.name}}.";
94
94
-
};
95
95
-
96
96
-
nfs_export_not_present = {
97
97
-
condition = "nfs_export_present == 0";
98
98
-
time = "1h";
99
99
-
description = "{{$labels.host}} cannot reach nfs export [{{$labels.server}}]:{{$labels.path}}";
100
100
-
};
101
101
-
102
102
-
ram_using_90percent = {
103
103
-
condition = "mem_buffered + mem_free + mem_cached < mem_total * 0.1";
104
104
-
time = "1h";
105
105
-
description = "{{$labels.host}} is using at least 90% of its RAM for at least 1 hour.";
106
106
-
};
107
107
-
load15 = {
108
108
-
condition = ''system_load15 / system_n_cpus{org!="nix-community"} >= 2.0'';
109
109
-
time = "10m";
110
110
-
description = "{{$labels.host}} is running with load15 > 1 for at least 5 minutes: {{$value}}";
111
111
-
};
112
112
-
reboot = {
113
113
-
condition = "system_uptime < 300";
114
114
-
description = "{{$labels.host}} just rebooted.";
115
115
-
};
116
116
-
uptime = {
117
117
-
# too scared to upgrade matchbox
118
118
-
condition = ''system_uptime {host!~"^(matchbox|grandalf)$"} > 2592000'';
119
119
-
description = "Uptime monster: {{$labels.host}} has been up for more than 30 days.";
120
120
-
};
121
121
-
telegraf_down = {
122
122
-
condition = ''min(up{job=~"telegraf",type!='mobile'}) by (source, job, instance, org) == 0'';
123
123
-
time = "3m";
124
124
-
description = "{{$labels.instance}}: {{$labels.job}} telegraf exporter from {{$labels.source}} is down.";
125
125
-
};
126
126
-
ping = {
127
127
-
condition = "ping_result_code{type!='mobile'} != 0";
128
128
-
description = "{{$labels.url}}: ping from {{$labels.instance}} has failed!";
129
129
-
};
130
130
-
ping_high_latency = {
131
131
-
condition = "ping_average_response_ms{type!='mobile'} > 5000";
132
132
-
description = "{{$labels.instance}}: ping probe from {{$labels.source}} is encountering high latency!";
133
133
-
};
134
134
-
http = {
135
135
-
condition = "http_response_result_code != 0";
136
136
-
description = "{{$labels.server}} : http request failed from {{$labels.instance}}: {{$labels.result}}!";
137
137
-
};
138
138
-
http_match_failed = {
139
139
-
condition = "http_response_response_string_match == 0";
140
140
-
description = "{{$labels.server}} : http body not as expected; status code: {{$labels.status_code}}!";
141
141
-
};
142
142
-
dns_query = {
143
143
-
condition = "dns_query_result_code != 0";
144
144
-
description = "{{$labels.domain}} : could retrieve A record {{$labels.instance}} from server {{$labels.server}}: {{$labels.result}}!";
145
145
-
};
146
146
-
secure_dns_query = {
147
147
-
condition = "secure_dns_state != 0";
148
148
-
description = "{{$labels.domain}} : could retrieve A record {{$labels.instance}} from server {{$labels.server}}: {{$labels.result}} for protocol {{$labels.protocol}}!";
149
149
-
};
150
150
-
connection_failed = {
151
151
-
condition = "net_response_result_code != 0";
152
152
-
description = "{{$labels.server}}: connection to {{$labels.port}}({{$labels.protocol}}) failed from {{$labels.instance}}";
153
153
-
};
154
154
-
healthchecks = {
155
155
-
condition = "hc_check_up == 0";
156
156
-
description = "{{$labels.instance}}: healtcheck {{$labels.job}} fails!";
157
157
-
};
158
158
-
cert_expiry = {
159
159
-
condition = "x509_cert_expiry < 7*24*3600";
160
160
-
description = "{{$labels.instance}}: The TLS certificate from {{$labels.source}} will expire in less than 7 days: {{$value}}s";
161
161
-
};
162
162
-
163
163
-
postfix_queue_length = {
164
164
-
condition = "avg_over_time(postfix_queue_length[1h]) > 10";
165
165
-
description = "{{$labels.instance}}: postfix mail queue has undelivered {{$value}} items";
166
166
-
};
167
167
-
168
168
-
zfs_errors = {
169
169
-
condition = "zfs_arcstats_l2_io_error + zfs_dmu_tx_error + zfs_arcstats_l2_writes_error > 0";
170
170
-
description = "{{$labels.instance}} reports: {{$value}} ZFS IO errors.";
171
171
-
};
172
172
-
173
173
-
# ignore devices that disabled S.M.A.R.T (example if attached via USB)
174
174
-
smart_errors = {
175
175
-
condition = ''smart_device_health_ok{enabled!="Disabled"} != 1'';
176
176
-
description = "{{$labels.instance}}: S.M.A.R.T reports: {{$labels.device}} ({{$labels.model}}) has errors.";
177
177
-
};
178
178
-
179
179
-
oom_kills = {
180
180
-
condition = "increase(kernel_vmstat_oom_kill[5m]) > 0";
181
181
-
description = "{{$labels.instance}}: OOM kill detected";
182
182
-
};
183
183
-
184
184
-
unusual_disk_read_latency = {
185
185
-
condition = "rate(diskio_read_time[1m]) / rate(diskio_reads[1m]) > 0.1 and rate(diskio_reads[1m]) > 0";
186
186
-
description = "{{$labels.instance}}: Disk latency is growing (read operations > 100ms)\n";
187
187
-
};
188
188
-
189
189
-
unusual_disk_write_latency = {
190
190
-
condition = "rate(diskio_write_time[1m]) / rate(diskio_write[1m]) > 0.1 and rate(diskio_write[1m]) > 0";
191
191
-
description = "{{$labels.instance}}: Disk latency is growing (write operations > 100ms)\n";
192
192
-
};
193
193
-
194
194
-
host_memory_under_memory_pressure = {
195
195
-
condition = "rate(node_vmstat_pgmajfault[1m]) > 1000";
196
196
-
description = "{{$labels.instance}}: The node is under heavy memory pressure. High rate of major page faults: {{$value}}";
197
197
-
};
198
198
-
199
199
-
ext4_errors = {
200
200
-
condition = "ext4_errors_value > 0";
201
201
-
description = "{{$labels.instance}}: ext4 has reported {{$value}} I/O errors: check /sys/fs/ext4/*/errors_count";
202
202
-
};
203
203
-
204
204
-
alerts_silences_changed = {
205
205
-
condition = ''abs(delta(alertmanager_silences{state="active"}[1h])) >= 1'';
206
206
-
description = "alertmanager: number of active silences has changed: {{$value}}";
207
207
-
};
208
208
-
})
-119
configs/monitoring/prometheus.nix
Reviewed
···
1
1
-
{ lib, pkgs, ... }:
2
2
-
{
3
3
-
#prometheus
4
4
-
krebs.iptables = {
5
5
-
enable = true;
6
6
-
tables.filter.INPUT.rules = [
7
7
-
{
8
8
-
predicate = "-i retiolum -p tcp --dport 80";
9
9
-
target = "ACCEPT";
10
10
-
} # nginx
11
11
-
# { predicate = "-i retiolum -p tcp --dport 3012"; target = "ACCEPT"; } # grafana
12
12
-
# { predicate = "-i retiolum -p tcp --dport 9093"; target = "ACCEPT"; } # alertmanager
13
13
-
# { predicate = "-i retiolum -p tcp --dport 9223"; target = "ACCEPT"; } # alertmanager
14
14
-
];
15
15
-
};
16
16
-
17
17
-
services.nginx = {
18
18
-
enable = true;
19
19
-
virtualHosts = {
20
20
-
"prometheus.lass.r" = {
21
21
-
locations."/".proxyPass = "http://localhost:9090";
22
22
-
};
23
23
-
"alert.lass.r" = {
24
24
-
locations."/".proxyPass = "http://localhost:9093";
25
25
-
};
26
26
-
"grafana.lass.r" = {
27
27
-
locations."/".proxyPass = "http://localhost:3012";
28
28
-
};
29
29
-
};
30
30
-
};
31
31
-
32
32
-
services.grafana = {
33
33
-
enable = true;
34
34
-
addr = "0.0.0.0";
35
35
-
port = 3012;
36
36
-
auth.anonymous = {
37
37
-
enable = true;
38
38
-
org_role = "Admin";
39
39
-
};
40
40
-
};
41
41
-
services.prometheus = {
42
42
-
enable = true;
43
43
-
ruleFiles = [
44
44
-
(pkgs.writeText "prometheus-rules.yml" (
45
45
-
builtins.toJSON {
46
46
-
groups = [
47
47
-
{
48
48
-
name = "alerting-rules";
49
49
-
rules = import ./alert-rules.nix { inherit lib; };
50
50
-
}
51
51
-
];
52
52
-
}
53
53
-
))
54
54
-
];
55
55
-
scrapeConfigs = [
56
56
-
{
57
57
-
job_name = "telegraf";
58
58
-
scrape_interval = "60s";
59
59
-
metrics_path = "/metrics";
60
60
-
static_configs = [
61
61
-
{
62
62
-
targets = [
63
63
-
"neoprism.r:9273"
64
64
-
"yellow.r:9273"
65
65
-
];
66
66
-
}
67
67
-
];
68
68
-
}
69
69
-
];
70
70
-
alertmanagers = [
71
71
-
{
72
72
-
scheme = "http";
73
73
-
path_prefix = "/";
74
74
-
static_configs = [ { targets = [ "localhost:9093" ]; } ];
75
75
-
}
76
76
-
];
77
77
-
alertmanager = {
78
78
-
enable = true;
79
79
-
webExternalUrl = "https://alert.lass.r";
80
80
-
listenAddress = "[::1]";
81
81
-
configuration = {
82
82
-
global = {
83
83
-
# The smarthost and SMTP sender used for mail notifications.
84
84
-
smtp_smarthost = "localhost:587";
85
85
-
smtp_from = "alertmanager@alert.lass.r";
86
86
-
# smtp_auth_username = "alertmanager@thalheim.io";
87
87
-
# smtp_auth_password = "$SMTP_PASSWORD";
88
88
-
};
89
89
-
route = {
90
90
-
receiver = "default";
91
91
-
routes = [
92
92
-
{
93
93
-
group_by = [ "host" ];
94
94
-
group_wait = "30s";
95
95
-
group_interval = "2m";
96
96
-
repeat_interval = "2h";
97
97
-
receiver = "all";
98
98
-
}
99
99
-
];
100
100
-
};
101
101
-
receivers = [
102
102
-
{
103
103
-
name = "all";
104
104
-
webhook_configs = [
105
105
-
{
106
106
-
url = "http://127.0.0.1:9223/";
107
107
-
max_alerts = 5;
108
108
-
}
109
109
-
];
110
110
-
}
111
111
-
{
112
112
-
name = "default";
113
113
-
}
114
114
-
];
115
115
-
};
116
116
-
};
117
117
-
};
118
118
-
119
119
-
}
-20
configs/websites/domsen.nix
Reviewed
···
1
1
-
{
2
2
-
lib,
3
3
-
pkgs,
4
4
-
...
5
5
-
}:
6
6
-
7
7
-
let
8
8
-
inherit (import ./util.nix { inherit lib pkgs; })
9
9
-
servePage
10
10
-
;
11
11
-
in
12
12
-
{
13
13
-
imports = [
14
14
-
./default.nix
15
15
-
(servePage [
16
16
-
"illustra.de"
17
17
-
"www.illustra.de"
18
18
-
])
19
19
-
];
20
20
-
}
-12
configs/websites/flix.lassul.us.nix
Reviewed
···
1
1
-
{ ... }:
2
2
-
{
3
3
-
services.nginx.virtualHosts."flix.lassul.us" = {
4
4
-
forceSSL = true;
5
5
-
enableACME = true;
6
6
-
locations."/" = {
7
7
-
proxyPass = "http://yellow.r:8096";
8
8
-
proxyWebsockets = true;
9
9
-
recommendedProxySettings = true;
10
10
-
};
11
11
-
};
12
12
-
}
-21
configs/websites/util.nix
Reviewed
···
1
1
-
{ lib, ... }:
2
2
-
3
3
-
with lib;
4
4
-
5
5
-
{
6
6
-
servePage =
7
7
-
domains:
8
8
-
let
9
9
-
domain = head domains;
10
10
-
in
11
11
-
{
12
12
-
services.nginx.virtualHosts.${domain} = {
13
13
-
enableACME = true;
14
14
-
addSSL = true;
15
15
-
serverAliases = domains;
16
16
-
locations."/".extraConfig = ''
17
17
-
root /srv/http/${domain};
18
18
-
'';
19
19
-
};
20
20
-
};
21
21
-
}
-20
configs/weron/client.nix
Reviewed
···
1
1
-
{ pkgs, ... }:
2
2
-
{
3
3
-
systemd.services.weron = {
4
4
-
wantedBy = [ "multi-user.target" ];
5
5
-
environment = {
6
6
-
WERON_RADDR = "ws://lassul.us:23420/";
7
7
-
};
8
8
-
serviceConfig = {
9
9
-
ExecStart = pkgs.writers.writeDash "weron" ''
10
10
-
${pkgs.weron}/bin/weron vpn ip \
11
11
-
--community krebs \
12
12
-
--password aidsballs \
13
13
-
--key aidsballs \
14
14
-
--ips 10.249.1.0/24 \
15
15
-
--verbose 7 \
16
16
-
--dev weron
17
17
-
'';
18
18
-
};
19
19
-
};
20
20
-
}
-2
machines/aergia/config.nix
View file
Reviewed
···
10
10
../../configs/yellow-mounts/samba.nix
11
11
../../configs/pass.nix
12
12
../../configs/mail.nix
13
13
-
# ../../configs/bitcoin.nix
14
13
# ../../configs/review.nix
15
14
# ../../configs/dunst.nix
16
15
../../configs/br.nix
17
17
-
# ../../configs/c-base.nix
18
16
];
19
17
20
18
system.stateVersion = "22.11";
-1
machines/aergia/physical.nix
View file
Reviewed
···
3
3
imports = [
4
4
./config.nix
5
5
(modulesPath + "/installer/scan/not-detected.nix")
6
6
-
# ../../configs/antimicrox
7
6
./disk.nix
8
7
];
9
8
-2
machines/ignavia/config.nix
View file
Reviewed
···
30
30
../../configs/mail.nix
31
31
../../configs/printing
32
32
../../configs/auto-timezone.nix
33
33
-
# ../../configs/bitcoin.nix
34
33
../../configs/review.nix
35
34
../../configs/dunst.nix
36
35
../../configs/yggdrasil.nix
···
39
38
../../configs/herdr.nix
40
39
../../configs/tablet-screen.nix
41
40
# ../../configs/br.nix
42
42
-
# ../../configs/c-base.nix
43
41
];
44
42
45
43
system.stateVersion = "23.11";
-3
machines/neoprism/config.nix
View file
Reviewed
···
86
86
# realwallpaper generator
87
87
../../configs/realwallpaper.nix
88
88
89
89
-
# binaergewitter announce bot
90
90
-
# ../../configs/bgt-bot
91
91
-
92
89
# paste + cyberlocker
93
90
../../configs/paste.nix
94
91
configs/tests/dummy-secrets/cbase.txt
Reviewed
-1
configs/tests/dummy-secrets/icecast-admin-pw
Reviewed
···
1
1
-
"blabla"
-1
configs/tests/dummy-secrets/icecast-source-pw
Reviewed
···
1
1
-
"blabla"
-3
configs/tests/dummy-secrets/lassul.us.dkim.priv
Reviewed
···
1
1
-
-----BEGIN RSA PRIVATE KEY-----
2
2
-
this is a private key
3
3
-
-----END RSA PRIVATE KEY-----
-1
configs/tests/dummy-secrets/mysql_rootPassword
Reviewed
···
1
1
-
blabla123
-1
configs/tests/dummy-secrets/nix-serve.key
Reviewed
···
1
1
-
key-name:blabla123
configs/tests/dummy-secrets/nordvpn.txt
Reviewed
-4
configs/tests/dummy-secrets/retiolum.rsa_key.priv
Reviewed
···
1
1
-
2
2
-
-----BEGIN RSA PRIVATE KEY-----
3
3
-
this is a private key
4
4
-
-----END RSA PRIVATE KEY-----
-1
configs/tests/dummy-secrets/searx.key
Reviewed
···
1
1
-
yolo
configs/tests/dummy-secrets/ssh-tor.priv
Reviewed
-3
configs/tests/dummy-secrets/ssh.id_ed25519
Reviewed
···
1
1
-
-----BEGIN OPENSSH PRIVATE KEY-----
2
2
-
private key bla
3
3
-
-----END OPENSSH PRIVATE KEY-----
-3
configs/tests/dummy-secrets/ssh.id_rsa
Reviewed
···
1
1
-
-----BEGIN RSA PRIVATE KEY-----
2
2
-
private key bla
3
3
-
-----END RSA PRIVATE KEY-----
configs/tests/dummy-secrets/syncthing.cert
Reviewed
configs/tests/dummy-secrets/syncthing.key
Reviewed
-3
configs/tests/dummy-secrets/torrent-auth
Reviewed
···
1
1
-
{
2
2
-
x = "xxx";
3
3
-
}
-1
configs/tests/dummy-secrets/transmission-pw
Reviewed
···
1
1
-
"krebskrebs123"
configs/tests/dummy-secrets/initrd/ssh.ed25519_key
Reviewed