2configs
antimicrox
bgt-bot
binary-cache
desktops
dns
green-hosts
hass
hw
mail
monitoring
ppp
services
coms
flix
git
matrix
nixcache
pad
radio
site
tests
websites
weron
yellow-mounts
3modules
5pkgs
autowifi
bank
emot-menu
htmlparser
init
knav
mycelium
nichtparasoup
nm-dmenu
otpmenu
review-mail-queue
searx
unimenu
xonsh2
darwin
machines
aergia
blue
coaxmetal
daedalus
dishfire
green
hilum
icarus
ignavia
lasspi
mors
neoprism
orange
prism
radio
shodan
styx
ubik
virtulus
xerxes
yellow
tools
···
52
52
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
53
53
};
54
54
55
55
-
outputs = inputs@{ self, flake-parts, nixpkgs, clan-core, ... }:
56
56
-
let
57
57
-
clan = clan-core.lib.buildClan {
58
58
-
directory = self;
59
59
-
specialArgs.self = self;
60
60
-
machines = nixpkgs.lib.mapAttrs (machineName: _: {
55
55
+
outputs =
56
56
+
inputs@{
57
57
+
self,
58
58
+
flake-parts,
59
59
+
nixpkgs,
60
60
+
clan-core,
61
61
+
...
62
62
+
}:
63
63
+
let
64
64
+
clan = clan-core.lib.buildClan {
65
65
+
directory = self;
66
66
+
specialArgs.self = self;
67
67
+
machines = nixpkgs.lib.mapAttrs (machineName: _: {
61
68
62
62
-
imports = [
63
63
-
./machines/${machineName}/physical.nix
64
64
-
({ config, pkgs, ... }: {
65
65
-
clan.core.machineName = machineName;
66
66
-
clan.core.facts.secretStore = "password-store";
67
67
-
clan.core.facts.secretUploadDirectory = nixpkgs.lib.mkDefault "/etc/secrets";
68
68
-
clan.networking.targetHost = "root@${machineName}";
69
69
-
krebs.secret.directory = config.clanCore.facts.secretUploadDirectory;
70
70
-
nixpkgs.overlays = [
71
71
-
self.inputs.stockholm.overlays.default
72
72
-
(import (self.inputs.stockholm.inputs.nix-writers + "/pkgs")) # TODO get rid of that overlay
73
73
-
];
74
74
-
})
75
75
-
./2configs
76
76
-
./3modules
77
77
-
self.inputs.stockholm.nixosModules.krebs
78
78
-
];
79
79
-
}) (builtins.readDir ./machines);
80
80
-
};
81
81
-
in
69
69
+
imports = [
70
70
+
./machines/${machineName}/physical.nix
71
71
+
(
72
72
+
{ config, ... }:
73
73
+
{
74
74
+
clan.core.machineName = machineName;
75
75
+
clan.core.facts.secretStore = "password-store";
76
76
+
clan.core.facts.secretUploadDirectory = nixpkgs.lib.mkDefault "/etc/secrets";
77
77
+
clan.networking.targetHost = "root@${machineName}";
78
78
+
krebs.secret.directory = config.clanCore.facts.secretUploadDirectory;
79
79
+
nixpkgs.overlays = [
80
80
+
self.inputs.stockholm.overlays.default
81
81
+
(import (self.inputs.stockholm.inputs.nix-writers + "/pkgs")) # TODO get rid of that overlay
82
82
+
];
83
83
+
}
84
84
+
)
85
85
+
./2configs
86
86
+
./3modules
87
87
+
self.inputs.stockholm.nixosModules.krebs
88
88
+
];
89
89
+
}) (builtins.readDir ./machines);
90
90
+
};
91
91
+
in
82
92
flake-parts.lib.mkFlake { inherit inputs; } {
83
83
-
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
93
93
+
systems = [
94
94
+
"x86_64-linux"
95
95
+
"aarch64-linux"
96
96
+
"aarch64-darwin"
97
97
+
"x86_64-darwin"
98
98
+
];
84
99
imports = [
85
100
./tools/nvim.nix
86
101
./tools/astronvim/flake-module.nix
···
90
105
];
91
106
flake.nixosConfigurations = clan.nixosConfigurations;
92
107
flake.clanInternals = clan.clanInternals;
93
93
-
perSystem = { config, lib, pkgs, system, ... }: {
94
94
-
packages = lib.mapAttrs (name: v_: pkgs.callPackage ./5pkgs/${name} {}) (builtins.readDir ./5pkgs);
95
95
-
devShells.default = pkgs.mkShell {
96
96
-
packages = [
97
97
-
clan-core.packages.${system}.clan-cli
98
98
-
];
108
108
+
perSystem =
109
109
+
{
110
110
+
lib,
111
111
+
pkgs,
112
112
+
system,
113
113
+
...
114
114
+
}:
115
115
+
{
116
116
+
packages = lib.mapAttrs (name: _v_: pkgs.callPackage ./5pkgs/${name} { }) (
117
117
+
builtins.readDir ./5pkgs
118
118
+
);
119
119
+
devShells.default = pkgs.mkShell {
120
120
+
packages = [
121
121
+
clan-core.packages.${system}.clan-cli
122
122
+
];
123
123
+
};
99
124
};
100
100
-
};
101
125
flake.darwinConfigurations.barnacle = inputs.nix-darwin.lib.darwinSystem {
102
126
modules = [ ./darwin/barnacle/config.nix ];
103
127
};
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
let
3
3
wifi = "wlp0s29u1u2";
4
4
-
in {
4
4
+
in
5
5
+
{
5
6
boot.extraModulePackages = [
6
7
pkgs.linuxPackages.rtl8814au
7
8
];
8
8
-
networking.networkmanager.unmanaged = [ wifi "et0" ];
9
9
+
networking.networkmanager.unmanaged = [
10
10
+
wifi
11
11
+
"et0"
12
12
+
];
9
13
10
14
systemd.services.hostapd = {
11
15
description = "hostapd wireless AP";
12
16
path = [ pkgs.hostapd ];
13
17
wantedBy = [ "network.target" ];
14
18
15
15
-
after = [ "${wifi}-cfg.service" "nat.service" "bind.service" "dhcpd.service" "sys-subsystem-net-devices-${wifi}.device" ];
19
19
+
after = [
20
20
+
"${wifi}-cfg.service"
21
21
+
"nat.service"
22
22
+
"bind.service"
23
23
+
"dhcpd.service"
24
24
+
"sys-subsystem-net-devices-${wifi}.device"
25
25
+
];
16
26
17
27
serviceConfig = {
18
28
ExecStart = "${pkgs.hostapd}/bin/hostapd ${pkgs.writeText "hostapd.conf" ''
···
43
53
];
44
54
45
55
networking.interfaces.br0.ipv4.addresses = [
46
46
-
{ address = "10.99.0.1"; prefixLength = 24; }
56
56
+
{
57
57
+
address = "10.99.0.1";
58
58
+
prefixLength = 24;
59
59
+
}
47
60
];
48
61
services.dhcpd4 = {
49
62
enable = true;
···
60
73
61
74
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
62
75
krebs.iptables.tables.filter.FORWARD.rules = [
63
63
-
{ v6 = false; predicate = "-d 10.99.0.0/24 -o br0 -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
64
64
-
{ v6 = false; predicate = "-s 10.99.0.0/24 -i br0"; target = "ACCEPT"; }
65
65
-
{ v6 = false; predicate = "-i br0 -o br0"; target = "ACCEPT"; }
66
66
-
{ v6 = false; predicate = "-i br0 -o br0"; target = "ACCEPT"; }
67
67
-
{ v6 = false; predicate = "-o br0"; target = "REJECT --reject-with icmp-port-unreachable"; }
68
68
-
{ v6 = false; predicate = "-i br0"; target = "REJECT --reject-with icmp-port-unreachable"; }
76
76
+
{
77
77
+
v6 = false;
78
78
+
predicate = "-d 10.99.0.0/24 -o br0 -m conntrack --ctstate RELATED,ESTABLISHED";
79
79
+
target = "ACCEPT";
80
80
+
}
81
81
+
{
82
82
+
v6 = false;
83
83
+
predicate = "-s 10.99.0.0/24 -i br0";
84
84
+
target = "ACCEPT";
85
85
+
}
86
86
+
{
87
87
+
v6 = false;
88
88
+
predicate = "-i br0 -o br0";
89
89
+
target = "ACCEPT";
90
90
+
}
91
91
+
{
92
92
+
v6 = false;
93
93
+
predicate = "-i br0 -o br0";
94
94
+
target = "ACCEPT";
95
95
+
}
96
96
+
{
97
97
+
v6 = false;
98
98
+
predicate = "-o br0";
99
99
+
target = "REJECT --reject-with icmp-port-unreachable";
100
100
+
}
101
101
+
{
102
102
+
v6 = false;
103
103
+
predicate = "-i br0";
104
104
+
target = "REJECT --reject-with icmp-port-unreachable";
105
105
+
}
69
106
];
70
107
krebs.iptables.tables.nat.PREROUTING.rules = mkBefore [
71
71
-
{ v6 = false; predicate = "-s 10.99.0.0/24"; target = "ACCEPT"; }
108
108
+
{
109
109
+
v6 = false;
110
110
+
predicate = "-s 10.99.0.0/24";
111
111
+
target = "ACCEPT";
112
112
+
}
72
113
];
73
114
krebs.iptables.tables.nat.POSTROUTING.rules = [
74
115
#TODO find out what this is about?
75
75
-
{ v6 = false; predicate = "-s 10.99.0.0/24 -d 224.0.0.0/24"; target = "RETURN"; }
76
76
-
{ v6 = false; predicate = "-s 10.99.0.0/24 -d 255.255.255.255"; target = "RETURN"; }
116
116
+
{
117
117
+
v6 = false;
118
118
+
predicate = "-s 10.99.0.0/24 -d 224.0.0.0/24";
119
119
+
target = "RETURN";
120
120
+
}
121
121
+
{
122
122
+
v6 = false;
123
123
+
predicate = "-s 10.99.0.0/24 -d 255.255.255.255";
124
124
+
target = "RETURN";
125
125
+
}
77
126
78
78
-
{ v6 = false; predicate = "-s 10.99.0.0/24 ! -d 10.99.0.0/24"; target = "MASQUERADE"; }
79
79
-
{ v6 = false; predicate = "-s 10.99.0.0/24 ! -d 10.99.0.0/24 -p tcp"; target = "MASQUERADE --to-ports 1024-65535"; }
80
80
-
{ v6 = false; predicate = "-s 10.99.0.0/24 ! -d 10.99.0.0/24 -p udp"; target = "MASQUERADE --to-ports 1024-65535"; }
127
127
+
{
128
128
+
v6 = false;
129
129
+
predicate = "-s 10.99.0.0/24 ! -d 10.99.0.0/24";
130
130
+
target = "MASQUERADE";
131
131
+
}
132
132
+
{
133
133
+
v6 = false;
134
134
+
predicate = "-s 10.99.0.0/24 ! -d 10.99.0.0/24 -p tcp";
135
135
+
target = "MASQUERADE --to-ports 1024-65535";
136
136
+
}
137
137
+
{
138
138
+
v6 = false;
139
139
+
predicate = "-s 10.99.0.0/24 ! -d 10.99.0.0/24 -p udp";
140
140
+
target = "MASQUERADE --to-ports 1024-65535";
141
141
+
}
81
142
];
82
143
}
···
1
1
-
{ config, lib, pkgs, ... }: let
1
1
+
{ pkgs, ... }:
2
2
+
let
2
3
weechat = pkgs.weechat.override {
3
3
-
configure = { availablePlugins, ... }: {
4
4
-
scripts = with pkgs.weechatScripts; [
5
5
-
weechat-matrix
6
6
-
];
7
7
-
};
4
4
+
configure =
5
5
+
{ ... }:
6
6
+
{
7
7
+
scripts = with pkgs.weechatScripts; [
8
8
+
weechat-matrix
9
9
+
];
10
10
+
};
8
11
};
9
12
10
13
tmux = "/run/current-system/sw/bin/tmux";
11
14
12
12
-
in {
15
15
+
in
16
16
+
{
13
17
imports = [
14
18
./bitlbee.nix
15
19
];
···
1
1
-
{ config, pkgs, ... }: let
1
1
+
{ config, pkgs, ... }:
2
2
+
let
2
3
mainUser = config.users.extraUsers.mainUser;
3
3
-
in {
4
4
-
users.users= {
4
4
+
in
5
5
+
{
6
6
+
users.users = {
5
7
ableton = {
6
8
isNormalUser = true;
7
9
extraGroups = [
···
1
1
-
{ config, lib, pkgs, ... }: let
1
1
+
{ pkgs, ... }:
2
2
+
let
2
3
3
3
-
alacritty-cfg = extrVals: pkgs.writers.writeTOML "alacritty.toml" ({
4
4
-
font = let
5
5
-
family = "IosevkaTerm Nerd Font";
6
6
-
in {
7
7
-
normal = {
8
8
-
family = family;
9
9
-
style = "Regular";
10
10
-
};
11
11
-
bold = {
12
12
-
family = family;
13
13
-
style = "Bold";
14
14
-
};
15
15
-
italic = {
16
16
-
family = family;
17
17
-
style = "Italic";
18
18
-
};
19
19
-
bold_italic = {
20
20
-
family = family;
21
21
-
style = "Bold Italic";
22
22
-
};
23
23
-
size = 12;
24
24
-
};
25
25
-
live_config_reload = true;
26
26
-
window.dimensions = {
27
27
-
columns = 80;
28
28
-
lines = 20;
29
29
-
};
30
30
-
env.WINIT_X11_SCALE_FACTOR = "1.0";
31
31
-
hints.enabled = [
4
4
+
alacritty-cfg =
5
5
+
extrVals:
6
6
+
pkgs.writers.writeTOML "alacritty.toml" (
32
7
{
33
33
-
regex = ''(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-\u009F<>"\s{-}\^⟨⟩`]+'';
34
34
-
command = "/run/current-system/sw/bin/xdg-open";
35
35
-
post_processing = true;
36
36
-
mouse.enabled = true;
37
37
-
binding = {
38
38
-
key = "U";
39
39
-
mods = "Alt";
8
8
+
font =
9
9
+
let
10
10
+
family = "IosevkaTerm Nerd Font";
11
11
+
in
12
12
+
{
13
13
+
normal = {
14
14
+
family = family;
15
15
+
style = "Regular";
16
16
+
};
17
17
+
bold = {
18
18
+
family = family;
19
19
+
style = "Bold";
20
20
+
};
21
21
+
italic = {
22
22
+
family = family;
23
23
+
style = "Italic";
24
24
+
};
25
25
+
bold_italic = {
26
26
+
family = family;
27
27
+
style = "Bold Italic";
28
28
+
};
29
29
+
size = 12;
30
30
+
};
31
31
+
live_config_reload = true;
32
32
+
window.dimensions = {
33
33
+
columns = 80;
34
34
+
lines = 20;
40
35
};
36
36
+
env.WINIT_X11_SCALE_FACTOR = "1.0";
37
37
+
hints.enabled = [
38
38
+
{
39
39
+
regex = ''(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-\u009F<>"\s{-}\^⟨⟩`]+'';
40
40
+
command = "/run/current-system/sw/bin/xdg-open";
41
41
+
post_processing = true;
42
42
+
mouse.enabled = true;
43
43
+
binding = {
44
44
+
key = "U";
45
45
+
mods = "Alt";
46
46
+
};
47
47
+
}
48
48
+
];
41
49
}
42
42
-
];
43
43
-
} // extrVals);
50
50
+
// extrVals
51
51
+
);
44
52
45
53
alacritty = pkgs.symlinkJoin {
46
54
name = "alacritty";
···
53
61
];
54
62
};
55
63
56
56
-
in {
64
64
+
in
65
65
+
{
57
66
environment.etc = {
58
67
"themes/light/alacritty.toml".source = alacritty-cfg {
59
68
colors = {
···
69
78
# Normal colors
70
79
normal = {
71
80
black = "#fbf1c7";
72
72
-
red = "#cc241d";
73
73
-
green = "#98971a";
74
74
-
yellow = "#d79921";
75
75
-
blue = "#458588";
81
81
+
red = "#cc241d";
82
82
+
green = "#98971a";
83
83
+
yellow = "#d79921";
84
84
+
blue = "#458588";
76
85
magenta = "#b16286";
77
77
-
cyan = "#689d6a";
78
78
-
white = "#7c6f64";
86
86
+
cyan = "#689d6a";
87
87
+
white = "#7c6f64";
79
88
};
80
89
81
90
# Bright colors
82
91
bright = {
83
83
-
black = "#928374";
84
84
-
red = "#9d0006";
85
85
-
green = "#79740e";
86
86
-
yellow = "#b57614";
87
87
-
blue = "#076678";
92
92
+
black = "#928374";
93
93
+
red = "#9d0006";
94
94
+
green = "#79740e";
95
95
+
yellow = "#b57614";
96
96
+
blue = "#076678";
88
97
magenta = "#8f3f71";
89
89
-
cyan = "#427b58";
90
90
-
white = "#3c3836";
98
98
+
cyan = "#427b58";
99
99
+
white = "#3c3836";
91
100
};
92
101
};
93
102
};
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
services.atuin = {
4
4
enable = true;
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
systemd.services.usb_tether = {
4
4
script = ''
···
2
2
3
3
let
4
4
mainUser = config.users.extraUsers.mainUser;
5
5
-
in {
5
5
+
in
6
6
+
{
6
7
7
8
users.extraUsers = {
8
9
bitcoin = {
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
3
3
{
4
4
services.bitlbee = {
···
1
1
-
{ config, lib, pkgs, ... }:
2
2
-
let
3
3
-
all_hosts = [
4
4
-
"icarus"
5
5
-
"shodan"
6
6
-
"daedalus"
7
7
-
"skynet"
8
8
-
"prism"
9
9
-
"littleT"
10
10
-
];
11
11
-
remote_hosts = lib.filter (h: h != config.networking.hostName) all_hosts;
12
12
-
13
13
-
in {
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
7
7
+
{
14
8
imports = [
15
9
<stockholm/lass/2configs/container-networking.nix>
16
16
-
{ #hack for already defined
10
10
+
{
11
11
+
#hack for already defined
17
12
systemd.services."container@blue".reloadIfChanged = lib.mkForce false;
18
13
systemd.services."container@blue".preStart = ''
19
14
${pkgs.mount}/bin/mount | ${pkgs.gnugrep}/bin/grep -q '^encfs on /var/lib/containers/blue'
···
30
25
'';
31
26
32
27
containers.blue = {
33
33
-
config = { ... }: {
34
34
-
environment.systemPackages = [
35
35
-
pkgs.git
36
36
-
pkgs.rxvt-unicode-unwrapped.terminfo
37
37
-
];
38
38
-
services.openssh.enable = true;
39
39
-
users.users.root.openssh.authorizedKeys.keys = [
40
40
-
config.krebs.users.lass.pubkey
41
41
-
];
42
42
-
};
28
28
+
config =
29
29
+
{ ... }:
30
30
+
{
31
31
+
environment.systemPackages = [
32
32
+
pkgs.git
33
33
+
pkgs.rxvt-unicode-unwrapped.terminfo
34
34
+
];
35
35
+
services.openssh.enable = true;
36
36
+
users.users.root.openssh.authorizedKeys.keys = [
37
37
+
config.krebs.users.lass.pubkey
38
38
+
];
39
39
+
};
43
40
autoStart = false;
44
41
enableTun = true;
45
42
privateNetwork = true;
46
43
hostAddress = "10.233.2.9";
47
44
localAddress = "10.233.2.10";
48
45
};
49
49
-
50
46
51
47
#systemd.services = builtins.listToAttrs (map (host:
52
48
# let
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
3
3
{
4
4
imports = [
···
17
17
services.tor.client.enable = true;
18
18
19
19
krebs.iptables.tables.filter.INPUT.rules = [
20
20
-
{ predicate = "-i retiolum -p udp --dport 60000:61000"; target = "ACCEPT";}
21
21
-
{ predicate = "-i wiregrill -p udp --dport 60000:61000"; target = "ACCEPT";}
22
22
-
{ predicate = "-i retiolum -p tcp --dport 9998:9999"; target = "ACCEPT";}
23
23
-
{ predicate = "-i wiregrill -p tcp --dport 9998:9999"; target = "ACCEPT";}
24
24
-
{ predicate = "-i retiolum -p tcp --dport imap"; target = "ACCEPT";}
25
25
-
{ predicate = "-i wiregrill -p tcp --dport imap"; target = "ACCEPT";}
20
20
+
{
21
21
+
predicate = "-i retiolum -p udp --dport 60000:61000";
22
22
+
target = "ACCEPT";
23
23
+
}
24
24
+
{
25
25
+
predicate = "-i wiregrill -p udp --dport 60000:61000";
26
26
+
target = "ACCEPT";
27
27
+
}
28
28
+
{
29
29
+
predicate = "-i retiolum -p tcp --dport 9998:9999";
30
30
+
target = "ACCEPT";
31
31
+
}
32
32
+
{
33
33
+
predicate = "-i wiregrill -p tcp --dport 9998:9999";
34
34
+
target = "ACCEPT";
35
35
+
}
36
36
+
{
37
37
+
predicate = "-i retiolum -p tcp --dport imap";
38
38
+
target = "ACCEPT";
39
39
+
}
40
40
+
{
41
41
+
predicate = "-i wiregrill -p tcp --dport imap";
42
42
+
target = "ACCEPT";
43
43
+
}
26
44
];
27
45
28
46
services.dovecot2 = {
···
1
1
-
{ config, lib, pkgs, modulesPath, ... }: {
1
1
+
{ pkgs, modulesPath, ... }:
2
2
+
{
2
3
3
4
imports = [
4
5
(modulesPath + "/services/hardware/sane_extra_backends/brscan4.nix")
···
38
39
];
39
40
};
40
41
41
41
-
users.users.mainUser.extraGroups = [ "scanner" "lp" ];
42
42
+
users.users.mainUser.extraGroups = [
43
43
+
"scanner"
44
44
+
"lp"
45
45
+
];
42
46
43
47
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
programs.firefox.nativeMessagingHosts.tridactyl = true;
4
4
environment.variables.BROWSER = "${pkgs.firefox-devedition}/bin/firefox-devedition";
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
3
3
{
4
4
5
5
environment.systemPackages = [
6
6
pkgs.cifs-utils
7
7
];
8
8
-
9
8
10
9
clanCore.facts.services.c-base = {
11
10
secret."c-base.txt" = { };
···
26
25
Domains = "cbrp3.c-base.org";
27
26
};
28
27
routes = [
29
29
-
{ routeConfig = {
30
30
-
Destination = "10.0.0.0/23";
31
31
-
Gateway = "172.31.77.1";
32
32
-
};}
33
33
-
{ routeConfig = {
34
34
-
Destination = "91.102.9.99/32"; # vorstand.c-base.org
35
35
-
Gateway = "172.31.77.1";
36
36
-
};}
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
+
}
37
40
];
38
41
};
39
42
services.openvpn.servers.c-base = {
···
1
1
-
{ config, ... }: {
1
1
+
{ config, ... }:
2
2
+
{
2
3
services.owncast.enable = true;
3
4
services.owncast.port = 8081;
4
5
services.nginx = {
···
1
1
-
{ config, pkgs, lib, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
let
3
3
domain = "pad.lassul.us";
4
4
in
···
21
21
};
22
22
23
23
security.acme.certs.${domain}.group = "hedgecert";
24
24
-
users.groups.hedgecert.members = [ "hedgedoc" "nginx" ];
24
24
+
users.groups.hedgecert.members = [
25
25
+
"hedgedoc"
26
26
+
"nginx"
27
27
+
];
25
28
26
29
security.dhparams = {
27
30
enable = true;
28
31
params.hedgedoc = { };
29
32
};
30
30
-
31
33
32
34
services.borgbackup.jobs.hetzner.paths = [
33
35
"/var/backup"
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, lib, ... }:
2
2
{
3
3
services.consul = {
4
4
enable = true;
···
10
10
bootstrap_expect = 3;
11
11
server = true;
12
12
# retry_join = config.services.consul.extraConfig.start_join;
13
13
-
retry_join = lib.mapAttrsToList (n: h:
14
14
-
lib.head h.nets.retiolum.aliases
15
15
-
) (lib.filterAttrs (n: h: h.consul) config.krebs.hosts);
13
13
+
retry_join = lib.mapAttrsToList (_n: h: lib.head h.nets.retiolum.aliases) (
14
14
+
lib.filterAttrs (_n: h: h.consul) config.krebs.hosts
15
15
+
);
16
16
rejoin_after_leave = true;
17
17
18
18
# try to fix random lock loss on leader reelection
···
27
27
};
28
28
29
29
krebs.iptables.tables.filter.INPUT.rules = [
30
30
-
{ predicate = "-i retiolum -p tcp --dport 8300"; target = "ACCEPT"; }
31
31
-
{ predicate = "-i retiolum -p tcp --dport 8301"; target = "ACCEPT"; }
32
32
-
{ predicate = "-i retiolum -p udp --dport 8301"; target = "ACCEPT"; }
33
33
-
{ predicate = "-i retiolum -p tcp --dport 8302"; target = "ACCEPT"; }
34
34
-
{ predicate = "-i retiolum -p udp --dport 8302"; target = "ACCEPT"; }
35
35
-
{ predicate = "-i retiolum -p tcp --dport 8400"; target = "ACCEPT"; }
36
36
-
{ predicate = "-i retiolum -p tcp --dport 8500"; target = "ACCEPT"; }
37
37
-
{ predicate = "-i retiolum -p tcp --dport 8600"; target = "ACCEPT"; }
38
38
-
{ predicate = "-i retiolum -p udp --dport 8500"; target = "ACCEPT"; }
30
30
+
{
31
31
+
predicate = "-i retiolum -p tcp --dport 8300";
32
32
+
target = "ACCEPT";
33
33
+
}
34
34
+
{
35
35
+
predicate = "-i retiolum -p tcp --dport 8301";
36
36
+
target = "ACCEPT";
37
37
+
}
38
38
+
{
39
39
+
predicate = "-i retiolum -p udp --dport 8301";
40
40
+
target = "ACCEPT";
41
41
+
}
42
42
+
{
43
43
+
predicate = "-i retiolum -p tcp --dport 8302";
44
44
+
target = "ACCEPT";
45
45
+
}
46
46
+
{
47
47
+
predicate = "-i retiolum -p udp --dport 8302";
48
48
+
target = "ACCEPT";
49
49
+
}
50
50
+
{
51
51
+
predicate = "-i retiolum -p tcp --dport 8400";
52
52
+
target = "ACCEPT";
53
53
+
}
54
54
+
{
55
55
+
predicate = "-i retiolum -p tcp --dport 8500";
56
56
+
target = "ACCEPT";
57
57
+
}
58
58
+
{
59
59
+
predicate = "-i retiolum -p tcp --dport 8600";
60
60
+
target = "ACCEPT";
61
61
+
}
62
62
+
{
63
63
+
predicate = "-i retiolum -p udp --dport 8500";
64
64
+
target = "ACCEPT";
65
65
+
}
39
66
];
40
67
}
···
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
-
{ v6 = false; predicate = "-o ctr+ -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
8
8
-
{ v6 = false; predicate = "-i ctr+"; target = "ACCEPT"; }
9
9
-
{ v6 = false; predicate = "-o ve-+ -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
10
10
-
{ v6 = false; predicate = "-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
+
}
11
27
# { v6 = false; predicate = "-i ve-+ -o ve-+"; target = "ACCEPT"; }
12
28
# { v6 = false; predicate = "-o ve-+"; target = "REJECT --reject-with icmp-port-unreachable"; }
13
29
# { v6 = false; predicate = "-i ve-+"; target = "REJECT --reject-with icmp-port-unreachable"; }
14
30
];
15
31
krebs.iptables.tables.nat.PREROUTING.rules = lib.mkBefore [
16
16
-
{ v6 = false; predicate = "-i ctr+"; target = "ACCEPT"; }
17
17
-
{ v6 = false; predicate = "-i ve-+"; target = "ACCEPT"; }
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
+
}
18
42
];
19
43
krebs.iptables.tables.nat.POSTROUTING.rules = [
20
44
# { v6 = false; predicate = "-o et0"; target = "MASQUERADE"; }
21
45
22
22
-
{ v6 = false; predicate = "-s 10.233.0.0/16 ! -d 10.233.0.0/16"; target = "MASQUERADE"; }
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
+
}
23
51
# { v6 = false; predicate = "-s 10.233.2.0/24 -d 224.0.0.0/24"; target = "RETURN"; }
24
52
# { v6 = false; predicate = "-s 10.233.2.0/24 -d 255.255.255.255"; target = "RETURN"; }
25
53
# { v6 = false; predicate = "-s 10.233.2.0/24 ! -d 10.233.2.0/24"; target = "MASQUERADE"; }
···
1
1
-
{ lib, ... }: {
1
1
+
{ lib, ... }:
2
2
+
{
2
3
nix.settings.experimental-features = [
3
4
# for container in builds support
4
5
"auto-allocate-uids"
···
17
17
${pkgs.copyq}/bin/copyq config move true
18
18
${pkgs.copyq}/bin/copyq config text_wrap true
19
19
'';
20
20
-
in {
20
20
+
in
21
21
+
{
21
22
systemd.user.services.copyq = {
22
23
wantedBy = [ "graphical-session.target" ];
23
24
requires = [ "xmonad.service" ];
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
environment.systemPackages = [
4
9
pkgs.cunicu
···
38
43
interface_filter = "w*|e*|v*|i*";
39
44
};
40
45
41
41
-
interfaces.wiregrill = {};
46
46
+
interfaces.wiregrill = { };
42
47
43
43
-
peers = lib.mapAttrs
44
44
-
(_: host: {
48
48
+
peers = lib.mapAttrs (
49
49
+
_: host:
50
50
+
{
45
51
public_key = host.nets.wiregrill.wireguard.pubkey;
46
46
-
allowed_ips = with host.nets.wiregrill; [
47
47
-
"${ip6.addr}/128"
48
48
-
] ++ (lib.optional (ip4 != null) "${ip4.addr}/32");
49
49
-
} // lib.optionalAttrs (host.nets.wiregrill.via != null) {
52
52
+
allowed_ips =
53
53
+
with host.nets.wiregrill;
54
54
+
[
55
55
+
"${ip6.addr}/128"
56
56
+
]
57
57
+
++ (lib.optional (ip4 != null) "${ip4.addr}/32");
58
58
+
}
59
59
+
// lib.optionalAttrs (host.nets.wiregrill.via != null) {
50
60
endpoint = host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}";
51
51
-
})
52
52
-
(lib.filterAttrs (_: host: lib.hasAttr "wiregrill" host.nets) config.krebs.hosts);
61
61
+
}
62
62
+
) (lib.filterAttrs (_: host: lib.hasAttr "wiregrill" host.nets) config.krebs.hosts);
53
63
};
54
64
55
65
systemd.services.cunicu = {
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
2
8
{
3
9
imports = [
4
10
./security-workarounds.nix
···
39
45
clanCore.facts.services.password = {
40
46
secret.password = { };
41
47
secret.passwordHash = { };
42
42
-
generator.path = with pkgs; [ coreutils xkcdpass mkpasswd ];
48
48
+
generator.path = with pkgs; [
49
49
+
coreutils
50
50
+
xkcdpass
51
51
+
mkpasswd
52
52
+
];
43
53
generator.script = ''
44
54
xkcdpass -n 4 -d - > $secrets/password
45
55
cat $secrets/password | mkpasswd -s -m sha-512 > $secrets/passwordHash
···
47
57
};
48
58
}
49
59
{
60
60
+
clan.core.vars.settings.secretStore = "password-store";
61
61
+
clan.core.vars.generators.testing = {
62
62
+
files.testaaa = { };
63
63
+
runtimeInputs = with pkgs; [ coreutils ];
64
64
+
script = ''
65
65
+
echo lol > $out/testaaa
66
66
+
'';
67
67
+
};
68
68
+
}
69
69
+
{
70
70
+
# deployment information
71
71
+
options.clan.flake-inputs = lib.mkOption {
72
72
+
description = ''
73
73
+
information about the flake inputs.
74
74
+
Used for update tracking.
75
75
+
'';
76
76
+
type = lib.types.attrsOf (
77
77
+
lib.types.attrsOf (
78
78
+
lib.types.nullOr (
79
79
+
lib.types.oneOf [
80
80
+
lib.types.str
81
81
+
lib.types.int
82
82
+
]
83
83
+
)
84
84
+
)
85
85
+
);
86
86
+
default =
87
87
+
let
88
88
+
inputs = config.clan.core.clanDir.inputs;
89
89
+
cleanSourceInfo = input: {
90
90
+
rev = input.rev or null;
91
91
+
dirtyRev = input.dirtyRev or null;
92
92
+
lastModified = input.lastModified or null;
93
93
+
narHash = input.narHash or null;
94
94
+
};
95
95
+
sourceInfo = lib.mapAttrs (_: input: cleanSourceInfo input) inputs;
96
96
+
in
97
97
+
sourceInfo
98
98
+
// {
99
99
+
self = cleanSourceInfo config.clan.core.clanDir.sourceInfo;
100
100
+
};
101
101
+
};
102
102
+
config.environment.etc."flake-inputs.json".text =
103
103
+
let
104
104
+
text = builtins.unsafeDiscardStringContext (builtins.toJSON config.clan.flake-inputs);
105
105
+
in
106
106
+
text;
107
107
+
}
108
108
+
{
50
109
services.openssh.enable = true;
51
51
-
services.openssh.hostKeys = [{
52
52
-
path = config.clanCore.facts.services.ssh.secret."ssh.id_ed25519".path;
53
53
-
type = "ed25519";
54
54
-
}];
110
110
+
services.openssh.hostKeys = [
111
111
+
{
112
112
+
path = config.clanCore.facts.services.ssh.secret."ssh.id_ed25519".path;
113
113
+
type = "ed25519";
114
114
+
}
115
115
+
];
55
116
clanCore.facts.services.ssh = {
56
117
secret."ssh.id_ed25519" = { };
57
118
public."ssh.id_ed25519.pub" = { };
58
58
-
generator.path = with pkgs; [ coreutils openssh ];
119
119
+
generator.path = with pkgs; [
120
120
+
coreutils
121
121
+
openssh
122
122
+
];
59
123
generator.script = ''
60
124
ssh-keygen -t ed25519 -N "" -f $secrets/ssh.id_ed25519
61
125
mv $secrets/ssh.id_ed25519.pub $facts/ssh.id_ed25519.pub
···
90
154
};
91
155
};
92
156
}
93
93
-
(let ca-bundle = "/etc/ssl/certs/ca-bundle.crt"; in {
94
94
-
environment.variables = {
95
95
-
CURL_CA_BUNDLE = ca-bundle;
96
96
-
GIT_SSL_CAINFO = ca-bundle;
97
97
-
SSL_CERT_FILE = ca-bundle;
98
98
-
};
99
99
-
})
157
157
+
(
158
158
+
let
159
159
+
ca-bundle = "/etc/ssl/certs/ca-bundle.crt";
160
160
+
in
161
161
+
{
162
162
+
environment.variables = {
163
163
+
CURL_CA_BUNDLE = ca-bundle;
164
164
+
GIT_SSL_CAINFO = ca-bundle;
165
165
+
SSL_CERT_FILE = ca-bundle;
166
166
+
};
167
167
+
}
168
168
+
)
100
169
{
101
170
#for sshuttle
102
171
environment.systemPackages = [
···
125
194
nixpkgs.config.allowUnfree = true;
126
195
127
196
environment.systemPackages = with pkgs; [
128
128
-
self.packages.${pkgs.system}.vim
197
197
+
self.packages.${pkgs.system}.nvim
129
198
130
130
-
#stockholm
199
199
+
#stockholm
131
200
git
132
201
git-absorb
133
202
git-preview
···
135
204
jq
136
205
nix-output-monitor
137
206
138
138
-
#style
207
207
+
#style
139
208
rxvt-unicode-unwrapped.terminfo
140
209
alacritty.terminfo
141
210
142
142
-
#monitoring tools
211
211
+
#monitoring tools
143
212
htop
144
213
iotop
145
214
146
146
-
#network
215
215
+
#network
147
216
iptables
148
217
iftop
149
218
tcpdump
···
151
220
eternal-terminal
152
221
self.packages.${pkgs.system}.sshify
153
222
154
154
-
#stuff for dl
223
223
+
#stuff for dl
155
224
aria2
156
225
157
157
-
#neat utils
226
226
+
#neat utils
158
227
file
159
228
hashPassword
160
229
kpaste
···
171
240
self.packages.${pkgs.system}.logify
172
241
goify
173
242
174
174
-
#unpack stuff
243
243
+
#unpack stuff
175
244
libarchive
176
245
177
246
(pkgs.writeDashBin "sshn" ''
···
232
301
filter.FORWARD.policy = lib.mkDefault "DROP";
233
302
filter.INPUT.rules = lib.mkMerge [
234
303
(lib.mkBefore [
235
235
-
{ predicate = "-m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
236
236
-
{ predicate = "-p icmp"; target = "ACCEPT"; }
237
237
-
{ predicate = "-p ipv6-icmp"; target = "ACCEPT"; v4 = false; }
238
238
-
{ predicate = "-i lo"; target = "ACCEPT"; }
239
239
-
{ predicate = "-p tcp --dport 22"; target = "ACCEPT"; }
304
304
+
{
305
305
+
predicate = "-m conntrack --ctstate RELATED,ESTABLISHED";
306
306
+
target = "ACCEPT";
307
307
+
}
308
308
+
{
309
309
+
predicate = "-p icmp";
310
310
+
target = "ACCEPT";
311
311
+
}
312
312
+
{
313
313
+
predicate = "-p ipv6-icmp";
314
314
+
target = "ACCEPT";
315
315
+
v4 = false;
316
316
+
}
317
317
+
{
318
318
+
predicate = "-i lo";
319
319
+
target = "ACCEPT";
320
320
+
}
321
321
+
{
322
322
+
predicate = "-p tcp --dport 22";
323
323
+
target = "ACCEPT";
324
324
+
}
240
325
])
241
326
(lib.mkOrder 1000 [
242
242
-
{ predicate = "-p udp --dport 60000:61000"; target = "ACCEPT"; } # mosh
243
243
-
{ predicate = "-i retiolum -p udp -m udp --dport 53"; target = "ACCEPT"; }
244
244
-
{ predicate = "-i retiolum -p tcp --dport 19999"; target = "ACCEPT"; }
327
327
+
{
328
328
+
predicate = "-p udp --dport 60000:61000";
329
329
+
target = "ACCEPT";
330
330
+
} # mosh
331
331
+
{
332
332
+
predicate = "-i retiolum -p udp -m udp --dport 53";
333
333
+
target = "ACCEPT";
334
334
+
}
335
335
+
{
336
336
+
predicate = "-i retiolum -p tcp --dport 19999";
337
337
+
target = "ACCEPT";
338
338
+
}
245
339
])
246
340
(lib.mkAfter [
247
247
-
{ predicate = "-p tcp -i retiolum"; target = "REJECT --reject-with tcp-reset"; }
248
248
-
{ predicate = "-p udp -i retiolum"; target = "REJECT --reject-with icmp-port-unreachable"; v6 = false; }
249
249
-
{ predicate = "-i retiolum"; target = "REJECT --reject-with icmp-proto-unreachable"; v6 = false; }
341
341
+
{
342
342
+
predicate = "-p tcp -i retiolum";
343
343
+
target = "REJECT --reject-with tcp-reset";
344
344
+
}
345
345
+
{
346
346
+
predicate = "-p udp -i retiolum";
347
347
+
target = "REJECT --reject-with icmp-port-unreachable";
348
348
+
v6 = false;
349
349
+
}
350
350
+
{
351
351
+
predicate = "-i retiolum";
352
352
+
target = "REJECT --reject-with icmp-proto-unreachable";
353
353
+
v6 = false;
354
354
+
}
250
355
])
251
356
];
252
357
};
···
267
372
268
373
# use 24:00 time format, the default got sneakily changed around 20.03
269
374
i18n.defaultLocale = lib.mkDefault "C.UTF-8";
270
270
-
time.timeZone = lib.mkDefault"Europe/Berlin";
375
375
+
time.timeZone = lib.mkDefault "Europe/Berlin";
271
376
272
377
# disable doc usually
273
378
documentation.nixos.enable = lib.mkDefault false;
···
277
382
enable = false;
278
383
enableNg = true;
279
384
};
385
385
+
386
386
+
# use latest nix to hunt all the bugs
387
387
+
nix.package = pkgs.nixVersions.latest;
388
388
+
389
389
+
# workaround for systemd freezing up when suspending
390
390
+
# https://github.com/systemd/systemd/issues/33083
391
391
+
environment.variables.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
280
392
}
···
1
1
let
2
2
-
pkgs = import <nixpkgs> {};
2
2
+
pkgs = import <nixpkgs> { };
3
3
4
4
-
mkNixosManual = let
5
5
-
inherit pkgs;
6
6
-
inherit (pkgs) lib;
7
7
-
# Reduces the attrs from a package set so broken packages evaluate (I think?)
8
8
-
scrubDerivations = namePrefix: pkgSet: lib.mapAttrs
9
9
-
(name: value:
10
10
-
let wholeName = "${namePrefix}.${name}"; in
11
11
-
if lib.isAttrs value then
12
12
-
scrubDerivations wholeName value
13
13
-
// (lib.optionalAttrs (lib.isDerivation value) { outPath = "\${${wholeName}}"; })
14
14
-
else value
15
15
-
)
16
16
-
pkgSet;
17
17
-
# An evluation of the specified system version with only the modules and no config
18
18
-
scrubbedEval = lib.evalModules {
19
19
-
modules = [
20
20
-
{
21
21
-
#imports = [ ./default.nix ];
22
22
-
}
23
23
-
] ++ (import (pkgs.path + /nixos/modules/module-list.nix));
24
24
-
# Forward the filtered package set and the modules path
25
25
-
specialArgs = {
26
26
-
pkgs = scrubDerivations "pkgs" pkgs;
27
27
-
modulesPath = pkgs.path + /nixos/modules;
4
4
+
mkNixosManual =
5
5
+
let
6
6
+
inherit pkgs;
7
7
+
inherit (pkgs) lib;
8
8
+
# Reduces the attrs from a package set so broken packages evaluate (I think?)
9
9
+
scrubDerivations =
10
10
+
namePrefix: pkgSet:
11
11
+
lib.mapAttrs (
12
12
+
name: value:
13
13
+
let
14
14
+
wholeName = "${namePrefix}.${name}";
15
15
+
in
16
16
+
if lib.isAttrs value then
17
17
+
scrubDerivations wholeName value
18
18
+
// (lib.optionalAttrs (lib.isDerivation value) { outPath = "\${${wholeName}}"; })
19
19
+
else
20
20
+
value
21
21
+
) pkgSet;
22
22
+
# An evluation of the specified system version with only the modules and no config
23
23
+
scrubbedEval = lib.evalModules {
24
24
+
modules = [
25
25
+
{
26
26
+
#imports = [ ./default.nix ];
27
27
+
}
28
28
+
] ++ (import (pkgs.path + /nixos/modules/module-list.nix));
29
29
+
# Forward the filtered package set and the modules path
30
30
+
specialArgs = {
31
31
+
pkgs = scrubDerivations "pkgs" pkgs;
32
32
+
modulesPath = pkgs.path + /nixos/modules;
33
33
+
};
28
34
};
29
29
-
};
30
30
-
in (import (pkgs.path + /nixos/doc/manual)) rec {
31
31
-
# From parent scope
32
32
-
inherit (scrubbedEval) config;
33
33
-
# From let
34
34
-
inherit pkgs;
35
35
-
version = scrubbedEval.config.system.nixos.release;
36
36
-
revision = "release-${version}";
35
35
+
in
36
36
+
(import (pkgs.path + /nixos/doc/manual)) rec {
37
37
+
# From parent scope
38
38
+
inherit (scrubbedEval) config;
39
39
+
# From let
40
40
+
inherit pkgs;
41
41
+
version = scrubbedEval.config.system.nixos.release;
42
42
+
revision = "release-${version}";
37
43
38
38
-
extraSources = [ ../. ];
39
39
-
options = scrubbedEval.options;
40
40
-
};
41
41
-
in mkNixosManual
44
44
+
extraSources = [ ../. ];
45
45
+
options = scrubbedEval.options;
46
46
+
};
47
47
+
in
48
48
+
mkNixosManual
···
1
1
-
{ pkgs, lib, config, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
systemd.services.krebs-iptables.serviceConfig.ExecStartPost = pkgs.writeDash "kick_docker" ''
4
4
${pkgs.systemd}/bin/systemctl restart docker.service
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
{
3
3
services.eternal-terminal = {
4
4
enable = true;
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
krebs.exim-retiolum = {
4
4
enable = true;
5
5
system-aliases = [
6
6
-
{ from = "root"; to = "lass"; }
6
6
+
{
7
7
+
from = "root";
8
8
+
to = "lass";
9
9
+
}
7
10
];
8
11
};
9
12
krebs.iptables.tables.filter.INPUT.rules = [
10
10
-
{ predicate = "-i retiolum -p tcp --dport smtp"; target = "ACCEPT"; }
11
11
-
{ predicate = "-i zttzibeakb -p tcp --dport smtp"; target = "ACCEPT"; }
12
12
-
{ predicate = "-i nether -p tcp --dport smtp"; target = "ACCEPT"; }
13
13
+
{
14
14
+
predicate = "-i retiolum -p tcp --dport smtp";
15
15
+
target = "ACCEPT";
16
16
+
}
17
17
+
{
18
18
+
predicate = "-i zttzibeakb -p tcp --dport smtp";
19
19
+
target = "ACCEPT";
20
20
+
}
21
21
+
{
22
22
+
predicate = "-i nether -p tcp --dport smtp";
23
23
+
target = "ACCEPT";
24
24
+
}
13
25
];
14
26
}
···
4
4
url = "http://wallpaper.r/realwallpaper-krebs-stars-berlin.png";
5
5
};
6
6
}
7
7
-
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ lib, pkgs, ... }:
2
2
3
3
let
4
4
lpkgs = import ../5pkgs { inherit pkgs; };
5
5
6
6
inherit (lib)
7
7
concatMapStrings
8
8
-
;
8
8
+
;
9
9
10
10
plugins = with lpkgs.firefoxPlugins; [
11
11
noscript
···
13
13
vimperator
14
14
];
15
15
16
16
-
copyXpi = plugin:
17
17
-
"cp ${plugin}/*.xpi $out/usr/lib/firefox-*/browser/extensions/";
16
16
+
copyXpi = plugin: "cp ${plugin}/*.xpi $out/usr/lib/firefox-*/browser/extensions/";
18
17
19
18
preferences = pkgs.writeText "autoload.js" ''
20
19
pref('general.config.filename', 'firefox.cfg');
···
40
39
defaultPref("plugin.scan.plid.all", false);
41
40
'';
42
41
43
43
-
in {
42
42
+
in
43
43
+
{
44
44
environment.systemPackages = [
45
45
-
(pkgs.lib.overrideDerivation pkgs.firefox-bin (original : {
45
45
+
(pkgs.lib.overrideDerivation pkgs.firefox-bin (original: {
46
46
installPhase = ''
47
47
${original.installPhase}
48
48
find $out/usr/lib
···
55
55
}))
56
56
];
57
57
}
58
58
-
···
8
8
xorg.fontschumachermisc
9
9
inconsolata
10
10
noto-fonts
11
11
-
(nerdfonts.override { fonts = [ "Iosevka" "IosevkaTerm" "IosevkaTermSlab" ]; })
11
11
+
(nerdfonts.override {
12
12
+
fonts = [
13
13
+
"Iosevka"
14
14
+
"IosevkaTerm"
15
15
+
"IosevkaTermSlab"
16
16
+
];
17
17
+
})
12
18
];
13
19
};
14
20
}
···
1
1
-
{ config, lib, pkgs, ... }: let
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
7
7
+
let
2
8
3
9
format-github-message = pkgs.writeDashBin "format-github-message" ''
4
10
set -efu
5
5
-
export PATH=${lib.makeBinPath [
6
6
-
pkgs.jq
7
7
-
]}
11
11
+
export PATH=${
12
12
+
lib.makeBinPath [
13
13
+
pkgs.jq
14
14
+
]
15
15
+
}
8
16
INPUT=$(jq -c .)
9
17
if $(printf '%s' "$INPUT" | jq 'has("issue") or has("pull_request")'); then
10
18
${write_to_irc} "$(printf '%s' "$INPUT" | jq -r '
···
26
34
)"
27
35
'';
28
36
29
29
-
in {
37
37
+
in
38
38
+
{
30
39
krebs.iptables.tables.filter.INPUT.rules = [
31
31
-
{ predicate = "-p tcp --dport 44002"; target = "ACCEPT"; }
40
40
+
{
41
41
+
predicate = "-p tcp --dport 44002";
42
42
+
target = "ACCEPT";
43
43
+
}
32
44
];
33
45
krebs.reaktor2.fysiweb-github = {
34
46
hostname = "irc.libera.chat";
···
2
2
3
3
let
4
4
mainUser = config.users.extraUsers.mainUser;
5
5
-
vdoom = pkgs.writers.writeDash "vdoom" ''
6
6
-
${pkgs.zandronum}/bin/zandronum \
7
7
-
-fov 120 \
8
8
-
"$@"
9
9
-
'';
10
10
-
doom = pkgs.writers.writeDash "doom" ''
11
11
-
DOOM_DIR=''${DOOM_DIR:-~/doom/}
12
12
-
${vdoom} \
13
13
-
-file $DOOM_DIR/lib/brutalv21.pk3 \
14
14
-
"$@"
15
15
-
'';
16
16
-
doom1 = pkgs.writers.writeDashBin "doom1" ''
17
17
-
DOOM_DIR=''${DOOM_DIR:-~/doom/}
18
18
-
${doom} -iwad $DOOM_DIR/wads/stock/doom.wad "$@"
19
19
-
'';
20
20
-
doom2 = pkgs.writers.writeDashBin "doom2" ''
21
21
-
DOOM_DIR=''${DOOM_DIR:-~/doom/}
22
22
-
${doom} -iwad $DOOM_DIR/wads/stock/doom2.wad "$@"
23
23
-
'';
24
24
-
vdoom1 = pkgs.writers.writeDashBin "vdoom1" ''
25
25
-
DOOM_DIR=''${DOOM_DIR:-~/doom/}
26
26
-
${vdoom} -iwad $DOOM_DIR/wads/stock/doom.wad "$@"
27
27
-
'';
28
28
-
vdoom2 = pkgs.writers.writeDashBin "vdoom2" ''
29
29
-
DOOM_DIR=''${DOOM_DIR:-~/doom/}
30
30
-
${vdoom} -iwad $DOOM_DIR/wads/stock/doom2.wad "$@"
31
31
-
'';
32
5
33
33
-
doomservercfg = pkgs.writeText "doomserver.cfg" ''
34
34
-
skill 7
35
35
-
#survival true
36
36
-
#sv_maxlives 4
37
37
-
#sv_norespawn true
38
38
-
#sv_weapondrop true
39
39
-
no_jump true
40
40
-
#sv_noweaponspawn true
41
41
-
sv_sharekeys true
42
42
-
sv_survivalcountdowntime 1
43
43
-
sv_noteamselect true
44
44
-
sv_updatemaster false
45
45
-
#sv_coop_loseinventory true
46
46
-
#cl_startasspectator false
47
47
-
#lms_spectatorview false
48
48
-
'';
49
49
-
50
50
-
vdoomserver = pkgs.writers.writeDashBin "vdoomserver" ''
51
51
-
DOOM_DIR=''${DOOM_DIR:-~/doom/}
52
52
-
53
53
-
${pkgs.zandronum}/bin/zandronum-server \
54
54
-
+exec ${doomservercfg} \
55
55
-
"$@"
56
56
-
'';
57
57
-
58
58
-
in {
6
6
+
in
7
7
+
{
59
8
users.extraUsers = {
60
9
games = {
61
10
name = "games";
62
11
description = "user playing games";
63
12
home = "/home/games";
64
64
-
extraGroups = [ "audio" "video" "input" "loot" "pipewire" ];
13
13
+
extraGroups = [
14
14
+
"audio"
15
15
+
"video"
16
16
+
"input"
17
17
+
"loot"
18
18
+
"pipewire"
19
19
+
];
65
20
createHome = true;
66
21
useDefaultShell = true;
67
22
packages = with pkgs; [
···
90
45
'';
91
46
92
47
krebs.iptables.tables.filter.INPUT.rules = [
93
93
-
{ predicate = "-p tcp --dport 10666"; target = "ACCEPT"; }
94
94
-
{ predicate = "-p udp --dport 10666"; target = "ACCEPT"; }
48
48
+
{
49
49
+
predicate = "-p tcp --dport 10666";
50
50
+
target = "ACCEPT";
51
51
+
}
52
52
+
{
53
53
+
predicate = "-p udp --dport 10666";
54
54
+
target = "ACCEPT";
55
55
+
}
95
56
];
96
57
}
···
1
1
{ config, lib, ... }:
2
2
{
3
3
nix.gc = {
4
4
-
automatic = ! (lib.elem config.krebs.build.host.name [ "aergia" "ignavia" "mors" "xerxes" "coaxmetal" ] || config.boot.isContainer);
4
4
+
automatic =
5
5
+
!(
6
6
+
lib.elem config.krebs.build.host.name [
7
7
+
"aergia"
8
8
+
"ignavia"
9
9
+
"mors"
10
10
+
"xerxes"
11
11
+
"coaxmetal"
12
12
+
]
13
13
+
|| config.boot.isContainer
14
14
+
);
5
15
options = "--delete-older-than 15d";
6
16
};
7
17
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ lib, pkgs, ... }:
2
2
{
3
3
# vodafone router drifts out of time
4
4
services.timesyncd.servers = [
···
43
43
# DHCPPrefixDelegation = "yes";
44
44
};
45
45
dhcpServerStaticLeases = [
46
46
-
{ # printer
46
46
+
{
47
47
+
# printer
47
48
dhcpServerStaticLeaseConfig = {
48
49
Address = "10.42.0.4";
49
50
MACAddress = "3c:2a:f4:22:28:37";
50
51
};
51
52
}
52
52
-
{ # firetv
53
53
+
{
54
54
+
# firetv
53
55
dhcpServerStaticLeaseConfig = {
54
56
Address = "10.42.0.11";
55
57
MACAddress = "84:28:59:f0:d2:a8";
···
71
73
};
72
74
networking.networkmanager.unmanaged = [ "int0" ];
73
75
krebs.iptables.tables.filter.INPUT.rules = [
74
74
-
{ predicate = "-i int0"; target = "ACCEPT"; }
76
76
+
{
77
77
+
predicate = "-i int0";
78
78
+
target = "ACCEPT";
79
79
+
}
75
80
];
76
81
krebs.iptables.tables.filter.FORWARD.rules = [
77
77
-
{ predicate = "-i int0"; target = "ACCEPT"; }
78
78
-
{ predicate = "-o int0"; target = "ACCEPT"; }
79
79
-
{ predicate = "-p ipv6-icmp"; target = "ACCEPT"; v4 = false; }
82
82
+
{
83
83
+
predicate = "-i int0";
84
84
+
target = "ACCEPT";
85
85
+
}
86
86
+
{
87
87
+
predicate = "-o int0";
88
88
+
target = "ACCEPT";
89
89
+
}
90
90
+
{
91
91
+
predicate = "-p ipv6-icmp";
92
92
+
target = "ACCEPT";
93
93
+
v4 = false;
94
94
+
}
80
95
];
81
96
krebs.iptables.tables.nat.PREROUTING.rules = lib.mkBefore [
82
82
-
{ v6 = false; predicate = "-s 10.42.0.0/24"; target = "ACCEPT"; }
97
97
+
{
98
98
+
v6 = false;
99
99
+
predicate = "-s 10.42.0.0/24";
100
100
+
target = "ACCEPT";
101
101
+
}
83
102
];
84
103
krebs.iptables.tables.nat.POSTROUTING.rules = [
85
85
-
{ v6 = false; predicate = "-s 10.42.0.0/24"; target = "MASQUERADE"; }
104
104
+
{
105
105
+
v6 = false;
106
106
+
predicate = "-s 10.42.0.0/24";
107
107
+
target = "MASQUERADE";
108
108
+
}
86
109
];
87
110
88
111
networking.domain = "gg23";
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
2
8
let
3
9
git = self.inputs.stockholm.lib.git;
4
10
repos = krebs-repos;
···
8
14
brain = { };
9
15
};
10
16
11
11
-
12
12
-
make-krebs-repo = with git; name: { cgit ? {}, ... }: {
13
13
-
inherit cgit name;
14
14
-
public = false;
15
15
-
hooks = {
16
16
-
post-receive = pkgs.git-hooks.irc-announce {
17
17
-
nick = config.networking.hostName;
18
18
-
verbose = true;
19
19
-
channel = "#xxx";
20
20
-
# TODO remove the hardcoded hostname
21
21
-
server = "irc.r";
17
17
+
make-krebs-repo =
18
18
+
with git;
19
19
+
name:
20
20
+
{
21
21
+
cgit ? { },
22
22
+
...
23
23
+
}:
24
24
+
{
25
25
+
inherit cgit name;
26
26
+
public = false;
27
27
+
hooks = {
28
28
+
post-receive = pkgs.git-hooks.irc-announce {
29
29
+
nick = config.networking.hostName;
30
30
+
verbose = true;
31
31
+
channel = "#xxx";
32
32
+
# TODO remove the hardcoded hostname
33
33
+
server = "irc.r";
34
34
+
};
22
35
};
23
36
};
24
24
-
};
25
25
-
26
26
-
27
37
28
38
# TODO: get the list of all krebsministers
29
29
-
krebsminister = with config.krebs.users; [ makefu tv kmein ];
30
30
-
krebs-rules = repo:
31
31
-
set-owners repo [ config.krebs.users.lass ] ++ set-ro-access repo krebsminister;
39
39
+
krebsminister = with config.krebs.users; [
40
40
+
makefu
41
41
+
tv
42
42
+
kmein
43
43
+
];
44
44
+
krebs-rules = repo: set-owners repo [ config.krebs.users.lass ] ++ set-ro-access repo krebsminister;
32
45
33
33
-
set-ro-access = with git; repo: user:
46
46
+
set-ro-access =
47
47
+
with git;
48
48
+
repo: user:
34
49
lib.singleton {
35
50
inherit user;
36
51
repo = [ repo ];
37
52
perm = fetch;
38
53
};
39
54
40
40
-
set-owners = with git;repo: user:
55
55
+
set-owners =
56
56
+
with git;
57
57
+
repo: user:
41
58
lib.singleton {
42
59
inherit user;
43
60
repo = [ repo ];
44
44
-
perm = push "refs/*" [ non-fast-forward create delete merge ];
61
61
+
perm = push "refs/*" [
62
62
+
non-fast-forward
63
63
+
create
64
64
+
delete
65
65
+
merge
66
66
+
];
45
67
};
46
68
47
47
-
in {
69
69
+
in
70
70
+
{
48
71
imports = [
49
72
self.inputs.stockholm.nixosModules.git
50
73
];
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
2
8
3
9
let
4
10
git = self.inputs.stockholm.lib.git;
···
20
26
};
21
27
22
28
krebs.iptables.tables.filter.INPUT.rules = [
23
23
-
{ predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; }
29
29
+
{
30
30
+
predicate = "-i retiolum -p tcp --dport 80";
31
31
+
target = "ACCEPT";
32
32
+
}
24
33
];
25
34
26
35
system.activationScripts.spool-chmod = ''
···
32
41
inherit (config.krebs.git.cgit.settings) cache-root;
33
42
};
34
43
35
35
-
repos =
36
36
-
public-repos //
37
37
-
lib.optionalAttrs config.krebs.build.host.secure restricted-repos;
44
44
+
repos = public-repos // lib.optionalAttrs config.krebs.build.host.secure restricted-repos;
38
45
39
46
rules = lib.concatMap make-rules (lib.attrValues repos);
40
47
···
112
119
};
113
120
the_playlist = {
114
121
cgit.desc = "Good Music collection + tools";
115
115
-
cgit.section = "art";
122
122
+
cgit.section = "art";
116
123
};
117
124
workadventure-nix = {
118
125
cgit.desc = "Nix packaging for workadventure";
···
126
133
127
134
restricted-repos = lib.mapAttrs make-restricted-repo {
128
135
brain = {
129
129
-
collaborators = with config.krebs.users; [ tv makefu ];
136
136
+
collaborators = with config.krebs.users; [
137
137
+
tv
138
138
+
makefu
139
139
+
];
130
140
announce = true;
131
141
};
132
142
};
133
143
134
134
-
make-public-repo = name: { cgit ? {}, collaborators ? [], ... }: {
135
135
-
inherit cgit collaborators name;
136
136
-
public = true;
137
137
-
hooks = {
138
138
-
post-receive = ''
139
139
-
${pkgs.git-hooks.irc-announce {
140
140
-
# TODO make nick = config.krebs.build.host.name the default
141
141
-
nick = config.krebs.build.host.name;
142
142
-
channel = "#xxx";
143
143
-
# TODO define refs in some kind of option per repo
144
144
-
server = "irc.r";
145
145
-
verbose = config.krebs.build.host.name == "orange";
146
146
-
}}
147
147
-
${cgit-clear-cache}/bin/cgit-clear-cache
148
148
-
'';
144
144
+
make-public-repo =
145
145
+
name:
146
146
+
{
147
147
+
cgit ? { },
148
148
+
collaborators ? [ ],
149
149
+
...
150
150
+
}:
151
151
+
{
152
152
+
inherit cgit collaborators name;
153
153
+
public = true;
154
154
+
hooks = {
155
155
+
post-receive = ''
156
156
+
${pkgs.git-hooks.irc-announce {
157
157
+
# TODO make nick = config.krebs.build.host.name the default
158
158
+
nick = config.krebs.build.host.name;
159
159
+
channel = "#xxx";
160
160
+
# TODO define refs in some kind of option per repo
161
161
+
server = "irc.r";
162
162
+
verbose = config.krebs.build.host.name == "orange";
163
163
+
}}
164
164
+
${cgit-clear-cache}/bin/cgit-clear-cache
165
165
+
'';
166
166
+
};
149
167
};
150
150
-
};
151
168
152
152
-
make-public-repo-silent = name: { cgit ? {}, ... }: {
153
153
-
inherit cgit name;
154
154
-
public = true;
155
155
-
};
156
156
-
157
157
-
make-restricted-repo = name: { admins ? [], collaborators ? [], announce ? true, hooks ? {}, ... }: {
158
158
-
inherit admins collaborators name;
159
159
-
public = false;
160
160
-
hooks = {
161
161
-
post-receive = ''
162
162
-
${lib.optionalString announce (pkgs.git-hooks.irc-announce {
163
163
-
# TODO make nick = config.krebs.build.host.name the default
164
164
-
nick = config.krebs.build.host.name;
165
165
-
channel = "#xxx";
166
166
-
# TODO define refs in some kind of option per repo
167
167
-
refs = [
168
168
-
"refs/heads/master"
169
169
-
"refs/heads/staging*"
170
170
-
];
171
171
-
server = "irc.r";
172
172
-
verbose = false;
173
173
-
})}
174
174
-
${cgit-clear-cache}/bin/cgit-clear-cache
175
175
-
'';
176
176
-
} // hooks;
177
177
-
};
169
169
+
make-restricted-repo =
170
170
+
name:
171
171
+
{
172
172
+
admins ? [ ],
173
173
+
collaborators ? [ ],
174
174
+
announce ? true,
175
175
+
hooks ? { },
176
176
+
...
177
177
+
}:
178
178
+
{
179
179
+
inherit admins collaborators name;
180
180
+
public = false;
181
181
+
hooks = {
182
182
+
post-receive = ''
183
183
+
${lib.optionalString announce (
184
184
+
pkgs.git-hooks.irc-announce {
185
185
+
# TODO make nick = config.krebs.build.host.name the default
186
186
+
nick = config.krebs.build.host.name;
187
187
+
channel = "#xxx";
188
188
+
# TODO define refs in some kind of option per repo
189
189
+
refs = [
190
190
+
"refs/heads/master"
191
191
+
"refs/heads/staging*"
192
192
+
];
193
193
+
server = "irc.r";
194
194
+
verbose = false;
195
195
+
}
196
196
+
)}
197
197
+
${cgit-clear-cache}/bin/cgit-clear-cache
198
198
+
'';
199
199
+
} // hooks;
200
200
+
};
178
201
179
202
make-rules =
180
203
with git // config.krebs.users;
181
204
repo:
182
182
-
lib.singleton {
183
183
-
user = [ lass ];
184
184
-
repo = [ repo ];
185
185
-
perm = push "refs/*" [ non-fast-forward create delete merge ];
186
186
-
} ++
187
187
-
lib.optional (lib.length (repo.admins or []) > 0) {
188
188
-
user = repo.admins;
189
189
-
repo = [ repo ];
190
190
-
perm = push "refs/*" [ non-fast-forward create delete merge ];
191
191
-
} ++
192
192
-
lib.optional (lib.length (repo.collaborators or []) > 0) {
193
193
-
user = repo.collaborators;
194
194
-
repo = [ repo ];
195
195
-
perm = fetch;
196
196
-
} ++
197
197
-
lib.optional repo.public {
198
198
-
user = lib.attrValues config.krebs.users;
199
199
-
repo = [ repo ];
200
200
-
perm = fetch;
201
201
-
};
205
205
+
lib.singleton {
206
206
+
user = [ lass ];
207
207
+
repo = [ repo ];
208
208
+
perm = push "refs/*" [
209
209
+
non-fast-forward
210
210
+
create
211
211
+
delete
212
212
+
merge
213
213
+
];
214
214
+
}
215
215
+
++ lib.optional (lib.length (repo.admins or [ ]) > 0) {
216
216
+
user = repo.admins;
217
217
+
repo = [ repo ];
218
218
+
perm = push "refs/*" [
219
219
+
non-fast-forward
220
220
+
create
221
221
+
delete
222
222
+
merge
223
223
+
];
224
224
+
}
225
225
+
++ lib.optional (lib.length (repo.collaborators or [ ]) > 0) {
226
226
+
user = repo.collaborators;
227
227
+
repo = [ repo ];
228
228
+
perm = fetch;
229
229
+
}
230
230
+
++ lib.optional repo.public {
231
231
+
user = lib.attrValues config.krebs.users;
232
232
+
repo = [ repo ];
233
233
+
perm = fetch;
234
234
+
};
202
235
203
203
-
in out
236
236
+
in
237
237
+
out
···
1
1
-
{ pkgs, lib, ... }:
1
1
+
{ lib, ... }:
2
2
with lib;
3
3
{
4
4
security.chromiumSuidSandbox.enable = true;
···
1
1
-
{ config, lib, pkgs, ... }: let
2
2
-
3
3
-
vmip = "192.168.122.208";
4
4
-
5
5
-
in {
1
1
+
{ pkgs, ... }:
2
2
+
{
6
3
users.users.riot = {
7
4
uid = genid "riot";
8
5
isNormalUser = true;
···
20
17
];
21
18
22
19
krebs.iptables.tables.nat.PREROUTING.rules = mkBefore [
23
23
-
{ v6 = false; predicate = "-d 213.239.205.246 -p tcp --dport 22"; target = "DNAT --to-destination 192.168.122.208:22"; }
24
24
-
{ v6 = false; predicate = "-d 213.239.205.246 -p tcp --dport 25"; target = "DNAT --to-destination 192.168.122.208:25"; }
25
25
-
{ v6 = false; predicate = "-d 213.239.205.246 -p tcp --dport 80"; target = "DNAT --to-destination 192.168.122.208:1080"; }
26
26
-
{ v6 = false; predicate = "-d 213.239.205.246 -p tcp --dport 443"; target = "DNAT --to-destination 192.168.122.208:1443"; }
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
+
}
27
40
];
28
41
29
42
krebs.iptables.tables.filter.FORWARD.rules = mkBefore [
30
30
-
{ v6 = false; predicate = "-d 192.168.122.208 -p tcp --dport 22 -m state --state NEW,ESTABLISHED,RELATED"; target = "ACCEPT"; }
31
31
-
{ v6 = false; predicate = "-d 192.168.122.208 -p tcp --dport 25 -m state --state NEW,ESTABLISHED,RELATED"; target = "ACCEPT"; }
32
32
-
{ v6 = false; predicate = "-d 192.168.122.208 -p tcp --dport 1080 -m state --state NEW,ESTABLISHED,RELATED"; target = "ACCEPT"; }
33
33
-
{ v6 = false; predicate = "-d 192.168.122.208 -p tcp --dport 1443 -m state --state NEW,ESTABLISHED,RELATED"; target = "ACCEPT"; }
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
+
}
34
63
];
35
64
36
65
krebs.iptables.tables.nat.OUTPUT.rules = mkBefore [
37
37
-
{ v6 = false; predicate = "-d 213.239.205.246 -p tcp --dport 443"; target = "DNAT --to-destination 192.168.122.208:1443"; }
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
+
}
38
71
];
39
72
40
73
# TODO use bridge interfaces instead of this crap
41
41
-
systemd.services.libvirtd.serviceConfig.ExecStartPost = let
42
42
-
restart-iptables = pkgs.writeDash "restart-iptables" ''
43
43
-
#soo hacky
44
44
-
${pkgs.coreutils}/bin/sleep 5s
45
45
-
${pkgs.systemd}/bin/systemctl restart krebs-iptables.service
46
46
-
'';
47
47
-
in restart-iptables;
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;
48
83
}
···
1
1
-
{ config, lib, pkgs, ... }: let
2
2
-
vim_nix = import ./vim.nix { inherit lib pkgs; config = {}; };
3
3
-
in {
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
7
7
+
let
8
8
+
vim_nix = import ./vim.nix {
9
9
+
inherit lib pkgs;
10
10
+
config = { };
11
11
+
};
12
12
+
in
13
13
+
{
4
14
programs.git = {
5
15
enable = true;
6
16
userName = "lassulus";
···
6
6
users.users.media = {
7
7
isNormalUser = true;
8
8
uid = self.inputs.stockholm.lib.genid_uint31 "media";
9
9
-
extraGroups = [ "video" "audio" "pipewire" ];
9
9
+
extraGroups = [
10
10
+
"video"
11
11
+
"audio"
12
12
+
"pipewire"
13
13
+
];
10
14
packages = [
11
15
(pkgs.writers.writeDashBin "mpv" ''
12
16
if test -e "$1"; then
···
68
72
User = "media";
69
73
RemainAfterExit = true;
70
74
Nice = "-10";
71
71
-
ExecStart = ''${pkgs.tmux}/bin/tmux -2 new-session -d -s mpvd -- /run/current-system/sw/bin/ipc-mpv \
72
72
-
--audio-display=no --audio-channels=stereo \
73
73
-
--audio-samplerate=48000 --audio-format=s16 \
74
74
-
--ao-pcm-file=/run/snapserver/snapfifo --ao=pcm \
75
75
-
--audio-delay=-1 \
76
76
-
--network-timeout=3 \
77
77
-
--untimed --cache-pause=no \
78
78
-
--idle=yes --force-window=yes \
79
79
-
--loop-playlist=inf \
80
80
-
--input-ipc-server=/tmp/mpv.ipc
75
75
+
ExecStart = ''
76
76
+
${pkgs.tmux}/bin/tmux -2 new-session -d -s mpvd -- /run/current-system/sw/bin/ipc-mpv \
77
77
+
--audio-display=no --audio-channels=stereo \
78
78
+
--audio-samplerate=48000 --audio-format=s16 \
79
79
+
--ao-pcm-file=/run/snapserver/snapfifo --ao=pcm \
80
80
+
--audio-delay=-1 \
81
81
+
--network-timeout=3 \
82
82
+
--untimed --cache-pause=no \
83
83
+
--idle=yes --force-window=yes \
84
84
+
--loop-playlist=inf \
85
85
+
--input-ipc-server=/tmp/mpv.ipc
81
86
'';
82
87
ExecStop = "${pkgs.tmux}/bin/tmux kill-session -t mpvd";
83
88
ExecStartPre = [
···
16
16
clanCore.facts.services.hotdog-container = {
17
17
secret."hotdog.sync.key" = { };
18
18
public."hotdog.sync.pub" = { };
19
19
-
generator.path = with pkgs; [ coreutils openssh ];
19
19
+
generator.path = with pkgs; [
20
20
+
coreutils
21
21
+
openssh
22
22
+
];
20
23
generator.script = ''
21
24
ssh-keygen -t ed25519 -N "" -f "$secrets"/hotdog.sync.key
22
25
mv "$secrets"/hotdog.sync.key.pub "$facts"/hotdog.sync.pub
···
1
1
-
{ config, pkgs, lib, ... }: let
2
2
-
interdimensional-cable = let
3
3
-
nimaid-github-io = pkgs.fetchFromGitHub {
4
4
-
owner = "nimaid";
5
5
-
repo = "nimaid.github.io";
6
6
-
rev = "5c4f8dda1216d578ad7cd6b0052d5ebf3696ea12";
7
7
-
sha256 = "sha256-w0u72Q0CkxRu8lr/pp863POzAg09xssbot9pOhSsAn4=";
8
8
-
};
9
9
-
in pkgs.writeShellScriptBin "interdimensional-cable" ''
10
10
-
export PATH=${lib.makeBinPath [ pkgs.mpv pkgs.jq pkgs.gnused ]}
11
11
-
mpv --shuffle --playlist=<(jq -r '.videos[]' ${nimaid-github-io}/tv/interdimensional_database.json | sed 's#^#https://youtu.be/#')
12
12
-
'';
13
13
-
in {
1
1
+
{
2
2
+
config,
3
3
+
pkgs,
4
4
+
lib,
5
5
+
...
6
6
+
}:
7
7
+
let
8
8
+
interdimensional-cable =
9
9
+
let
10
10
+
nimaid-github-io = pkgs.fetchFromGitHub {
11
11
+
owner = "nimaid";
12
12
+
repo = "nimaid.github.io";
13
13
+
rev = "5c4f8dda1216d578ad7cd6b0052d5ebf3696ea12";
14
14
+
sha256 = "sha256-w0u72Q0CkxRu8lr/pp863POzAg09xssbot9pOhSsAn4=";
15
15
+
};
16
16
+
in
17
17
+
pkgs.writeShellScriptBin "interdimensional-cable" ''
18
18
+
export PATH=${
19
19
+
lib.makeBinPath [
20
20
+
pkgs.mpv
21
21
+
pkgs.jq
22
22
+
pkgs.gnused
23
23
+
]
24
24
+
}
25
25
+
mpv --shuffle --playlist=<(jq -r '.videos[]' ${nimaid-github-io}/tv/interdimensional_database.json | sed 's#^#https://youtu.be/#')
26
26
+
'';
27
27
+
in
28
28
+
{
14
29
systemd.services.reaktor2-idc.serviceConfig.DynamicUser = lib.mkForce false;
15
30
systemd.services.reaktor2-idc.serviceConfig.Group = lib.mkForce "users";
16
31
···
39
54
activate = "match";
40
55
pattern = ''^!([^ ]+)(?:\s*(.*))?'';
41
56
command = 1;
42
42
-
arguments = [2];
57
57
+
arguments = [ 2 ];
43
58
commands = {
44
59
next.filename = pkgs.writeDash "next" ''
45
60
DISPLAY=:0 ${pkgs.xdotool}/bin/xdotool key "enter"
···
1
1
-
{ pkgs, config, ... }:
1
1
+
{ config, ... }:
2
2
3
3
let
4
4
# TODO: make this a parameter
5
5
domain = "io.lassul.us";
6
6
-
in {
6
6
+
in
7
7
+
{
7
8
8
9
services.iodine.server = {
9
10
enable = true;
···
13
14
};
14
15
15
16
krebs.iptables.tables.filter.INPUT.rules = [
16
16
-
{ predicate = "-p udp --dport 53"; target = "ACCEPT";}
17
17
+
{
18
18
+
predicate = "-p udp --dport 53";
19
19
+
target = "ACCEPT";
20
20
+
}
17
21
];
18
22
19
23
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
services.ipfs = {
4
4
enable = true;
···
1
1
-
{ config, lib, pkgs, ... }:
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
-
{ v6 = false; predicate = "-i virbr0 -p udp -m udp --dport 53"; target = "ACCEPT"; }
9
9
-
{ v6 = false; predicate = "-i virbr0 -p tcp -m tcp --dport 53"; target = "ACCEPT"; }
10
10
-
{ v6 = false; predicate = "-i virbr0 -p udp -m udp --dport 67"; target = "ACCEPT"; }
11
11
-
{ v6 = false; predicate = "-i virbr0 -p tcp -m tcp --dport 67"; target = "ACCEPT"; }
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
+
}
12
28
];
13
29
krebs.iptables.tables.filter.FORWARD.rules = [
14
14
-
{ v6 = false; predicate = "-d 192.168.122.0/24 -o virbr0 -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
15
15
-
{ v6 = false; predicate = "-s 192.168.122.0/24 -i virbr0"; target = "ACCEPT"; }
16
16
-
{ v6 = false; predicate = "-i virbr0 -o virbr0"; target = "ACCEPT"; }
17
17
-
{ v6 = false; predicate = "-o virbr0"; target = "REJECT --reject-with icmp-port-unreachable"; }
18
18
-
{ v6 = false; predicate = "-i virbr0"; target = "REJECT --reject-with icmp-port-unreachable"; }
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
+
}
19
55
];
20
56
krebs.iptables.tables.filter.OUTPUT.rules = [
21
21
-
{ v6 = false; predicate = "-o virbr0 -p udp -m udp --dport 68"; target = "ACCEPT"; }
57
57
+
{
58
58
+
v6 = false;
59
59
+
predicate = "-o virbr0 -p udp -m udp --dport 68";
60
60
+
target = "ACCEPT";
61
61
+
}
22
62
];
23
63
krebs.iptables.tables.nat.PREROUTING.rules = lib.mkBefore [
24
24
-
{ v6 = false; predicate = "-s 192.168.122.0/24"; target = "ACCEPT"; }
64
64
+
{
65
65
+
v6 = false;
66
66
+
predicate = "-s 192.168.122.0/24";
67
67
+
target = "ACCEPT";
68
68
+
}
25
69
];
26
70
krebs.iptables.tables.nat.POSTROUTING.rules = [
27
27
-
{ v6 = false; predicate = "-s 192.168.122.0/24 -d 224.0.0.0/24"; target = "RETURN"; }
28
28
-
{ v6 = false; predicate = "-s 192.168.122.0/24 -d 255.255.255.255"; target = "RETURN"; }
29
29
-
{ v6 = false; predicate = "-s 192.168.122.0/24 ! -d 192.168.122.0/24"; target = "MASQUERADE"; }
30
30
-
{ v6 = false; predicate = "-s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp"; target = "MASQUERADE --to-ports 1024-65535"; }
31
31
-
{ v6 = false; predicate = "-s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp"; target = "MASQUERADE --to-ports 1024-65535"; }
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
+
}
32
96
];
33
97
}
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
3
3
let
4
4
···
6
6
${pkgs.python27Packages.livestreamer}/bin/livestreamer --http-header Client-ID=jzkbprff40iqj646a697cyrvl0zt2m6 -p mpv "$@"
7
7
'';
8
8
9
9
-
in {
9
9
+
in
10
10
+
{
10
11
environment.systemPackages = [ stream ];
11
12
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ lib, pkgs, ... }:
2
2
3
3
let
4
4
···
69
69
dn42 = [ "to:dn42@lists.nox.tf" ];
70
70
eloop = [ "to:eloop.org" ];
71
71
github = [ "to:github@lassul.us" ];
72
72
-
gmail = [ "to:gmail@lassul.us" "to:lassulus@gmail.com" "lassulus@googlemail.com" ];
73
73
-
india = [ "to:hillhackers@lists.hillhacks.in" "to:hackbeach@lists.hackbeach.in" "to:hackbeach@mail.hackbeach.in" ];
74
74
-
kaosstuff = [ "to:gearbest@lassul.us" "to:banggood@lassul.us" "to:tomtop@lassul.us" ];
72
72
+
gmail = [
73
73
+
"to:gmail@lassul.us"
74
74
+
"to:lassulus@gmail.com"
75
75
+
"lassulus@googlemail.com"
76
76
+
];
77
77
+
india = [
78
78
+
"to:hillhackers@lists.hillhacks.in"
79
79
+
"to:hackbeach@lists.hackbeach.in"
80
80
+
"to:hackbeach@mail.hackbeach.in"
81
81
+
];
82
82
+
kaosstuff = [
83
83
+
"to:gearbest@lassul.us"
84
84
+
"to:banggood@lassul.us"
85
85
+
"to:tomtop@lassul.us"
86
86
+
];
75
87
lugs = [ "to:lugs@lug-s.org" ];
76
88
meetup = [ "to:meetup@lassul.us" ];
77
77
-
nix = [ "to:nix-devel@googlegroups.com" "to:nix@lassul.us" ];
89
89
+
nix = [
90
90
+
"to:nix-devel@googlegroups.com"
91
91
+
"to:nix@lassul.us"
92
92
+
];
78
93
patreon = [ "to:patreon@lassul.us" ];
79
94
paypal = [ "to:paypal@lassul.us" ];
80
95
ptl = [ "to:ptl@posttenebraslab.ch" ];
81
96
retiolum = [ "to:lass@mors.r" ];
82
97
security = [
83
83
-
"to:seclists.org" "to:bugtraq" "to:securityfocus@lassul.us"
98
98
+
"to:seclists.org"
99
99
+
"to:bugtraq"
100
100
+
"to:securityfocus@lassul.us"
84
101
"to:security-announce@lists.apple.com"
85
102
];
86
103
shack = [ "to:shackspace.de" ];
87
104
steam = [ "to:steam@lassul.us" ];
88
88
-
tinc = [ "to:tinc@tinc-vpn.org" "to:tinc-devel@tinc-vpn.org" ];
105
105
+
tinc = [
106
106
+
"to:tinc@tinc-vpn.org"
107
107
+
"to:tinc-devel@tinc-vpn.org"
108
108
+
];
89
109
wireguard = [ "to:wireguard@lists.zx2c4" ];
90
90
-
zzz = [ "to:pizza@lassul.us" "to:spam@krebsco.de" ];
110
110
+
zzz = [
111
111
+
"to:pizza@lassul.us"
112
112
+
"to:spam@krebsco.de"
113
113
+
];
91
114
};
92
115
93
116
tag-new-mails = pkgs.writeDashBin "nm-tag-init" ''
94
117
${pkgs.notmuch}/bin/notmuch new
95
118
${lib.concatMapStringsSep "\n" (i: ''
96
119
mkdir -p "$HOME/Maildir/.${i.name}/cur"
97
97
-
for mail in $(${pkgs.notmuch}/bin/notmuch search --output=files 'tag:inbox and (${lib.concatMapStringsSep " or " (f: "${f}") i.value})'); do
120
120
+
for mail in $(${pkgs.notmuch}/bin/notmuch search --output=files 'tag:inbox and (${
121
121
+
lib.concatMapStringsSep " or " (f: "${f}") i.value
122
122
+
})'); do
98
123
if test -e "$mail"; then
99
124
mv "$mail" "$HOME/Maildir/.${i.name}/cur/"
100
125
else
101
126
echo "$mail does not exist"
102
127
fi
103
128
done
104
104
-
${pkgs.notmuch}/bin/notmuch tag -inbox +${i.name} -- tag:inbox ${lib.concatMapStringsSep " or " (f: "${f}") i.value}
129
129
+
${pkgs.notmuch}/bin/notmuch tag -inbox +${i.name} -- tag:inbox ${
130
130
+
lib.concatMapStringsSep " or " (f: "${f}") i.value
131
131
+
}
105
132
'') (lib.mapAttrsToList lib.nameValuePair mailboxes)}
106
133
${pkgs.notmuch}/bin/notmuch new
107
134
${pkgs.notmuch}/bin/notmuch dump > "$HOME/Maildir/notmuch.backup"
···
110
137
tag-old-mails = pkgs.writeDashBin "nm-tag-old" ''
111
138
set -efux
112
139
${lib.concatMapStringsSep "\n" (i: ''
113
113
-
${pkgs.notmuch}/bin/notmuch tag -inbox -archive +${i.name} -- ${lib.concatMapStringsSep " or " (f: "${f}") i.value}
140
140
+
${pkgs.notmuch}/bin/notmuch tag -inbox -archive +${i.name} -- ${
141
141
+
lib.concatMapStringsSep " or " (f: "${f}") i.value
142
142
+
}
114
143
mkdir -p "$HOME/Maildir/.${i.name}/cur"
115
115
-
for mail in $(${pkgs.notmuch}/bin/notmuch search --output=files ${lib.concatMapStringsSep " or " (f: "${f}") i.value}); do
144
144
+
for mail in $(${pkgs.notmuch}/bin/notmuch search --output=files ${
145
145
+
lib.concatMapStringsSep " or " (f: "${f}") i.value
146
146
+
}); do
116
147
if test -e "$mail"; then
117
148
mv "$mail" "$HOME/Maildir/.${i.name}/cur/"
118
149
else
···
151
182
152
183
virtual-mailboxes "Unread" "notmuch://?query=tag:unread"
153
184
virtual-mailboxes "INBOX" "notmuch://?query=tag:inbox"
154
154
-
${lib.concatMapStringsSep "\n" (i: ''${" "}virtual-mailboxes "${i.name}" "notmuch://?query=tag:${i.name}"'') (lib.mapAttrsToList lib.nameValuePair mailboxes)}
185
185
+
${lib.concatMapStringsSep "\n" (
186
186
+
i: ''${" "}virtual-mailboxes "${i.name}" "notmuch://?query=tag:${i.name}"''
187
187
+
) (lib.mapAttrsToList lib.nameValuePair mailboxes)}
155
188
virtual-mailboxes "TODO" "notmuch://?query=tag:TODO"
156
189
virtual-mailboxes "Starred" "notmuch://?query=tag:*"
157
190
virtual-mailboxes "Archive" "notmuch://?query=tag:archive"
···
261
294
];
262
295
};
263
296
264
264
-
in {
297
297
+
in
298
298
+
{
265
299
environment.variables.NOTMUCH_CONFIG = toString notmuch-config;
266
300
environment.systemPackages = [
267
301
msmtp
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
3
3
let
4
4
mcExt = pkgs.writeText "mc.ext" ''
···
205
205
View=/run/current-system/sw/bin/xdg-open %f
206
206
'';
207
207
208
208
-
in {
208
208
+
in
209
209
+
{
209
210
environment.systemPackages = [
210
211
(pkgs.symlinkJoin {
211
212
name = "mc";
212
213
paths = [
213
214
(pkgs.writeDashBin "mc" ''
214
214
-
export MC_DATADIR=${pkgs.write "mc-ext" {
215
215
+
export MC_DATADIR=${
216
216
+
pkgs.write "mc-ext" {
215
217
"/mc.ext.ini".link = mcExt;
216
218
"/sfs.ini".text = "";
217
217
-
}};
219
219
+
}
220
220
+
};
218
221
export TERM=xterm-256color
219
222
exec ${pkgs.mc}/bin/mc -S nicedark "$@"
220
223
'')
···
223
226
})
224
227
];
225
228
}
226
226
-
···
1
1
-
{ pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
services.minecraft-server = {
4
4
enable = true;
···
1
1
-
{ pkgs, ... }: let
2
2
-
3
3
-
in {
1
1
+
{ ... }:
2
2
+
{
4
3
services.minetest-server = {
5
4
enable = true;
6
5
};
7
6
krebs.iptables.tables.filter.INPUT.rules = [
8
8
-
{ predicate = "-p tcp --dport 30000"; target = "ACCEPT"; }
9
9
-
{ predicate = "-p udp --dport 30000"; target = "ACCEPT"; }
7
7
+
{
8
8
+
predicate = "-p tcp --dport 30000";
9
9
+
target = "ACCEPT";
10
10
+
}
11
11
+
{
12
12
+
predicate = "-p udp --dport 30000";
13
13
+
target = "ACCEPT";
14
14
+
}
10
15
];
11
16
}
···
1
1
-
{ pkgs, lib, ... }:
1
1
+
{ pkgs, ... }:
2
2
3
3
let
4
4
dl_subs = pkgs.writers.writeDashBin "dl_subs" ''
···
55
55
Y_RES=1081
56
56
# we need to disable sponsorblock local database because of
57
57
# https://github.com/po5/mpv_sponsorblock/issues/31
58
58
-
exec ${pkgs.mpv.override {
59
59
-
scripts = with pkgs.mpvScripts; [
60
60
-
sponsorblock
61
61
-
quality-menu
62
62
-
vr-reversal
63
63
-
];
64
64
-
}}/bin/mpv \
58
58
+
exec ${
59
59
+
pkgs.mpv.override {
60
60
+
scripts = with pkgs.mpvScripts; [
61
61
+
sponsorblock
62
62
+
quality-menu
63
63
+
vr-reversal
64
64
+
];
65
65
+
}
66
66
+
}/bin/mpv \
65
67
--no-config \
66
68
--input-conf=${mpvInput} \
67
69
--include=${mpvConfig} \
···
76
78
];
77
79
};
78
80
79
79
-
in {
81
81
+
in
82
82
+
{
80
83
environment.systemPackages = [
81
84
mpv
82
85
dl_subs
···
1
1
{ config, pkgs, ... }:
2
2
3
3
{
4
4
-
systemd.services.muchsync = let
5
5
-
hosts = [
6
6
-
"coaxmetal.r"
7
7
-
"mors.r"
8
8
-
"green.r"
9
9
-
];
10
10
-
in {
11
11
-
description = "sync mails";
12
12
-
environment = {
13
13
-
NOTMUCH_CONFIG = config.environment.variables.NOTMUCH_CONFIG;
4
4
+
systemd.services.muchsync =
5
5
+
let
6
6
+
hosts = [
7
7
+
"coaxmetal.r"
8
8
+
"mors.r"
9
9
+
"green.r"
10
10
+
];
11
11
+
in
12
12
+
{
13
13
+
description = "sync mails";
14
14
+
environment = {
15
15
+
NOTMUCH_CONFIG = config.environment.variables.NOTMUCH_CONFIG;
16
16
+
};
17
17
+
after = [ "network.target" ];
18
18
+
19
19
+
restartIfChanged = false;
20
20
+
21
21
+
path = [
22
22
+
pkgs.notmuch
23
23
+
pkgs.openssh
24
24
+
];
25
25
+
26
26
+
startAt = "*:*"; # run every minute
27
27
+
serviceConfig = {
28
28
+
User = "lass";
29
29
+
Type = "oneshot";
30
30
+
ExecStart = pkgs.writeDash "sync-mails" ''
31
31
+
set -euf
32
32
+
33
33
+
/run/current-system/sw/bin/nm-tag-init 2>/dev/null
34
34
+
${concatMapStringsSep "\n" (host: ''
35
35
+
echo syncing ${host}:
36
36
+
${pkgs.muchsync}/bin/muchsync -s 'ssh -CTaxq -o ConnectTimeout=4' --nonew lass@${host} || :
37
37
+
'') hosts}
38
38
+
'';
39
39
+
};
14
40
};
15
15
-
after = [ "network.target" ];
16
16
-
17
17
-
restartIfChanged = false;
18
18
-
19
19
-
path = [
20
20
-
pkgs.notmuch
21
21
-
pkgs.openssh
22
22
-
];
23
23
-
24
24
-
startAt = "*:*"; # run every minute
25
25
-
serviceConfig = {
26
26
-
User = "lass";
27
27
-
Type = "oneshot";
28
28
-
ExecStart = pkgs.writeDash "sync-mails" ''
29
29
-
set -euf
30
30
-
31
31
-
/run/current-system/sw/bin/nm-tag-init 2>/dev/null
32
32
-
${concatMapStringsSep "\n" (host: ''
33
33
-
echo syncing ${host}:
34
34
-
${pkgs.muchsync}/bin/muchsync -s 'ssh -CTaxq -o ConnectTimeout=4' --nonew lass@${host} || :
35
35
-
'') hosts}
36
36
-
'';
37
37
-
};
38
38
-
};
39
41
}
···
1
1
-
{ self, config, lib, pkgs, ... }: let
2
2
-
write_to_irc = chan: pkgs.writeDash "write_to_irc" ''
3
3
-
${pkgs.curl}/bin/curl -fsSv --unix-socket '${lib.removePrefix "unix:" config.krebs.reaktor2.mumble-reminder.API.listen}' http://z/ \
4
4
-
-H content-type:application/json \
5
5
-
-d "$(${pkgs.jq}/bin/jq -n \
6
6
-
--arg text "$1" '{
7
7
-
command:"PRIVMSG",
8
8
-
params:["${chan}",$text]
9
9
-
}'
10
10
-
)"
11
11
-
'';
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
8
8
+
let
9
9
+
write_to_irc =
10
10
+
chan:
11
11
+
pkgs.writeDash "write_to_irc" ''
12
12
+
${pkgs.curl}/bin/curl -fsSv --unix-socket '${lib.removePrefix "unix:" config.krebs.reaktor2.mumble-reminder.API.listen}' http://z/ \
13
13
+
-H content-type:application/json \
14
14
+
-d "$(${pkgs.jq}/bin/jq -n \
15
15
+
--arg text "$1" '{
16
16
+
command:"PRIVMSG",
17
17
+
params:["${chan}",$text]
18
18
+
}'
19
19
+
)"
20
20
+
'';
12
21
animals = ''
13
22
Erdferkel
14
23
Paviane
···
62
71
};
63
72
};
64
73
65
65
-
in {
74
74
+
in
75
75
+
{
66
76
imports = [
67
77
self.inputs.stockholm.nixosModules.reaktor2
68
78
];
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ lib, ... }:
2
2
{
3
3
services.murmur = {
4
4
enable = true;
···
8
8
autobanTime = 30;
9
9
};
10
10
krebs.iptables.tables.filter.INPUT.rules = [
11
11
-
{ predicate = "-p tcp --dport 64738"; target = "ACCEPT";}
12
12
-
{ predicate = "-p udp --dport 64738"; target = "ACCEPT";}
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
+
}
13
19
];
14
20
15
21
systemd.services.docker-mumble-web.serviceConfig = {
···
9
9
name = "nether";
10
10
};
11
11
services.zerotierone.localConf = {
12
12
-
settings.interfacePrefixBlacklist = [ "retiolum" "wiregrill" "mycelium" ];
12
12
+
settings.interfacePrefixBlacklist = [
13
13
+
"retiolum"
14
14
+
"wiregrill"
15
15
+
"mycelium"
16
16
+
];
13
17
};
14
18
}
···
1
1
-
{ self, pkgs, lib, ... }:
1
1
+
{
2
2
+
self,
3
3
+
pkgs,
4
4
+
lib,
5
5
+
...
6
6
+
}:
2
7
{
3
8
networking.wireless.enable = lib.mkForce false;
4
9
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ lib, ... }:
2
2
{
3
3
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
4
4
systemd.services.systemd-networkd.stopIfChanged = false;
···
1
1
{
2
2
-
networking.firewall.allowedTCPPorts = [ 80 443 ];
2
2
+
networking.firewall.allowedTCPPorts = [
3
3
+
80
4
4
+
443
5
5
+
];
3
6
security.acme.acceptTerms = true;
4
7
security.acme.defaults.email = "acme@lassul.us";
5
8
···
1
1
-
{ pkgs, ... }:
1
1
+
{ ... }:
2
2
# Enables second factor for ssh password login
3
3
4
4
## Usage:
···
1
1
-
{ self, config, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
users.users.pairprogramming = {
4
9
uid = self.inputs.stockholm.lib.genid_uint31 "pairprogramming";
···
15
20
};
16
21
17
22
virtualisation.podman.enable = true;
18
18
-
19
23
20
24
environment.systemPackages = [
21
25
pkgs.ripgrep
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
3
3
{
4
4
users.users.mainUser.packages = with pkgs; [
···
1
1
-
{ config, lib, pkgs, self, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
self,
6
6
+
...
7
7
+
}:
2
8
3
9
{
4
10
imports = [
···
23
29
proxy_set_header Host $host;
24
30
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.paste.port};
25
31
'';
26
26
-
locations."/image".extraConfig = /* nginx */ ''
27
27
-
client_max_body_size 40M;
32
32
+
locations."/image".extraConfig = # nginx
33
33
+
''
34
34
+
client_max_body_size 40M;
28
35
29
29
-
proxy_set_header Host $host;
30
30
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
31
31
-
proxy_set_header X-Forwarded-Proto $scheme;
36
36
+
proxy_set_header Host $host;
37
37
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38
38
+
proxy_set_header X-Forwarded-Proto $scheme;
32
39
33
33
-
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port};
34
34
-
proxy_pass_header Server;
35
35
-
'';
40
40
+
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port};
41
41
+
proxy_pass_header Server;
42
42
+
'';
36
43
extraConfig = ''
37
44
add_header 'Access-Control-Allow-Origin' '*';
38
45
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
···
89
96
90
97
krebs.htgen.paste = {
91
98
port = 9081;
92
92
-
script = /* sh */ ''
93
93
-
(. ${pkgs.htgen-paste}/bin/htgen-paste)
94
94
-
'';
99
99
+
script = # sh
100
100
+
''
101
101
+
(. ${pkgs.htgen-paste}/bin/htgen-paste)
102
102
+
'';
95
103
};
96
104
97
105
systemd.services.paste-gc = {
···
106
114
107
115
krebs.htgen.paste-form = {
108
116
port = 7770;
109
109
-
script = /* sh */ ''
110
110
-
export PATH=${lib.makeBinPath [
111
111
-
pkgs.curl
112
112
-
pkgs.gnused
113
113
-
]}:$PATH
114
114
-
(. ${pkgs.writeScript "paste-form" ''
115
115
-
case "$Method" in
116
116
-
'POST')
117
117
-
ref=$(head -c $req_content_length | sed '0,/^\r$/d;$d' | curl -fSs --data-binary @- https://p.krebsco.de | sed '1d;s/^http:/https:/')
117
117
+
script = # sh
118
118
+
''
119
119
+
export PATH=${
120
120
+
lib.makeBinPath [
121
121
+
pkgs.curl
122
122
+
pkgs.gnused
123
123
+
]
124
124
+
}:$PATH
125
125
+
(. ${pkgs.writeScript "paste-form" ''
126
126
+
case "$Method" in
127
127
+
'POST')
128
128
+
ref=$(head -c $req_content_length | sed '0,/^\r$/d;$d' | curl -fSs --data-binary @- https://p.krebsco.de | sed '1d;s/^http:/https:/')
118
129
119
119
-
printf 'HTTP/1.1 200 OK\r\n'
120
120
-
printf 'Content-Type: text/plain; charset=UTF-8\r\n'
121
121
-
printf 'Server: %s\r\n' "$Server"
122
122
-
printf 'Connection: close\r\n'
123
123
-
printf 'Content-Length: %d\r\n' $(expr ''${#ref} + 1)
124
124
-
printf '\r\n'
125
125
-
printf '%s\n' "$ref"
130
130
+
printf 'HTTP/1.1 200 OK\r\n'
131
131
+
printf 'Content-Type: text/plain; charset=UTF-8\r\n'
132
132
+
printf 'Server: %s\r\n' "$Server"
133
133
+
printf 'Connection: close\r\n'
134
134
+
printf 'Content-Length: %d\r\n' $(expr ''${#ref} + 1)
135
135
+
printf '\r\n'
136
136
+
printf '%s\n' "$ref"
126
137
127
127
-
exit
128
128
-
;;
129
129
-
esac
130
130
-
''})
131
131
-
'';
138
138
+
exit
139
139
+
;;
140
140
+
esac
141
141
+
''})
142
142
+
'';
132
143
};
133
144
krebs.htgen.imgur = {
134
145
port = 7771;
135
135
-
script = /* sh */ ''
136
136
-
(. ${pkgs.htgen-imgur}/bin/htgen-imgur)
137
137
-
'';
146
146
+
script = # sh
147
147
+
''
148
148
+
(. ${pkgs.htgen-imgur}/bin/htgen-imgur)
149
149
+
'';
138
150
};
139
151
krebs.htgen.cyberlocker = {
140
152
port = 7772;
141
141
-
script = /* sh */ ''
142
142
-
(. ${pkgs.htgen-cyberlocker}/bin/htgen-cyberlocker)
143
143
-
'';
153
153
+
script = # sh
154
154
+
''
155
155
+
(. ${pkgs.htgen-cyberlocker}/bin/htgen-cyberlocker)
156
156
+
'';
144
157
};
145
158
krebs.iptables.tables.filter.INPUT.rules = [
146
146
-
{ predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT";}
159
159
+
{
160
160
+
predicate = "-i retiolum -p tcp --dport 80";
161
161
+
target = "ACCEPT";
162
162
+
}
147
163
];
148
164
}
···
5
5
${pkgs.systemd}/bin/systemctl suspend
6
6
'';
7
7
8
8
-
speak = text:
8
8
+
speak =
9
9
+
text:
9
10
pkgs.writers.writeDash "speak" ''
10
11
${pkgs.espeak}/bin/espeak -v +whisper -s 110 "${text}"
11
12
'';
12
13
13
13
-
in {
14
14
+
in
15
15
+
{
14
16
krebs.power-action = {
15
17
enable = true;
16
18
plans.low-battery = {
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
3
3
{
4
4
krebs.iptables.tables.filter.INPUT.rules = [
5
5
-
{ predicate = "-p tcp --dport 139"; target = "ACCEPT"; }
6
6
-
{ predicate = "-p tcp --dport 445"; target = "ACCEPT"; }
7
7
-
{ predicate = "-p udp --dport 137"; target = "ACCEPT"; }
8
8
-
{ predicate = "-p udp --dport 138"; target = "ACCEPT"; }
5
5
+
{
6
6
+
predicate = "-p tcp --dport 139";
7
7
+
target = "ACCEPT";
8
8
+
}
9
9
+
{
10
10
+
predicate = "-p tcp --dport 445";
11
11
+
target = "ACCEPT";
12
12
+
}
13
13
+
{
14
14
+
predicate = "-p udp --dport 137";
15
15
+
target = "ACCEPT";
16
16
+
}
17
17
+
{
18
18
+
predicate = "-p udp --dport 138";
19
19
+
target = "ACCEPT";
20
20
+
}
9
21
];
10
22
users.users.smbguest = {
11
23
name = "smbguest";
···
15
27
createHome = true;
16
28
group = "share";
17
29
};
18
18
-
users.groups.share = {};
30
30
+
users.groups.share = { };
19
31
20
32
services.samba = {
21
33
enable = true;
···
2
2
3
3
let
4
4
r_ip = config.krebs.build.host.nets.retiolum.ip4.addr;
5
5
-
in {
5
5
+
in
6
6
+
{
6
7
imports = [
7
8
./privoxy.nix
8
9
];
···
12
13
krebs.iptables = {
13
14
tables = {
14
15
filter.INPUT.rules = [
15
15
-
{ predicate = "-i retiolum -p tcp --dport 8118"; target = "ACCEPT"; }
16
16
-
{ predicate = "-i dns0 -p tcp --dport 8118"; target = "ACCEPT"; }
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
+
}
17
24
];
18
25
};
19
26
};
···
1
1
-
{ config, ... }:
1
1
+
{ ... }:
2
2
3
3
{
4
4
services.privoxy = {
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
3
3
## TODO sort and split up
4
4
{
···
13
13
'';
14
14
};
15
15
krebs.iptables.tables.filter.INPUT.rules = [
16
16
-
{ predicate = "-i retiolum -p tcp --dport 5555"; target = "ACCEPT"; }
17
17
-
{ predicate = "-i wiregrill -p tcp --dport 5555"; target = "ACCEPT"; }
16
16
+
{
17
17
+
predicate = "-i retiolum -p tcp --dport 5555";
18
18
+
target = "ACCEPT";
19
19
+
}
20
20
+
{
21
21
+
predicate = "-i wiregrill -p tcp --dport 5555";
22
22
+
target = "ACCEPT";
23
23
+
}
18
24
];
19
25
#services.nginx.virtualHosts."lassul.us".locations."/radicale/".extraConfig = ''
20
26
# proxy_pass http://localhost:5555/; # The / is important!
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
3
3
let
4
4
hooks = pkgs.reaktor2-plugins.hooks;
5
5
-
in {
5
5
+
in
6
6
+
{
6
7
krebs.reaktor2.coders = {
7
8
hostname = "irc.hackint.org";
8
9
port = "9999";
···
30
31
activate = "match";
31
32
pattern = ''^!([^ ]+)(?:\s*(.*))?'';
32
33
command = 1;
33
33
-
arguments = [2];
34
34
+
arguments = [ 2 ];
34
35
commands = {
35
36
ping.filename = pkgs.writeDash "ping" ''
36
37
exec /run/wrappers/bin/ping -q -c1 "$1" 2>&1 | tail -1
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
self.inputs.stockholm.nixosModules.realwallpaper
···
41
46
krebs.iptables = {
42
47
tables = {
43
48
filter.INPUT.rules = [
44
44
-
{ predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; }
49
49
+
{
50
50
+
predicate = "-i retiolum -p tcp --dport 80";
51
51
+
target = "ACCEPT";
52
52
+
}
45
53
];
46
54
};
47
55
};
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
systemd.services.rebuild-on-boot = {
4
4
wantedBy = [ "multi-user.target" ];
···
1
1
-
{ config, lib, pkgs, ... }:
2
2
-
let
3
3
-
ctr.name = "red";
4
4
-
in
1
1
+
{ config, ... }:
5
2
{
6
3
7
4
krebs.sync-containers3.containers.red = {
···
160
157
# };
161
158
162
159
}
163
163
-
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
3
3
{
4
4
···
2
2
3
3
let
4
4
mainUser = config.users.extraUsers.mainUser;
5
5
-
in {
5
5
+
in
6
6
+
{
6
7
7
8
users.users.review = {
8
9
isNormalUser = true;
···
1
1
-
{ self, config, lib, pkgs, ... }: let
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
8
8
+
let
2
9
domains = [
3
10
"hackerfleet.eu"
4
11
"hackerfleet.de"
5
12
];
6
6
-
in {
13
13
+
in
14
14
+
{
7
15
imports = [
8
16
self.inputs.stockholm.nixosModules.exim-smarthost
9
17
];
···
60
68
boot.kernel.sysctl."net.ipv4.ip_forward" = lib.mkDefault 1;
61
69
62
70
krebs.iptables.tables.nat.POSTROUTING.rules = [
63
63
-
{ v6 = false; predicate = "-s ${config.containers.riot.localAddress}"; target = "MASQUERADE"; }
71
71
+
{
72
72
+
v6 = false;
73
73
+
predicate = "-s ${config.containers.riot.localAddress}";
74
74
+
target = "MASQUERADE";
75
75
+
}
64
76
];
65
77
66
78
# networking.nat can be used instead of this
67
79
krebs.iptables.tables.nat.PREROUTING.rules = [
68
68
-
{ predicate = "-p tcp --dport 45622"; target = "DNAT --to-destination ${config.containers.riot.localAddress}:22"; v6 = false; }
80
80
+
{
81
81
+
predicate = "-p tcp --dport 45622";
82
82
+
target = "DNAT --to-destination ${config.containers.riot.localAddress}:22";
83
83
+
v6 = false;
84
84
+
}
69
85
];
70
86
krebs.iptables.tables.filter.FORWARD.rules = [
71
71
-
{ predicate = "-i ve-riot"; target = "ACCEPT"; }
72
72
-
{ predicate = "-o ve-riot"; target = "ACCEPT"; }
87
87
+
{
88
88
+
predicate = "-i ve-riot";
89
89
+
target = "ACCEPT";
90
90
+
}
91
91
+
{
92
92
+
predicate = "-o ve-riot";
93
93
+
target = "ACCEPT";
94
94
+
}
73
95
];
74
74
-
75
96
76
97
# non container stuff
77
98
···
1
1
{ pkgs, ... }:
2
2
let
3
3
port = 8889;
4
4
-
in {
4
4
+
in
5
5
+
{
5
6
services.nginx.virtualHosts.search = {
6
7
serverAliases = [ "search.r" ];
7
8
locations."/".extraConfig = ''
···
12
13
13
14
services.searx = {
14
15
enable = true;
15
15
-
configFile = pkgs.writeText "searx.cfg" (builtins.toJSON {
16
16
-
use_default_settings = true;
17
17
-
server = {
18
18
-
port = port;
19
19
-
};
20
20
-
});
16
16
+
configFile = pkgs.writeText "searx.cfg" (
17
17
+
builtins.toJSON {
18
18
+
use_default_settings = true;
19
19
+
server = {
20
20
+
port = port;
21
21
+
};
22
22
+
}
23
23
+
);
21
24
};
22
25
}
···
1
1
{
2
2
-
imports = [
3
3
-
{ # CVE-2024-3094
2
2
+
imports = [
3
3
+
{
4
4
+
# CVE-2024-3094
4
5
# https://www.openwall.com/lists/oss-security/2024/03/29/4
5
6
# https://github.com/NixOS/nixpkgs/pull/300028
6
7
# NixOS is not affected
7
8
}
8
8
-
{ # CVE-2024-6387
9
9
+
{
10
10
+
# CVE-2024-6387
9
11
# https://github.com/NixOS/nixpkgs/pull/323753#issuecomment-2199762128
10
12
services.openssh.settings.LoginGraceTime = 0;
11
13
}
···
1
1
-
{ config, pkgs, ... }: {
1
1
+
{ config, pkgs, ... }:
2
2
+
{
2
3
services.shadowsocks = {
3
4
enable = true;
4
5
passwordFile = config.clanCore.facts.services.shadowsocks.secret.shadowsocks_password.path;
···
6
7
networking.firewall.allowedTCPPorts = [ 8388 ];
7
8
clanCore.facts.services.shadowsocks = {
8
9
secret."shadowsocks_password" = { };
9
9
-
generator = {
10
10
+
generator = {
10
11
prompt = "please enter your shadowsocks password";
11
12
path = with pkgs; [
12
13
coreutils
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
3
3
{
4
4
services.smartd = {
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
systemd.services.snapclient = {
4
4
wantedBy = [ "multi-user.target" ];
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
services.snapserver = {
4
4
enable = true;
···
25
25
http.enable = true;
26
26
};
27
27
28
28
-
networking.firewall.interfaces.int0.allowedTCPPorts = [ 1704 1705 1780 ];
28
28
+
networking.firewall.interfaces.int0.allowedTCPPorts = [
29
29
+
1704
30
30
+
1705
31
31
+
1780
32
32
+
];
29
33
networking.firewall.interfaces.retiolum.allowedTCPPorts = [ 1780 ];
30
34
}
···
1
1
-
{ self, config, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
self.inputs.spora.nixosModules.spora
···
18
23
secret."mycelium_key" = { };
19
24
public."mycelium_ip" = { };
20
25
public."mycelium_pubkey" = { };
21
21
-
generator = {
26
26
+
generator = {
22
27
path = [
23
23
-
pkgs.mycelium
28
28
+
pkgs.mycelium
24
29
pkgs.coreutils
25
30
pkgs.jq
26
31
];
···
3
3
enable = true;
4
4
tables = {
5
5
nat.PREROUTING.rules = [
6
6
-
{ predicate = "-i retiolum -p tcp -m tcp --dport 22"; target = "ACCEPT"; }
7
7
-
{ predicate = "-i wiregrill -p tcp -m tcp --dport 22"; target = "ACCEPT"; }
8
8
-
{ predicate = "-p tcp -m tcp --dport 22"; target = "REDIRECT --to-ports 0"; }
9
9
-
{ predicate = "-p tcp -m tcp --dport 45621"; target = "REDIRECT --to-ports 22"; }
6
6
+
{
7
7
+
predicate = "-i retiolum -p tcp -m tcp --dport 22";
8
8
+
target = "ACCEPT";
9
9
+
}
10
10
+
{
11
11
+
predicate = "-i wiregrill -p tcp -m tcp --dport 22";
12
12
+
target = "ACCEPT";
13
13
+
}
14
14
+
{
15
15
+
predicate = "-p tcp -m tcp --dport 22";
16
16
+
target = "REDIRECT --to-ports 0";
17
17
+
}
18
18
+
{
19
19
+
predicate = "-p tcp -m tcp --dport 45621";
20
20
+
target = "REDIRECT --to-ports 22";
21
21
+
}
10
22
];
11
23
nat.OUTPUT.rules = [
12
12
-
{ predicate = "-o lo -p tcp -m tcp --dport 45621"; target = "REDIRECT --to-ports 22"; }
24
24
+
{
25
25
+
predicate = "-o lo -p tcp -m tcp --dport 45621";
26
26
+
target = "REDIRECT --to-ports 22";
27
27
+
}
13
28
];
14
29
};
15
30
};
···
1
1
-
{ config, pkgs, ... }: let
1
1
+
{ config, pkgs, ... }:
2
2
+
let
2
3
mainUser = config.users.extraUsers.mainUser;
3
3
-
in {
4
4
-
users.users= {
4
4
+
in
5
5
+
{
6
6
+
users.users = {
5
7
starcraft = {
6
8
isNormalUser = true;
7
9
extraGroups = [
···
19
21
${mainUser.name} ALL=(starcraft) NOPASSWD: ALL
20
22
'';
21
23
}
22
22
-
···
6
6
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
7
7
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
8
8
package = pkgs.steam.override {
9
9
-
extraPkgs = (pkgs: with pkgs; [
10
10
-
gamemode
11
11
-
xorg.libXcursor xorg.libXi xorg.libXinerama xorg.libXScrnSaver
12
12
-
libpng libpulseaudio libvorbis stdenv.cc.cc.lib
13
13
-
libkrb5 keyutils
14
14
-
# additional packages...
15
15
-
# e.g. some games require python3
16
16
-
]);
17
17
-
# extraLibraries = pkgs: [ pkgs.gperftools ];
9
9
+
extraPkgs = (
10
10
+
pkgs: with pkgs; [
11
11
+
gamemode
12
12
+
xorg.libXcursor
13
13
+
xorg.libXi
14
14
+
xorg.libXinerama
15
15
+
xorg.libXScrnSaver
16
16
+
libpng
17
17
+
libpulseaudio
18
18
+
libvorbis
19
19
+
stdenv.cc.cc.lib
20
20
+
libkrb5
21
21
+
keyutils
22
22
+
# additional packages...
23
23
+
# e.g. some games require python3
24
24
+
]
25
25
+
);
26
26
+
# extraLibraries = pkgs: [ pkgs.gperftools ];
18
27
# - Automatically enable gamemode whenever Steam is running
19
28
# -- NOTE: Assumes that a working system install of gamemode already exists!
20
20
-
extraProfile = let gmLib = "${lib.getLib(pkgs.gamemode)}/lib"; in ''
21
21
-
export LD_LIBRARY_PATH="${gmLib}:$LD_LIBRARY_PATH"
22
22
-
'';
29
29
+
extraProfile =
30
30
+
let
31
31
+
gmLib = "${lib.getLib (pkgs.gamemode)}/lib";
32
32
+
in
33
33
+
''
34
34
+
export LD_LIBRARY_PATH="${gmLib}:$LD_LIBRARY_PATH"
35
35
+
'';
23
36
};
24
37
};
25
38
···
1
1
-
{ pkgs, ... }: {
1
1
+
{ pkgs, ... }:
2
2
+
{
2
3
networking.firewall.allowedTCPPorts = [
3
4
47984
4
5
47989
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
let
3
8
4
9
shares = {
5
5
-
"/home/lass/sync" = [ "mors" "green" "coaxmetal" "ignavia" ]; # TODO add aergia
6
6
-
"/home/lass/tmp/the_playlist" = [ "mors" "prism" "radio" ];
10
10
+
"/home/lass/sync" = [
11
11
+
"mors"
12
12
+
"green"
13
13
+
"coaxmetal"
14
14
+
"ignavia"
15
15
+
]; # TODO add aergia
16
16
+
"/home/lass/tmp/the_playlist" = [
17
17
+
"mors"
18
18
+
"prism"
19
19
+
"radio"
20
20
+
];
7
21
# "/home/lass/.weechat" = [ "green" "mors" ];
8
8
-
"/home/lass/decsync" = [ "mors" "green" "massulus" "massulus2" ];
22
22
+
"/home/lass/decsync" = [
23
23
+
"mors"
24
24
+
"green"
25
25
+
"massulus"
26
26
+
"massulus2"
27
27
+
];
9
28
};
10
29
11
11
-
machine_peers = lib.foldr (host: acc:
30
30
+
machine_peers = lib.foldr (
31
31
+
host: acc:
12
32
if builtins.pathExists ../machines/${host}/facts/syncthing.pub then
13
13
-
acc // { ${host}.id = lib.removeSuffix "\n" (builtins.readFile ../machines/${host}/facts/syncthing.pub); }
33
33
+
acc
34
34
+
// {
35
35
+
${host}.id = lib.removeSuffix "\n" (builtins.readFile ../machines/${host}/facts/syncthing.pub);
36
36
+
}
14
37
else
15
15
-
acc
16
16
-
) {} (lib.attrNames (builtins.readDir ../machines));
38
38
+
acc
39
39
+
) { } (lib.attrNames (builtins.readDir ../machines));
17
40
18
41
all_peers = machine_peers // {
19
42
"massulus".id = "R2EGJ5S-PQMETUP-C2UGXQG-A6VP7TB-NGSN3MV-C7OGSWT-SZ34L3X-H6IF6AQ";
20
43
"massulus2".id = "OTJBJNO-VHBCVDL-QSELUS7-S6JDMYR-7WLE36A-6XSRSLP-VKYOYJJ-AHFGZAG";
21
44
};
22
45
23
23
-
used_peer_names = lib.unique (lib.filter lib.isString (lib.flatten (lib.mapAttrsToList (n: v: v.devices) config.services.syncthing.settings.folders)));
24
24
-
used_peers = lib.filterAttrs (n: v: lib.elem n used_peer_names) all_peers;
25
25
-
in {
46
46
+
used_peer_names = lib.unique (
47
47
+
lib.filter lib.isString (
48
48
+
lib.flatten (lib.mapAttrsToList (_n: v: v.devices) config.services.syncthing.settings.folders)
49
49
+
)
50
50
+
);
51
51
+
used_peers = lib.filterAttrs (n: _v: lib.elem n used_peer_names) all_peers;
52
52
+
in
53
53
+
{
26
54
services.syncthing = {
27
55
enable = true;
28
56
group = "syncthing";
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
services.terraria = {
4
4
enable = true;
5
5
openFirewall = true;
6
6
};
7
7
8
8
-
users.groups.terraria = {};
8
8
+
users.groups.terraria = { };
9
9
users.users.terraria.group = "terraria";
10
10
11
11
# mobile
···
18
18
# });
19
19
# };
20
20
}
21
21
-
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
imports = [
4
4
<stockholm/lass/2configs/container-networking.nix>
···
2
2
3
3
{
4
4
environment.systemPackages = with pkgs; [
5
5
-
(texLiveAggregationFun { paths = [
6
6
-
texLive
7
7
-
texLiveExtra
8
8
-
texLiveCMSuper
9
9
-
texLiveModerncv
10
10
-
];})
5
5
+
(texLiveAggregationFun {
6
6
+
paths = [
7
7
+
texLive
8
8
+
texLiveExtra
9
9
+
texLiveCMSuper
10
10
+
texLiveModerncv
11
11
+
];
12
12
+
})
11
13
];
12
14
}
···
1
1
-
{ config, lib, pkgs, ... }: let
1
1
+
{ pkgs, ... }:
2
2
+
let
2
3
3
3
-
switch-theme = pkgs.writers.writeDashBin "switch-theme" ''
4
4
-
set -efux
5
5
-
if [ "$1" = toggle ]; then
6
6
-
if [ "$(${pkgs.coreutils}/bin/cat /var/theme/current_theme)" = dark ]; then
7
7
-
${placeholder "out"}/bin/switch-theme light
8
8
-
else
9
9
-
${placeholder "out"}/bin/switch-theme dark
10
10
-
fi
11
11
-
elif test -e "/etc/themes/$1"; then
12
12
-
${pkgs.coreutils}/bin/mkdir -p /var/theme/config
13
13
-
${pkgs.rsync}/bin/rsync --chown=lass:users -a --delete "/etc/themes/$1/" /var/theme/config/
14
14
-
echo "$1" > /var/theme/current_theme
15
15
-
${pkgs.coreutils}/bin/chown lass:users /var/theme/current_theme
16
16
-
${pkgs.xorg.xrdb}/bin/xrdb -merge /var/theme/config/xresources || : # wayland has no xresources
17
17
-
${pkgs.procps}/bin/pkill -HUP xsettingsd || :
18
18
-
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "$(cat /var/theme/config/gtk-theme)" || :
4
4
+
switch-theme = pkgs.writers.writeDashBin "switch-theme" ''
5
5
+
set -efux
6
6
+
if [ "$1" = toggle ]; then
7
7
+
if [ "$(${pkgs.coreutils}/bin/cat /var/theme/current_theme)" = dark ]; then
8
8
+
${placeholder "out"}/bin/switch-theme light
19
9
else
20
20
-
echo "theme $1 not found"
10
10
+
${placeholder "out"}/bin/switch-theme dark
21
11
fi
22
22
-
'';
12
12
+
elif test -e "/etc/themes/$1"; then
13
13
+
${pkgs.coreutils}/bin/mkdir -p /var/theme/config
14
14
+
${pkgs.rsync}/bin/rsync --chown=lass:users -a --delete "/etc/themes/$1/" /var/theme/config/
15
15
+
echo "$1" > /var/theme/current_theme
16
16
+
${pkgs.coreutils}/bin/chown lass:users /var/theme/current_theme
17
17
+
${pkgs.xorg.xrdb}/bin/xrdb -merge /var/theme/config/xresources || : # wayland has no xresources
18
18
+
${pkgs.procps}/bin/pkill -HUP xsettingsd || :
19
19
+
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "$(cat /var/theme/config/gtk-theme)" || :
20
20
+
else
21
21
+
echo "theme $1 not found"
22
22
+
fi
23
23
+
'';
23
24
24
24
-
in {
25
25
+
in
26
26
+
{
25
27
systemd.tmpfiles.rules = [
26
28
"d /var/theme/ 755 lass users"
27
29
];
···
1
1
-
{config, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
## unlock command:
3
3
# (pass admin/$host/root;echo) | torify ssh root@$(pass hosts/$host/initrd/hostname) 'cat > /crypt-ramfs/passphrase'
4
4
{
···
24
24
'';
25
25
26
26
# start tor during boot process
27
27
-
boot.initrd.network.postCommands = let
28
28
-
torRc = (pkgs.writeText "tor.rc" ''
29
29
-
DataDirectory /etc/tor
30
30
-
SOCKSPort 127.0.0.1:9050 IsolateDestAddr
31
31
-
SOCKSPort 127.0.0.1:9063
32
32
-
HiddenServiceDir /etc/tor/onion/bootup
33
33
-
HiddenServicePort 22 127.0.0.1:22
34
34
-
'');
35
35
-
in ''
36
36
-
echo "tor: preparing onion folder"
37
37
-
# have to do this otherwise tor does not want to start
38
38
-
chmod -R 700 /etc/tor
27
27
+
boot.initrd.network.postCommands =
28
28
+
let
29
29
+
torRc = (
30
30
+
pkgs.writeText "tor.rc" ''
31
31
+
DataDirectory /etc/tor
32
32
+
SOCKSPort 127.0.0.1:9050 IsolateDestAddr
33
33
+
SOCKSPort 127.0.0.1:9063
34
34
+
HiddenServiceDir /etc/tor/onion/bootup
35
35
+
HiddenServicePort 22 127.0.0.1:22
36
36
+
''
37
37
+
);
38
38
+
in
39
39
+
''
40
40
+
echo "tor: preparing onion folder"
41
41
+
# have to do this otherwise tor does not want to start
42
42
+
chmod -R 700 /etc/tor
39
43
40
40
-
echo "make sure localhost is up"
41
41
-
ip a a 127.0.0.1/8 dev lo
42
42
-
ip link set lo up
44
44
+
echo "make sure localhost is up"
45
45
+
ip a a 127.0.0.1/8 dev lo
46
46
+
ip link set lo up
43
47
44
44
-
echo "tor: starting tor"
45
45
-
tor -f ${torRc} --verify-config
46
46
-
tor -f ${torRc} &
47
47
-
'';
48
48
+
echo "tor: starting tor"
49
49
+
tor -f ${torRc} --verify-config
50
50
+
tor -f ${torRc} &
51
51
+
'';
48
52
}
49
49
-
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
services.tor = {
4
4
enable = true;
5
5
relay.onionServices.ssh = {
6
6
version = 3;
7
7
-
map = [{
8
8
-
port = 22;
9
9
-
target.port = 22;
10
10
-
}];
7
7
+
map = [
8
8
+
{
9
9
+
port = 22;
10
10
+
target.port = 22;
11
11
+
}
12
12
+
];
11
13
secretKey = "${config.krebs.secret.directory}/ssh-tor.priv";
12
14
};
13
15
controlSocket.enable = true;
···
28
30
'';
29
31
};
30
32
}
31
31
-
···
1
1
-
{ config, pkgs, ... }: let
1
1
+
{ config, pkgs, ... }:
2
2
+
let
2
3
3
3
-
nginxCfg = pkgs.writeText "nginx.conf" ''
4
4
-
daemon off;
5
5
-
pid /var/lib/rtmp/nginx.pid;
6
6
-
events {
7
7
-
use epoll;
8
8
-
worker_connections 128;
9
9
-
}
10
10
-
error_log stderr info;
4
4
+
nginxCfg = pkgs.writeText "nginx.conf" ''
5
5
+
daemon off;
6
6
+
pid /var/lib/rtmp/nginx.pid;
7
7
+
events {
8
8
+
use epoll;
9
9
+
worker_connections 128;
10
10
+
}
11
11
+
error_log stderr info;
11
12
12
12
-
http {
13
13
-
client_body_temp_path /var/lib/rtmp/nginx_cache_client_body;
14
14
-
proxy_temp_path /var/lib/rtmp/nginx_cache_proxy;
15
15
-
fastcgi_temp_path /var/lib/rtmp/nginx_cache_fastcgi;
16
16
-
uwsgi_temp_path /var/lib/rtmp/nginx_cache_uwsgi;
17
17
-
scgi_temp_path /var/lib/rtmp/nginx_cache_scgi;
13
13
+
http {
14
14
+
client_body_temp_path /var/lib/rtmp/nginx_cache_client_body;
15
15
+
proxy_temp_path /var/lib/rtmp/nginx_cache_proxy;
16
16
+
fastcgi_temp_path /var/lib/rtmp/nginx_cache_fastcgi;
17
17
+
uwsgi_temp_path /var/lib/rtmp/nginx_cache_uwsgi;
18
18
+
scgi_temp_path /var/lib/rtmp/nginx_cache_scgi;
18
19
19
19
-
server {
20
20
-
listen 8080;
21
21
-
root /var/lib/rtmp;
22
22
-
access_log stderr;
23
23
-
error_log stderr;
20
20
+
server {
21
21
+
listen 8080;
22
22
+
root /var/lib/rtmp;
23
23
+
access_log stderr;
24
24
+
error_log stderr;
24
25
25
25
-
# This URL provides RTMP statistics in XML
26
26
-
location /stat {
27
27
-
rtmp_stat all;
26
26
+
# This URL provides RTMP statistics in XML
27
27
+
location /stat {
28
28
+
rtmp_stat all;
29
29
+
}
28
30
}
29
31
}
30
30
-
}
31
32
32
32
-
rtmp {
33
33
-
server {
34
34
-
access_log stderr;
35
35
-
listen 1935;
36
36
-
ping 30s;
37
37
-
notify_method get;
33
33
+
rtmp {
34
34
+
server {
35
35
+
access_log stderr;
36
36
+
listen 1935;
37
37
+
ping 30s;
38
38
+
notify_method get;
38
39
39
39
-
application stream {
40
40
-
live on;
40
40
+
application stream {
41
41
+
live on;
41
42
42
42
-
hls on;
43
43
-
hls_path /var/lib/rtmp/tmp/hls;
44
44
-
hls_fragment 1;
45
45
-
hls_playlist_length 10;
43
43
+
hls on;
44
44
+
hls_path /var/lib/rtmp/tmp/hls;
45
45
+
hls_fragment 1;
46
46
+
hls_playlist_length 10;
46
47
47
47
-
dash on;
48
48
-
dash_path /var/lib/rtmp/tmp/dash;
48
48
+
dash on;
49
49
+
dash_path /var/lib/rtmp/tmp/dash;
50
50
+
}
49
51
}
50
52
}
51
51
-
}
52
52
-
'';
53
53
+
'';
53
54
54
54
-
in {
55
55
+
in
56
56
+
{
55
57
56
58
services.nginx = {
57
59
enable = true;
···
109
111
'';
110
112
locations."= /dash.all.min.js".extraConfig = ''
111
113
default_type "text/javascript";
112
112
-
alias ${pkgs.fetchurl {
113
113
-
url = "http://cdn.dashjs.org/v3.2.0/dash.all.min.js";
114
114
-
sha256 = "16f0b40gdqsnwqi01s5sz9f1q86dwzscgc3m701jd1sczygi481c";
115
115
-
}};
114
114
+
alias ${
115
115
+
pkgs.fetchurl {
116
116
+
url = "http://cdn.dashjs.org/v3.2.0/dash.all.min.js";
117
117
+
sha256 = "16f0b40gdqsnwqi01s5sz9f1q86dwzscgc3m701jd1sczygi481c";
118
118
+
}
119
119
+
};
116
120
'';
117
121
locations."= /player".extraConfig = ''
118
122
default_type "text/html";
···
150
154
fileSystems."/var/lib/rtmp/tmp" = {
151
155
device = "tmpfs";
152
156
fsType = "tmpfs";
153
153
-
options = [ "nosuid" "nodev" "noatime" ];
157
157
+
options = [
158
158
+
"nosuid"
159
159
+
"nodev"
160
160
+
"noatime"
161
161
+
];
154
162
};
155
163
156
164
users.users.rtmp = {
···
169
177
after = [ "network.target" ];
170
178
restartIfChanged = true;
171
179
script = ''
172
172
-
${pkgs.nginx.override {
173
173
-
modules = [
174
174
-
pkgs.nginxModules.rtmp
175
175
-
];
176
176
-
}}/bin/nginx -c ${nginxCfg} -p /var/lib/rtmp
180
180
+
${
181
181
+
pkgs.nginx.override {
182
182
+
modules = [
183
183
+
pkgs.nginxModules.rtmp
184
184
+
];
185
185
+
}
186
186
+
}/bin/nginx -c ${nginxCfg} -p /var/lib/rtmp
177
187
'';
178
188
serviceConfig = {
179
189
ExecStartPre = pkgs.writers.writeDash "setup-rtmp" ''
···
189
199
};
190
200
191
201
krebs.iptables.tables.filter.INPUT.rules = [
192
192
-
{ predicate = "-p tcp --dport 1935"; target = "ACCEPT"; }
202
202
+
{
203
203
+
predicate = "-p tcp --dport 1935";
204
204
+
target = "ACCEPT";
205
205
+
}
193
206
];
194
207
}
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
3
3
{
4
4
services.urxvtd.enable = true;
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
3
3
let
4
4
mainUser = config.users.extraUsers.mainUser;
5
5
6
6
-
in {
6
6
+
in
7
7
+
{
7
8
#services.virtualboxHost.enable = true;
8
9
virtualisation.virtualbox.host.enable = true;
9
10
virtualisation.virtualbox.host.enableHardening = false;
···
14
15
description = "user for running VirtualBox";
15
16
home = "/home/virtual";
16
17
useDefaultShell = true;
17
17
-
extraGroups = [ "vboxusers" "audio" "video" ];
18
18
+
extraGroups = [
19
19
+
"vboxusers"
20
20
+
"audio"
21
21
+
"video"
22
22
+
];
18
23
createHome = true;
19
24
};
20
25
};
···
1
1
-
{ config, lib, pkgs, ... }: let
1
1
+
{ config, pkgs, ... }:
2
2
+
let
2
3
3
4
weechat-configured = pkgs.weechat-declarative.override {
4
5
config = {
···
7
8
pkgs.weechatScripts.wee-slack
8
9
];
9
10
settings = {
10
10
-
irc.server_default.nicks = [ "lassulus" "hackulus" ];
11
11
+
irc.server_default.nicks = [
12
12
+
"lassulus"
13
13
+
"hackulus"
14
14
+
];
11
15
irc.server.bitlbee = {
12
16
addresses = "localhost/6666";
13
17
command = "msg &bitlbee identify \${sec.data.bitlbee}";
···
128
132
matrix.look.server_buffer = "independent";
129
133
weechat.bar.buflist.size_max = 20;
130
134
weechat.color.chat_nick_colors = [
131
131
-
1 2 3 4 5 6 9
132
132
-
10 11 12 13 14
133
133
-
28 29
134
134
-
30 31 32 33 34 35 36 37 38 39
135
135
+
1
136
136
+
2
137
137
+
3
138
138
+
4
139
139
+
5
140
140
+
6
141
141
+
9
142
142
+
10
143
143
+
11
144
144
+
12
145
145
+
13
146
146
+
14
147
147
+
28
148
148
+
29
149
149
+
30
150
150
+
31
151
151
+
32
152
152
+
33
153
153
+
34
154
154
+
35
155
155
+
36
156
156
+
37
157
157
+
38
158
158
+
39
135
159
70
136
160
94
137
137
-
101 102 103 104 105 106 107
138
138
-
130 131 133 134 135 136 137
139
139
-
140 141 142 143
140
140
-
160 161 162 163 165 166 167 168 169
141
141
-
170 171 172 173 174 175
142
142
-
196 197 198 199
143
143
-
200 201 202 203 204 205 206 208 209 209
144
144
-
210 211 212
161
161
+
101
162
162
+
102
163
163
+
103
164
164
+
104
165
165
+
105
166
166
+
106
167
167
+
107
168
168
+
130
169
169
+
131
170
170
+
133
171
171
+
134
172
172
+
135
173
173
+
136
174
174
+
137
175
175
+
140
176
176
+
141
177
177
+
142
178
178
+
143
179
179
+
160
180
180
+
161
181
181
+
162
182
182
+
163
183
183
+
165
184
184
+
166
185
185
+
167
186
186
+
168
187
187
+
169
188
188
+
170
189
189
+
171
190
190
+
172
191
191
+
173
192
192
+
174
193
193
+
175
194
194
+
196
195
195
+
197
196
196
+
198
197
197
+
199
198
198
+
200
199
199
+
201
200
200
+
202
201
201
+
203
202
202
+
204
203
203
+
205
204
204
+
206
205
205
+
208
206
206
+
209
207
207
+
209
208
208
+
210
209
209
+
211
210
210
+
212
145
211
];
146
212
};
147
213
extraCommands = ''
···
166
232
/matrix connect nixos_dev
167
233
/matrix connect lassulus
168
234
'';
169
169
-
files."sec.conf" = toString (pkgs.writeText "sec.conf" ''
170
170
-
[crypt]
171
171
-
cipher = aes256
172
172
-
hash_algo = sha256
173
173
-
passphrase_command = "cat $CREDENTIALS_DIRECTORY/WEECHAT_PASSPHRASE"
174
174
-
salt = on
235
235
+
files."sec.conf" = toString (
236
236
+
pkgs.writeText "sec.conf" ''
237
237
+
[crypt]
238
238
+
cipher = aes256
239
239
+
hash_algo = sha256
240
240
+
passphrase_command = "cat $CREDENTIALS_DIRECTORY/WEECHAT_PASSPHRASE"
241
241
+
salt = on
175
242
176
176
-
[data]
177
177
-
__passphrase__ = on
178
178
-
hackint_sasl = "5CA242E92E7A09B180711B50C4AE2E65C42934EB4E584EC82BC1281D8C72CD411D590C16CC435687C0DA13759873CC"
179
179
-
libera_sasl = "9500B5AC3B29F9CAA273F1B89DC99550E038AF95C4B47442B1FB4CB9F0D6B86B26015988AD39E642CA9C4A78DED7F42D1F409B268C93E778"
180
180
-
r_sasl = "CB6FB1421ED5A9094CD2C05462DB1FA87C4A675628ABD9AEC9928A1A6F3F96C07D9F26472331BAF80B7B73270680EB1BBEFD"
181
181
-
c3-gsm = "C49DD845900CFDFA93EEBCE4F1ABF4A963EF6082B7DA6410FA701CC77A04BB6C201FCB864988C4F2B97ED7D44D5A28F162"
182
182
-
bitlbee = "814ECAC59D9CF6E8340B566563E5D7E92AB92209B49C1EDE4CAAC32DD0DF1EC511D97C75E840C45D69BB9E3D03E79C"
183
183
-
matrix_lassulus = "0CA5C0F70A9F893881370F4A665B4CC40FBB1A41E53BC94916CD92B029103528611EC0B390116BE60FA79AE10F486E96E17B0824BE2DE1C97D87B88F5407330DAD70C044147533C36B09B7030CAD97"
184
184
-
'');
243
243
+
[data]
244
244
+
__passphrase__ = on
245
245
+
hackint_sasl = "5CA242E92E7A09B180711B50C4AE2E65C42934EB4E584EC82BC1281D8C72CD411D590C16CC435687C0DA13759873CC"
246
246
+
libera_sasl = "9500B5AC3B29F9CAA273F1B89DC99550E038AF95C4B47442B1FB4CB9F0D6B86B26015988AD39E642CA9C4A78DED7F42D1F409B268C93E778"
247
247
+
r_sasl = "CB6FB1421ED5A9094CD2C05462DB1FA87C4A675628ABD9AEC9928A1A6F3F96C07D9F26472331BAF80B7B73270680EB1BBEFD"
248
248
+
c3-gsm = "C49DD845900CFDFA93EEBCE4F1ABF4A963EF6082B7DA6410FA701CC77A04BB6C201FCB864988C4F2B97ED7D44D5A28F162"
249
249
+
bitlbee = "814ECAC59D9CF6E8340B566563E5D7E92AB92209B49C1EDE4CAAC32DD0DF1EC511D97C75E840C45D69BB9E3D03E79C"
250
250
+
matrix_lassulus = "0CA5C0F70A9F893881370F4A665B4CC40FBB1A41E53BC94916CD92B029103528611EC0B390116BE60FA79AE10F486E96E17B0824BE2DE1C97D87B88F5407330DAD70C044147533C36B09B7030CAD97"
251
251
+
''
252
252
+
);
185
253
};
186
254
};
187
255
188
188
-
in {
256
256
+
in
257
257
+
{
258
258
+
nixpkgs.config.permittedInsecurePackages = [
259
259
+
"olm-3.2.16"
260
260
+
];
189
261
users.users.mainUser.packages = [
190
262
weechat-configured
191
263
];
···
205
277
User = "lass";
206
278
RemainAfterExit = true;
207
279
Type = "oneshot";
208
208
-
LoadCredential = [
209
209
-
"WEECHAT_PASSPHRASE:${config.krebs.secret.directory}/weechat_passphrase"
210
210
-
];
280
280
+
# LoadCredential = [
281
281
+
# "WEECHAT_PASSPHRASE:${config.krebs.secret.directory}/weechat_passphrase"
282
282
+
# ];
211
283
ExecStart = "${pkgs.tmux}/bin/tmux -2 new-session -d -s IM ${weechat-configured}/bin/weechat";
212
284
ExecStop = "${pkgs.tmux}/bin/tmux kill-session -t IM"; # TODO run save in weechat
213
285
};
···
3
3
let
4
4
mainUser = config.users.extraUsers.mainUser;
5
5
6
6
-
in {
7
7
-
users.users= {
6
6
+
in
7
7
+
{
8
8
+
users.users = {
8
9
wine = {
9
10
home = "/home/wine";
10
11
useDefaultShell = true;
···
1
1
-
{ config, lib, pkgs, ... }: with lib; let
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
7
7
+
with lib;
8
8
+
let
2
9
3
10
self = config.krebs.build.host.nets.wiregrill;
4
11
isRouter = !isNull self.via;
5
12
6
6
-
in mkIf (hasAttr "wiregrill" config.krebs.build.host.nets) {
13
13
+
in
14
14
+
mkIf (hasAttr "wiregrill" config.krebs.build.host.nets) {
7
15
#hack for modprobe inside containers
8
16
systemd.services."wireguard-wiregrill".path = mkIf config.boot.isContainer (mkBefore [
9
17
(pkgs.writeDashBin "modprobe" ":")
···
13
21
"net.ipv6.conf.all.forwarding" = 1;
14
22
};
15
23
krebs.iptables.tables.filter.INPUT.rules = [
16
16
-
{ predicate = "-p udp --dport ${toString self.wireguard.port}"; target = "ACCEPT"; }
24
24
+
{
25
25
+
predicate = "-p udp --dport ${toString self.wireguard.port}";
26
26
+
target = "ACCEPT";
27
27
+
}
17
28
];
18
29
krebs.iptables.tables.filter.FORWARD.rules = mkIf isRouter (mkBefore [
19
19
-
{ predicate = "-i wiregrill -o wiregrill"; target = "ACCEPT"; }
20
20
-
{ predicate = "-i wiregrill -o retiolum"; target = "ACCEPT"; }
21
21
-
{ predicate = "-i retiolum -o wiregrill"; target = "ACCEPT"; }
22
22
-
{ predicate = "-i wiregrill -o eth0"; target = "ACCEPT"; }
23
23
-
{ predicate = "-o wiregrill -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
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
+
}
24
50
]);
25
51
26
52
clanCore.facts.services.wiregrill = {
···
39
65
systemd.network.networks.wiregrill = {
40
66
matchConfig.Name = "wiregrill";
41
67
address =
42
42
-
(optional (!isNull self.ip4) "${self.ip4.addr}/16") ++
43
43
-
(optional (!isNull self.ip6) "${self.ip6.addr}/48")
44
44
-
;
68
68
+
(optional (!isNull self.ip4) "${self.ip4.addr}/16")
69
69
+
++ (optional (!isNull self.ip6) "${self.ip6.addr}/48");
45
70
networkConfig = {
46
71
IgnoreCarrierLoss = "10s";
47
72
};
···
49
74
50
75
networking.wireguard.interfaces.wiregrill = {
51
76
ips =
52
52
-
(optional (!isNull self.ip4 && !config.systemd.network.enable) self.ip4.addr) ++
53
53
-
(optional (!isNull self.ip6 && !config.systemd.network.enable) self.ip6.addr);
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);
54
79
listenPort = 51820;
55
80
privateKeyFile = "${config.krebs.secret.directory}/wiregrill.key";
56
81
allowedIPsAsRoutes = true;
57
57
-
peers = mapAttrsToList
58
58
-
(name: host: {
59
59
-
# inherit name;
60
60
-
allowedIPs = if isRouter then
61
61
-
(optional (!isNull host.nets.wiregrill.ip4) host.nets.wiregrill.ip4.addr) ++
62
62
-
(optional (!isNull host.nets.wiregrill.ip6) host.nets.wiregrill.ip6.addr)
82
82
+
peers = mapAttrsToList (_name: host: {
83
83
+
# inherit name;
84
84
+
allowedIPs =
85
85
+
if isRouter then
86
86
+
(optional (!isNull host.nets.wiregrill.ip4) host.nets.wiregrill.ip4.addr)
87
87
+
++ (optional (!isNull host.nets.wiregrill.ip6) host.nets.wiregrill.ip6.addr)
63
88
else
64
64
-
host.nets.wiregrill.wireguard.subnets
65
65
-
;
66
66
-
endpoint = mkIf (!isNull host.nets.wiregrill.via) (host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}");
67
67
-
persistentKeepalive = mkIf (!isNull host.nets.wiregrill.via) 61;
68
68
-
publicKey = (replaceStrings ["\n"] [""] host.nets.wiregrill.wireguard.pubkey);
69
69
-
})
70
70
-
(filterAttrs (_: h: hasAttr "wiregrill" h.nets) config.krebs.hosts);
89
89
+
host.nets.wiregrill.wireguard.subnets;
90
90
+
endpoint = mkIf (!isNull host.nets.wiregrill.via) (
91
91
+
host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}"
92
92
+
);
93
93
+
persistentKeepalive = mkIf (!isNull host.nets.wiregrill.via) 61;
94
94
+
publicKey = (replaceStrings [ "\n" ] [ "" ] host.nets.wiregrill.wireguard.pubkey);
95
95
+
}) (filterAttrs (_: h: hasAttr "wiregrill" h.nets) config.krebs.hosts);
71
96
};
72
97
}
···
1
1
-
{ pkgs, ... }: let
1
1
+
{ pkgs, ... }:
2
2
+
let
2
3
3
4
xdg-open = pkgs.writeBashBin "xdg-open" ''
4
5
set -xe
···
60
61
exec $runner "$FILE";;
61
62
esac
62
63
'';
63
63
-
in {
64
64
+
in
65
65
+
{
64
66
environment.systemPackages = [ xdg-open ];
65
67
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
environment.systemPackages = [
4
4
pkgs.xonsh
···
1
1
-
{ self, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
let
3
8
# pcsclite workaround until https://github.com/NixOS/nixpkgs/pull/308884 is in unstable
4
9
pcsclite = pkgs.pcsclite.overrideAttrs (old: {
5
5
-
postPatch = old.postPatch + (lib.optionalString (!(lib.strings.hasInfix ''--replace-fail "libpcsclite_real.so.1"'' old.postPatch)) ''
6
6
-
substituteInPlace src/libredirect.c src/spy/libpcscspy.c \
7
7
-
--replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1"
8
8
-
'');
10
10
+
postPatch =
11
11
+
old.postPatch
12
12
+
+ (lib.optionalString
13
13
+
(!(lib.strings.hasInfix ''--replace-fail "libpcsclite_real.so.1"'' old.postPatch))
14
14
+
''
15
15
+
substituteInPlace src/libredirect.c src/spy/libpcscspy.c \
16
16
+
--replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1"
17
17
+
''
18
18
+
);
9
19
});
10
20
in
11
21
{
12
22
environment.systemPackages = with pkgs; [
13
23
yubikey-personalization
14
24
yubikey-manager
15
15
-
pinentry-curses pinentry-qt
25
25
+
pinentry-curses
26
26
+
pinentry-qt
16
27
# fix polkit rules
17
28
# https://github.com/NixOS/nixpkgs/issues/280826
18
29
pcscliteWithPolkit.out
···
40
51
''} $HOME/.gnupg/scdaemon.conf
41
52
'';
42
53
systemd.user.services.gpg-agent.serviceConfig.ExecStartPost = pkgs.writers.writeDash "init_gpg" ''
43
43
-
${pkgs.gnupg}/bin/gpg --import ${self.inputs.stockholm.outPath + "/kartei/lass/pgp/yubikey.pgp"} >/dev/null
54
54
+
${pkgs.gnupg}/bin/gpg --import ${
55
55
+
self.inputs.stockholm.outPath + "/kartei/lass/pgp/yubikey.pgp"
56
56
+
} >/dev/null
44
57
echo -e '5\ny\n' | ${pkgs.gnupg}/bin/gpg --command-fd 0 --expert --edit-key DBCD757846069B392EA9401D6657BE8A8D1EE807 trust >/dev/null || :
45
58
'';
46
59
···
1
1
{ lib, ... }:
2
2
let
3
3
hosts = lib.mapAttrs (machine: _: {
4
4
-
ip = if builtins.pathExists ../machines/${machine}/facts/zerotier-ip then
5
5
-
builtins.readFile ../machines/${machine}/facts/zerotier-ip
6
6
-
else
7
7
-
null;
4
4
+
ip =
5
5
+
if builtins.pathExists ../machines/${machine}/facts/zerotier-ip then
6
6
+
builtins.readFile ../machines/${machine}/facts/zerotier-ip
7
7
+
else
8
8
+
null;
8
9
}) (builtins.readDir ../machines);
9
10
10
10
-
filteredHosts = lib.filterAttrs (name: host: host.ip != null) hosts;
11
11
+
filteredHosts = lib.filterAttrs (_name: host: host.ip != null) hosts;
11
12
in
12
13
{
13
14
services.zerotierone.joinNetworks = [ "7c31a21e86f9a75c" ];
14
15
services.zerotierone.localConf.settings = {
15
15
-
interfacePrefixBlacklist = [ "ygg" "mesh" "retiolum" "wiregrill" ];
16
16
+
interfacePrefixBlacklist = [
17
17
+
"ygg"
18
18
+
"mesh"
19
19
+
"retiolum"
20
20
+
"wiregrill"
21
21
+
];
16
22
physical = {
17
23
"10.243.0.0/16".blacklist = true;
18
24
"10.244.0.0/16".blacklist = true;
···
21
27
};
22
28
};
23
29
24
24
-
networking.extraHosts = lib.concatMapStringsSep "\n" (host:
25
25
-
"${host.value.ip} ${host.name}.z"
26
26
-
) (lib.attrsToList filteredHosts);
30
30
+
networking.extraHosts = lib.concatMapStringsSep "\n" (host: "${host.value.ip} ${host.name}.z") (
31
31
+
lib.attrsToList filteredHosts
32
32
+
);
27
33
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
environment.systemPackages = with pkgs; [
4
4
atuin
5
5
direnv
6
6
fzf
7
7
];
8
8
-
environment.variables.ATUIN_CONFIG_DIR = toString (pkgs.writeTextDir "/config.toml" ''
9
9
-
auto_sync = true
10
10
-
update_check = false
11
11
-
sync_address = "http://green.r:8888"
12
12
-
sync_frequency = 0
13
13
-
style = "compact"
14
14
-
'');
8
8
+
environment.variables.ATUIN_CONFIG_DIR = toString (
9
9
+
pkgs.writeTextDir "/config.toml" ''
10
10
+
auto_sync = true
11
11
+
update_check = false
12
12
+
sync_address = "http://green.r:8888"
13
13
+
sync_frequency = 0
14
14
+
style = "compact"
15
15
+
''
16
16
+
);
15
17
programs.zsh = {
16
18
enable = true;
17
19
shellInit = ''
···
63
65
}
64
66
65
67
#beautiful colors
66
66
-
eval $(dircolors -b ${pkgs.fetchFromGitHub {
67
67
-
owner = "trapd00r";
68
68
-
repo = "LS_COLORS";
69
69
-
rev = "a75fca8545f91abb8a5f802981033ef54bf1eac0";
70
70
-
sha256="1lzj0qnj89mzh76ha137mnz2hf86k278rh0y9x124ghxj9yqsnb4";
71
71
-
}}/LS_COLORS)
68
68
+
eval $(dircolors -b ${
69
69
+
pkgs.fetchFromGitHub {
70
70
+
owner = "trapd00r";
71
71
+
repo = "LS_COLORS";
72
72
+
rev = "a75fca8545f91abb8a5f802981033ef54bf1eac0";
73
73
+
sha256 = "1lzj0qnj89mzh76ha137mnz2hf86k278rh0y9x124ghxj9yqsnb4";
74
74
+
}
75
75
+
}/LS_COLORS)
72
76
zstyle ':completion:*:default' list-colors ''${(s.:.)LS_COLORS}
73
77
74
78
#emacs bindings
···
1
1
-
_:
2
2
-
{
1
1
+
_: {
3
2
imports = [
4
3
./drbd.nix
5
4
./folderPerms.nix
···
1
1
-
{ config, lib, pkgs, self, ... }: let
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
self,
6
6
+
...
7
7
+
}:
8
8
+
let
2
9
cfg = config.lass.drbd;
3
10
slib = self.inputs.stockholm.lib;
4
4
-
in {
11
11
+
in
12
12
+
{
5
13
options = {
6
14
lass.drbd = lib.mkOption {
7
7
-
default = {};
8
8
-
type = lib.types.attrsOf (lib.types.submodule ({ config, ... }: {
9
9
-
options = {
10
10
-
name = lib.mkOption {
11
11
-
type = lib.types.str;
12
12
-
default = config._module.args.name;
13
13
-
};
14
14
-
blockMinor = lib.mkOption {
15
15
-
type = lib.types.int;
16
16
-
default = lib.mod (slib.genid config.name) 16000; # TODO get max_id fron drbd
17
17
-
};
18
18
-
port = lib.mkOption {
19
19
-
type = lib.types.int;
20
20
-
default = 20000 + config.blockMinor;
21
21
-
};
22
22
-
peers = lib.mkOption {
23
23
-
type = lib.types.listOf slib.types.host;
24
24
-
};
25
25
-
disk = lib.mkOption {
26
26
-
type = lib.types.str;
27
27
-
default = "/dev/loop${toString config.blockMinor}";
28
28
-
};
29
29
-
drbdConfig = lib.mkOption {
30
30
-
type = lib.types.path;
31
31
-
internal = true;
32
32
-
default = pkgs.writeText "drbd-${config.name}.conf" ''
33
33
-
resource ${config.name} {
34
34
-
net {
35
35
-
protocol a;
36
36
-
ping-int 10;
37
37
-
csums-alg crc32c;
38
38
-
connect-int 3;
39
39
-
after-sb-0pri discard-older-primary;
40
40
-
after-sb-1pri discard-secondary;
15
15
+
default = { };
16
16
+
type = lib.types.attrsOf (
17
17
+
lib.types.submodule (
18
18
+
{ config, ... }:
19
19
+
{
20
20
+
options = {
21
21
+
name = lib.mkOption {
22
22
+
type = lib.types.str;
23
23
+
default = config._module.args.name;
24
24
+
};
25
25
+
blockMinor = lib.mkOption {
26
26
+
type = lib.types.int;
27
27
+
default = lib.mod (slib.genid config.name) 16000; # TODO get max_id fron drbd
28
28
+
};
29
29
+
port = lib.mkOption {
30
30
+
type = lib.types.int;
31
31
+
default = 20000 + config.blockMinor;
32
32
+
};
33
33
+
peers = lib.mkOption {
34
34
+
type = lib.types.listOf slib.types.host;
35
35
+
};
36
36
+
disk = lib.mkOption {
37
37
+
type = lib.types.str;
38
38
+
default = "/dev/loop${toString config.blockMinor}";
39
39
+
};
40
40
+
drbdConfig = lib.mkOption {
41
41
+
type = lib.types.path;
42
42
+
internal = true;
43
43
+
default = pkgs.writeText "drbd-${config.name}.conf" ''
44
44
+
resource ${config.name} {
45
45
+
net {
46
46
+
protocol a;
47
47
+
ping-int 10;
48
48
+
csums-alg crc32c;
49
49
+
connect-int 3;
50
50
+
after-sb-0pri discard-older-primary;
51
51
+
after-sb-1pri discard-secondary;
41
52
42
42
-
# seems to be drbd-proxy premium feature
43
43
-
on-congestion pull-ahead;
44
44
-
congestion-fill 1G;
45
45
-
congestion-extents 500;
53
53
+
# seems to be drbd-proxy premium feature
54
54
+
on-congestion pull-ahead;
55
55
+
congestion-fill 1G;
56
56
+
congestion-extents 500;
46
57
47
47
-
sndbuf-size 10M;
48
48
-
max-epoch-size 20000;
49
49
-
}
50
50
-
device minor ${toString config.blockMinor};
51
51
-
disk ${config.disk};
52
52
-
meta-disk internal;
53
53
-
${slib.indent (lib.concatStrings (lib.imap1 (i: peer: /* shell */ ''
54
54
-
on ${peer.name} {
55
55
-
address ${peer.nets.retiolum.ip4.addr}:${toString config.port};
56
56
-
node-id ${toString i};
58
58
+
sndbuf-size 10M;
59
59
+
max-epoch-size 20000;
60
60
+
}
61
61
+
device minor ${toString config.blockMinor};
62
62
+
disk ${config.disk};
63
63
+
meta-disk internal;
64
64
+
${
65
65
+
slib.indent (
66
66
+
lib.concatStrings (
67
67
+
lib.imap1 (
68
68
+
i: peer: # shell
69
69
+
''
70
70
+
on ${peer.name} {
71
71
+
address ${peer.nets.retiolum.ip4.addr}:${toString config.port};
72
72
+
node-id ${toString i};
73
73
+
}
74
74
+
'') config.peers
75
75
+
)
76
76
+
)
77
77
+
}
78
78
+
connection-mesh {
79
79
+
hosts ${lib.concatMapStringsSep " " (peer: peer.name) config.peers};
80
80
+
}
57
81
}
58
58
-
'') config.peers))}
59
59
-
connection-mesh {
60
60
-
hosts ${lib.concatMapStringsSep " " (peer: peer.name) config.peers};
61
61
-
}
62
62
-
}
63
63
-
'';
64
64
-
};
65
65
-
};
66
66
-
}));
82
82
+
'';
83
83
+
};
84
84
+
};
85
85
+
}
86
86
+
)
87
87
+
);
67
88
};
68
89
};
69
69
-
config = lib.mkIf (cfg != {}) {
90
90
+
config = lib.mkIf (cfg != { }) {
70
91
boot.extraModulePackages = [
71
71
-
(pkgs.linuxPackages.callPackage ../5pkgs/drbd9/default.nix {})
92
92
+
(pkgs.linuxPackages.callPackage ../5pkgs/drbd9/default.nix { })
72
93
];
73
94
boot.extraModprobeConfig = ''
74
95
options drbd usermode_helper=/run/current-system/sw/bin/drbdadm
···
109
130
];
110
131
111
132
networking.firewall.allowedTCPPorts = map (device: device.port) (lib.attrValues cfg);
112
112
-
systemd.services = lib.mapAttrs' (_: device:
133
133
+
systemd.services = lib.mapAttrs' (
134
134
+
_: device:
113
135
lib.nameValuePair "drbd-${device.name}" {
114
114
-
after = [ "systemd-udev.settle.service" "network.target" "retiolum.service" ];
136
136
+
after = [
137
137
+
"systemd-udev.settle.service"
138
138
+
"network.target"
139
139
+
"retiolum.service"
140
140
+
];
115
141
wants = [ "systemd-udev.settle.service" ];
116
142
wantedBy = [ "multi-user.target" ];
117
143
serviceConfig = {
···
144
170
}
145
171
) cfg;
146
172
147
147
-
148
173
environment.etc."drbd.conf".text = ''
149
174
global {
150
175
usage-count yes;
151
176
}
152
177
153
153
-
${lib.concatMapStrings (device: /* shell */ ''
154
154
-
include ${device.drbdConfig};
155
155
-
'') (lib.attrValues cfg)}
178
178
+
${lib.concatMapStrings (
179
179
+
device: # shell
180
180
+
''
181
181
+
include ${device.drbdConfig};
182
182
+
'') (lib.attrValues cfg)}
156
183
'';
157
184
};
158
185
}
159
159
-
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
3
8
let
4
9
cfg = config.lass.fetchWallpaper;
···
10
15
feh --no-fehbg --bg-scale wallpaper
11
16
'';
12
17
13
13
-
in {
18
18
+
in
19
19
+
{
14
20
options.lass.fetchWallpaper = {
15
21
enable = lib.mkEnableOption "fetch wallpaper";
16
22
url = lib.mkOption {
···
33
39
# do not start when running on umts
34
40
{ ConditionPathExists = "!/var/run/ppp0.pid"; }
35
41
'';
36
36
-
default = {};
42
42
+
default = { };
37
43
};
38
44
};
39
45
···
74
80
isSystemUser = true;
75
81
group = "wallpaper";
76
82
};
77
77
-
users.groups.wallpaper = {};
83
83
+
users.groups.wallpaper = { };
78
84
};
79
85
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
3
8
#TODO: implement recursive mode maybe?
4
9
# enable different mods for files and folders
···
6
11
let
7
12
inherit (pkgs)
8
13
writeScript
9
9
-
;
14
14
+
;
10
15
11
16
inherit (lib)
12
17
concatMapStringsSep
···
15
20
mkIf
16
21
mkOption
17
22
types
18
18
-
;
23
23
+
;
19
24
20
25
cfg = config.lass.folderPerms;
21
26
···
27
32
api = {
28
33
enable = mkEnableOption "folder permissions";
29
34
permissions = mkOption {
30
30
-
type = with types; listOf (submodule ({
31
31
-
options = {
32
32
-
path = mkOption {
33
33
-
type = str;
35
35
+
type =
36
36
+
with types;
37
37
+
listOf (submodule ({
38
38
+
options = {
39
39
+
path = mkOption {
40
40
+
type = str;
41
41
+
};
42
42
+
permission = mkOption {
43
43
+
type = nullOr str;
44
44
+
example = "755";
45
45
+
description = ''
46
46
+
basically anything that chmod takes as permission
47
47
+
'';
48
48
+
default = null;
49
49
+
};
50
50
+
owner = mkOption {
51
51
+
type = nullOr str;
52
52
+
example = "root:root";
53
53
+
description = ''
54
54
+
basically anything that chown takes as owner
55
55
+
'';
56
56
+
default = null;
57
57
+
};
34
58
};
35
35
-
permission = mkOption {
36
36
-
type = nullOr str;
37
37
-
example = "755";
38
38
-
description = ''
39
39
-
basically anything that chmod takes as permission
40
40
-
'';
41
41
-
default = null;
42
42
-
};
43
43
-
owner = mkOption {
44
44
-
type = nullOr str;
45
45
-
example = "root:root";
46
46
-
description = ''
47
47
-
basically anything that chown takes as owner
48
48
-
'';
49
49
-
default = null;
50
50
-
};
51
51
-
};
52
52
-
}));
59
59
+
}));
53
60
};
54
61
};
55
62
···
77
84
${concatMapStringsSep "\n" writeCommand cfg.permissions}
78
85
'';
79
86
80
80
-
writeCommand = fperm:
87
87
+
writeCommand =
88
88
+
fperm:
81
89
concatStringsSep "\n" [
82
90
(buildPermission fperm)
83
91
(buildOwner fperm)
84
92
];
85
93
86
86
-
buildPermission = perm:
94
94
+
buildPermission =
95
95
+
perm:
87
96
#TODO: create folder maybe
88
97
#TODO: check if permission is valid
89
89
-
if (perm.permission == null) then
90
90
-
""
91
91
-
else
92
92
-
"chmod ${perm.permission} ${perm.path}"
93
93
-
;
98
98
+
if (perm.permission == null) then "" else "chmod ${perm.permission} ${perm.path}";
94
99
95
95
-
buildOwner = perm:
100
100
+
buildOwner =
101
101
+
perm:
96
102
#TODO: create folder maybe
97
103
#TODO: check if owner/group valid
98
98
-
if (perm.owner == null) then
99
99
-
""
100
100
-
else
101
101
-
"chown ${perm.owner} ${perm.path}"
102
102
-
;
104
104
+
if (perm.owner == null) then "" else "chown ${perm.owner} ${perm.path}";
103
105
104
104
-
in out
106
106
+
in
107
107
+
out
···
1
1
-
{ self, config, lib, pkgs, ... }: with lib; let
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
8
8
+
with lib;
9
9
+
let
2
10
cfg = config.lass.klem;
3
11
slib = self.inputs.stockholm.lib;
4
4
-
in {
12
12
+
in
13
13
+
{
5
14
options.lass.klem = mkOption {
6
6
-
default = {};
7
7
-
type = types.attrsOf (types.submodule ({ config, ...}: {
8
8
-
options = {
9
9
-
target = mkOption {
10
10
-
default = ".*";
11
11
-
description = ''
12
12
-
regex of valid targets
13
13
-
can be shown with xclip -selection clipboard -t TARGETS
14
14
-
the first hit is taken as target argument
15
15
-
'';
16
16
-
type = types.str;
17
17
-
};
18
18
-
script = mkOption {
19
19
-
description = ''
20
20
-
file to run if entry is selected
21
21
-
'';
22
22
-
type = types.path;
23
23
-
};
24
24
-
label = mkOption {
25
25
-
default = config._module.args.name;
26
26
-
description = ''
27
27
-
label to show in dmenu for this script
28
28
-
'';
29
29
-
type = types.str;
30
30
-
};
31
31
-
};
32
32
-
}));
15
15
+
default = { };
16
16
+
type = types.attrsOf (
17
17
+
types.submodule (
18
18
+
{ config, ... }:
19
19
+
{
20
20
+
options = {
21
21
+
target = mkOption {
22
22
+
default = ".*";
23
23
+
description = ''
24
24
+
regex of valid targets
25
25
+
can be shown with xclip -selection clipboard -t TARGETS
26
26
+
the first hit is taken as target argument
27
27
+
'';
28
28
+
type = types.str;
29
29
+
};
30
30
+
script = mkOption {
31
31
+
description = ''
32
32
+
file to run if entry is selected
33
33
+
'';
34
34
+
type = types.path;
35
35
+
};
36
36
+
label = mkOption {
37
37
+
default = config._module.args.name;
38
38
+
description = ''
39
39
+
label to show in dmenu for this script
40
40
+
'';
41
41
+
type = types.str;
42
42
+
};
43
43
+
};
44
44
+
}
45
45
+
)
46
46
+
);
33
47
};
34
34
-
config = let
35
35
-
klem = pkgs.writers.writeDashBin "klem" ''
36
36
-
set -x
48
48
+
config =
49
49
+
let
50
50
+
klem = pkgs.writers.writeDashBin "klem" ''
51
51
+
set -x
37
52
38
38
-
labels=""
39
39
-
# match filetype against patterns
40
40
-
${concatMapStringsSep "\n" (script: ''
41
41
-
${pkgs.xclip}/bin/xclip -selection clipboard -target TARGETS -out \
42
42
-
| ${pkgs.gnugrep}/bin/grep -q '${script.target}'
43
43
-
if [ $? -eq 0 ]; then
44
44
-
labels="$labels:${script.label}"
45
45
-
fi
46
46
-
'') (attrValues cfg)}
47
47
-
48
48
-
#remove empty line, feed into dmenu
49
49
-
script=$(echo "$labels" \
50
50
-
| ${pkgs.gnused}/bin/sed 's/^://;s/:/\n/g' \
51
51
-
| ${pkgs.dmenu}/bin/dmenu)
52
52
-
53
53
-
#run the chosen script
54
54
-
case $script in
55
55
-
${concatMapStringsSep "\n" (script: slib.indent ''
56
56
-
${script.label})
57
57
-
target=$(${pkgs.xclip}/bin/xclip -selection clipboard -target TARGETS -out \
58
58
-
| ${pkgs.gnugrep}/bin/grep '${script.target}' \
59
59
-
| ${pkgs.gnugrep}/bin/grep -v TARGETS \
60
60
-
| ${pkgs.coreutils}/bin/head -1)
61
61
-
${pkgs.xclip}/bin/xclip -selection clipboard -target "$target" -out \
62
62
-
| ${script.script} \
63
63
-
| ${pkgs.xclip}/bin/xclip -selection clipboard -in
64
64
-
;;
53
53
+
labels=""
54
54
+
# match filetype against patterns
55
55
+
${concatMapStringsSep "\n" (script: ''
56
56
+
${pkgs.xclip}/bin/xclip -selection clipboard -target TARGETS -out \
57
57
+
| ${pkgs.gnugrep}/bin/grep -q '${script.target}'
58
58
+
if [ $? -eq 0 ]; then
59
59
+
labels="$labels:${script.label}"
60
60
+
fi
65
61
'') (attrValues cfg)}
66
66
-
esac
67
67
-
'';
68
68
-
in mkIf (cfg != {}) {
69
69
-
environment.systemPackages = [ klem ];
70
70
-
nixpkgs.overlays = [
71
71
-
(self: super: {
72
72
-
klem = klem;
73
73
-
})
74
74
-
];
75
75
-
};
62
62
+
63
63
+
#remove empty line, feed into dmenu
64
64
+
script=$(echo "$labels" \
65
65
+
| ${pkgs.gnused}/bin/sed 's/^://;s/:/\n/g' \
66
66
+
| ${pkgs.dmenu}/bin/dmenu)
67
67
+
68
68
+
#run the chosen script
69
69
+
case $script in
70
70
+
${
71
71
+
concatMapStringsSep "\n" (
72
72
+
script:
73
73
+
slib.indent ''
74
74
+
${script.label})
75
75
+
target=$(${pkgs.xclip}/bin/xclip -selection clipboard -target TARGETS -out \
76
76
+
| ${pkgs.gnugrep}/bin/grep '${script.target}' \
77
77
+
| ${pkgs.gnugrep}/bin/grep -v TARGETS \
78
78
+
| ${pkgs.coreutils}/bin/head -1)
79
79
+
${pkgs.xclip}/bin/xclip -selection clipboard -target "$target" -out \
80
80
+
| ${script.script} \
81
81
+
| ${pkgs.xclip}/bin/xclip -selection clipboard -in
82
82
+
;;
83
83
+
''
84
84
+
) (attrValues cfg)
85
85
+
}
86
86
+
esac
87
87
+
'';
88
88
+
in
89
89
+
mkIf (cfg != { }) {
90
90
+
environment.systemPackages = [ klem ];
91
91
+
nixpkgs.overlays = [
92
92
+
(_self: _super: {
93
93
+
klem = klem;
94
94
+
})
95
95
+
];
96
96
+
};
76
97
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
3
8
with lib;
4
9
···
14
19
api = {
15
20
enable = mkEnableOption "mysqlBackup";
16
21
config = mkOption {
17
17
-
type = with types; attrsOf (submodule ({ config, ... }: {
18
18
-
options = {
19
19
-
name = mkOption {
20
20
-
type = types.str;
21
21
-
default = config._module.args.name;
22
22
-
};
23
23
-
startAt = mkOption {
24
24
-
type = with types; nullOr str; # TODO systemd.time(7)'s calendar event
25
25
-
default = "*-*-* 01:15:00";
26
26
-
};
27
27
-
user = mkOption {
28
28
-
type = str;
29
29
-
default = "root";
30
30
-
};
31
31
-
password = mkOption {
32
32
-
type = nullOr str;
33
33
-
default = null;
34
34
-
description = ''
35
35
-
path to a file containing the mysqlPassword for the specified user.
36
36
-
'';
37
37
-
};
38
38
-
databases = mkOption {
39
39
-
type = listOf str;
40
40
-
default = [];
41
41
-
};
42
42
-
location = mkOption {
43
43
-
type = str;
44
44
-
default = "/backups/sql_dumps";
45
45
-
};
46
46
-
};
47
47
-
}));
22
22
+
type =
23
23
+
with types;
24
24
+
attrsOf (
25
25
+
submodule (
26
26
+
{ config, ... }:
27
27
+
{
28
28
+
options = {
29
29
+
name = mkOption {
30
30
+
type = types.str;
31
31
+
default = config._module.args.name;
32
32
+
};
33
33
+
startAt = mkOption {
34
34
+
type = with types; nullOr str; # TODO systemd.time(7)'s calendar event
35
35
+
default = "*-*-* 01:15:00";
36
36
+
};
37
37
+
user = mkOption {
38
38
+
type = str;
39
39
+
default = "root";
40
40
+
};
41
41
+
password = mkOption {
42
42
+
type = nullOr str;
43
43
+
default = null;
44
44
+
description = ''
45
45
+
path to a file containing the mysqlPassword for the specified user.
46
46
+
'';
47
47
+
};
48
48
+
databases = mkOption {
49
49
+
type = listOf str;
50
50
+
default = [ ];
51
51
+
};
52
52
+
location = mkOption {
53
53
+
type = str;
54
54
+
default = "/backups/sql_dumps";
55
55
+
};
56
56
+
};
57
57
+
}
58
58
+
)
59
59
+
);
48
60
description = "configuration for mysqlBackup";
49
61
};
50
62
};
···
52
64
imp = {
53
65
54
66
services.mysql.ensureUsers = [
55
55
-
{ ensurePermissions = { "*.*" = "ALL"; }; name = "root"; }
67
67
+
{
68
68
+
ensurePermissions = {
69
69
+
"*.*" = "ALL";
70
70
+
};
71
71
+
name = "root";
72
72
+
}
56
73
];
57
74
58
58
-
systemd.services =
59
59
-
mapAttrs' (_: plan: nameValuePair "mysqlBackup-${plan.name}" {
75
75
+
systemd.services = mapAttrs' (
76
76
+
_: plan:
77
77
+
nameValuePair "mysqlBackup-${plan.name}" {
60
78
path = with pkgs; [
61
79
mysql
62
80
gzip
···
68
86
User = plan.user;
69
87
};
70
88
startAt = plan.startAt;
71
71
-
}) cfg.config;
89
89
+
}
90
90
+
) cfg.config;
72
91
};
73
92
93
93
+
start =
94
94
+
plan:
95
95
+
let
96
96
+
backupScript = plan: db: ''
97
97
+
mkdir -p ${plan.location}
98
98
+
mysqldump -u ${plan.user} ${
99
99
+
optionalString (plan.password != null) "-p$(cat ${plan.password})"
100
100
+
} ${db} | gzip -c > ${plan.location}/${db}.gz
101
101
+
'';
74
102
75
75
-
start = plan: let
76
76
-
backupScript = plan: db: ''
77
77
-
mkdir -p ${plan.location}
78
78
-
mysqldump -u ${plan.user} ${optionalString (plan.password != null) "-p$(cat ${plan.password})"} ${db} | gzip -c > ${plan.location}/${db}.gz
103
103
+
in
104
104
+
pkgs.pkgs.writeDash "mysqlBackup.${plan.name}" ''
105
105
+
${concatMapStringsSep "\n" (backupScript plan) plan.databases}
79
106
'';
80
107
81
81
-
in pkgs.pkgs.writeDash "mysqlBackup.${plan.name}" ''
82
82
-
${concatMapStringsSep "\n" (backupScript plan) plan.databases}
83
83
-
'';
84
84
-
85
85
-
86
86
-
in out
108
108
+
in
109
109
+
out
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
2
8
3
9
with lib;
4
10
···
24
30
[Sites]
25
31
SoupIO: everyone
26
32
Pr0gramm: new,top
27
27
-
Reddit: ${lib.concatStringsSep "," [
28
28
-
"2healthbars"
29
29
-
"abandonedporn"
30
30
-
"animalsbeingderps"
31
31
-
"ANormalDayInRussia"
32
32
-
"assholedesign"
33
33
-
"AwesomeOffBrands"
34
34
-
"bizarrebuildings"
35
35
-
"bonehurtingjuice"
36
36
-
"boottoobig"
37
37
-
"bossfight"
38
38
-
"bravofotogeschichten"
39
39
-
"breathinginformation"
40
40
-
"buddhistmemes"
41
41
-
"cablefail"
42
42
-
"cableporn"
43
43
-
"catastrophicfailure"
44
44
-
"chairsunderwater"
45
45
-
"clevercomebacks"
46
46
-
"confusingperspective"
47
47
-
"conni"
48
48
-
"crappydesign"
49
49
-
"cursedcomments"
50
50
-
"desirepath"
51
51
-
"doenerverbrechen"
52
52
-
"dontdeadopeninside"
53
53
-
"educationalgifs"
54
54
-
"EngineeringPorn"
55
55
-
"eyebleach"
56
56
-
"forbiddensnacks"
57
57
-
"funnyanimals"
58
58
-
"gifs"
59
59
-
"Gittertiere"
60
60
-
"goodboomerhumor"
61
61
-
"grssk"
62
62
-
"halthoch"
63
63
-
"hmm"
64
64
-
"hmmm"
65
65
-
"holdmybeer"
66
66
-
"holup"
67
67
-
"iamatotalpieceofshit"
68
68
-
"ichbin40undlustig"
69
69
-
"idiotsincars"
70
70
-
"illegallysmolcats"
71
71
-
"infokriegerkutschen"
72
72
-
"instagramreality"
73
73
-
"instant_regret"
74
74
-
"itrunsdoom"
75
75
-
"itsaunixsystem"
76
76
-
"kamikazebywords"
77
77
-
"keming"
78
78
-
"kidsarefuckingstupid"
79
79
-
"kitchenconfidential"
80
80
-
"laughingbuddha"
81
81
-
"LiminalSpace"
82
82
-
"loadingicon"
83
83
-
"MachinePorn"
84
84
-
"mallninjashit"
85
85
-
"michaelbaygifs"
86
86
-
"mildlyinfuriating"
87
87
-
"miscatculations"
88
88
-
"natureisfuckinglit"
89
89
-
"nononoyesno"
90
90
-
"notinteresting"
91
91
-
"notliketheothergirls"
92
92
-
"oddlysatisfying"
93
93
-
"ofcoursethatsathing"
94
94
-
"okbuddylinux"
95
95
-
"OSHA"
96
96
-
"PeopleFuckingDying"
97
97
-
"Perfectfit"
98
98
-
"perfectloops"
99
99
-
"PerfectTiming"
100
100
-
"picsofunusualbirds"
101
101
-
"PixelArt"
102
102
-
"pizzacrimes"
103
103
-
"prequelmemes"
104
104
-
"Prisonwallet"
105
105
-
"reactiongifs"
106
106
-
"RealFakeDoors"
107
107
-
"reallifedoodles"
108
108
-
"RetroFuturism"
109
109
-
"robotsbeingjerks"
110
110
-
"SchizophreniaRides"
111
111
-
"scriptedasiangifs"
112
112
-
"shitposting"
113
113
-
"shittyfoodporn"
114
114
-
"shittyrobots"
115
115
-
"softwaregore"
116
116
-
"specializedtools"
117
117
-
"spicypillows"
118
118
-
"StallmanWasRight"
119
119
-
"startledcats"
120
120
-
"startrekstabilized"
121
121
-
"stupidfood"
122
122
-
"techsupportgore"
123
123
-
"thathappened"
124
124
-
"ThingsCutInHalfPorn"
125
125
-
"totallynotrobots"
126
126
-
"trippinthroughtime"
127
127
-
"Unexpected"
128
128
-
"urbanexploration"
129
129
-
"wasletztepreis"
130
130
-
"wellthatsucks"
131
131
-
"wertekinder"
132
132
-
"wewantplates"
133
133
-
"whatcouldgowrong"
134
134
-
"whatsthisbug"
135
135
-
"whatsthisplant"
136
136
-
"whatswrongwithyourdog"
137
137
-
"whenthe"
138
138
-
"yesyesyesyesno"
139
139
-
"youseeingthisshit"
140
140
-
]}
33
33
+
Reddit: ${
34
34
+
lib.concatStringsSep "," [
35
35
+
"2healthbars"
36
36
+
"abandonedporn"
37
37
+
"animalsbeingderps"
38
38
+
"ANormalDayInRussia"
39
39
+
"assholedesign"
40
40
+
"AwesomeOffBrands"
41
41
+
"bizarrebuildings"
42
42
+
"bonehurtingjuice"
43
43
+
"boottoobig"
44
44
+
"bossfight"
45
45
+
"bravofotogeschichten"
46
46
+
"breathinginformation"
47
47
+
"buddhistmemes"
48
48
+
"cablefail"
49
49
+
"cableporn"
50
50
+
"catastrophicfailure"
51
51
+
"chairsunderwater"
52
52
+
"clevercomebacks"
53
53
+
"confusingperspective"
54
54
+
"conni"
55
55
+
"crappydesign"
56
56
+
"cursedcomments"
57
57
+
"desirepath"
58
58
+
"doenerverbrechen"
59
59
+
"dontdeadopeninside"
60
60
+
"educationalgifs"
61
61
+
"EngineeringPorn"
62
62
+
"eyebleach"
63
63
+
"forbiddensnacks"
64
64
+
"funnyanimals"
65
65
+
"gifs"
66
66
+
"Gittertiere"
67
67
+
"goodboomerhumor"
68
68
+
"grssk"
69
69
+
"halthoch"
70
70
+
"hmm"
71
71
+
"hmmm"
72
72
+
"holdmybeer"
73
73
+
"holup"
74
74
+
"iamatotalpieceofshit"
75
75
+
"ichbin40undlustig"
76
76
+
"idiotsincars"
77
77
+
"illegallysmolcats"
78
78
+
"infokriegerkutschen"
79
79
+
"instagramreality"
80
80
+
"instant_regret"
81
81
+
"itrunsdoom"
82
82
+
"itsaunixsystem"
83
83
+
"kamikazebywords"
84
84
+
"keming"
85
85
+
"kidsarefuckingstupid"
86
86
+
"kitchenconfidential"
87
87
+
"laughingbuddha"
88
88
+
"LiminalSpace"
89
89
+
"loadingicon"
90
90
+
"MachinePorn"
91
91
+
"mallninjashit"
92
92
+
"michaelbaygifs"
93
93
+
"mildlyinfuriating"
94
94
+
"miscatculations"
95
95
+
"natureisfuckinglit"
96
96
+
"nononoyesno"
97
97
+
"notinteresting"
98
98
+
"notliketheothergirls"
99
99
+
"oddlysatisfying"
100
100
+
"ofcoursethatsathing"
101
101
+
"okbuddylinux"
102
102
+
"OSHA"
103
103
+
"PeopleFuckingDying"
104
104
+
"Perfectfit"
105
105
+
"perfectloops"
106
106
+
"PerfectTiming"
107
107
+
"picsofunusualbirds"
108
108
+
"PixelArt"
109
109
+
"pizzacrimes"
110
110
+
"prequelmemes"
111
111
+
"Prisonwallet"
112
112
+
"reactiongifs"
113
113
+
"RealFakeDoors"
114
114
+
"reallifedoodles"
115
115
+
"RetroFuturism"
116
116
+
"robotsbeingjerks"
117
117
+
"SchizophreniaRides"
118
118
+
"scriptedasiangifs"
119
119
+
"shitposting"
120
120
+
"shittyfoodporn"
121
121
+
"shittyrobots"
122
122
+
"softwaregore"
123
123
+
"specializedtools"
124
124
+
"spicypillows"
125
125
+
"StallmanWasRight"
126
126
+
"startledcats"
127
127
+
"startrekstabilized"
128
128
+
"stupidfood"
129
129
+
"techsupportgore"
130
130
+
"thathappened"
131
131
+
"ThingsCutInHalfPorn"
132
132
+
"totallynotrobots"
133
133
+
"trippinthroughtime"
134
134
+
"Unexpected"
135
135
+
"urbanexploration"
136
136
+
"wasletztepreis"
137
137
+
"wellthatsucks"
138
138
+
"wertekinder"
139
139
+
"wewantplates"
140
140
+
"whatcouldgowrong"
141
141
+
"whatsthisbug"
142
142
+
"whatsthisplant"
143
143
+
"whatswrongwithyourdog"
144
144
+
"whenthe"
145
145
+
"yesyesyesyesno"
146
146
+
"youseeingthisshit"
147
147
+
]
148
148
+
}
141
149
NineGag: geeky,wtf,hot,trending
142
150
Instagram: nature,wtf
143
151
Fourchan: sci
···
154
162
restartIfChanged = true;
155
163
serviceConfig = {
156
164
Restart = "always";
157
157
-
ExecStart = "${self.packages.${pkgs.system}.nichtparasoup}/bin/nichtparasoup -c ${pkgs.writeText "config.ini" config.lass.nichtparasoup.config}";
165
165
+
ExecStart = "${
166
166
+
self.packages.${pkgs.system}.nichtparasoup
167
167
+
}/bin/nichtparasoup -c ${pkgs.writeText "config.ini" config.lass.nichtparasoup.config}";
158
168
};
159
169
};
160
170
};
···
1
1
-
{ pkgs, lib, config, ... }:
1
1
+
{
2
2
+
pkgs,
3
3
+
lib,
4
4
+
config,
5
5
+
...
6
6
+
}:
2
7
let
3
8
cfg = config.lass.screenlock;
4
9
···
34
39
};
35
40
};
36
41
37
37
-
in out
42
42
+
in
43
43
+
out
···
1
1
-
{ config, lib, pkgs, ... }@args: with lib; let
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
7
7
+
with lib;
8
8
+
let
2
9
3
10
cfg = config.lass.usershadow;
4
11
···
17
24
type = types.str;
18
25
};
19
26
};
20
20
-
21
21
-
debugscript = pkgs.writeDash "testpam" ''
22
22
-
env > /tmp/xxx
23
23
-
echo xxx >> /tmp/xxx
24
24
-
${pkgs.coreutils}/bin/cat /home/testuser/.shadow >> /tmp/xxx
25
25
-
echo yyy >> /tmp/xxx
26
26
-
env >> /tmp/xxx
27
27
-
exit 23
28
28
-
'';
29
27
30
28
imp = {
31
29
environment.systemPackages = [ usershadow ];
···
58
56
};
59
57
};
60
58
61
61
-
usershadow = let
62
62
-
deps = [
63
63
-
"pwstore-fast"
64
64
-
"bytestring"
65
65
-
];
66
66
-
in pkgs.writeHaskellPackage "passwords" {
59
59
+
usershadow =
60
60
+
let
61
61
+
deps = [
62
62
+
"pwstore-fast"
63
63
+
"bytestring"
64
64
+
];
65
65
+
in
66
66
+
pkgs.writeHaskellPackage "passwords" {
67
67
ghc-options = [
68
68
"-rtsopts"
69
69
"-Wall"
···
144
144
};
145
145
};
146
146
147
147
-
in out
147
147
+
in
148
148
+
out
···
1
1
{ self, ... }:
2
2
{
3
3
-
perSystem = { system, pkgs, ... }: {
4
4
-
packages.get-spora-hosts = pkgs.writeScriptBin "get-spora-hosts" ''
5
5
-
set -eu
6
6
-
set -o pipefail
7
7
-
set -x
8
8
-
OUTDIR=$1
9
9
-
for host in ${self}/machines/*; do
10
10
-
if test -e "$host"/facts/mycelium_pubkey; then
11
11
-
if ! test -e "$OUTDIR"/"$(basename "$host")".json; then
12
12
-
${self.packages.${pkgs.system}.mycelium}/bin/mycelium inspect "$(cat "$host"/facts/mycelium_pubkey)" --json > "$OUTDIR/$(basename "$host").json"
3
3
+
perSystem =
4
4
+
{ system, pkgs, ... }:
5
5
+
{
6
6
+
packages.get-spora-hosts = pkgs.writeScriptBin "get-spora-hosts" ''
7
7
+
set -eu
8
8
+
set -o pipefail
9
9
+
set -x
10
10
+
OUTDIR=$1
11
11
+
for host in ${self}/machines/*; do
12
12
+
if test -e "$host"/facts/mycelium_pubkey; then
13
13
+
if ! test -e "$OUTDIR"/"$(basename "$host")".json; then
14
14
+
${
15
15
+
self.packages.${pkgs.system}.mycelium
16
16
+
}/bin/mycelium inspect "$(cat "$host"/facts/mycelium_pubkey)" --json > "$OUTDIR/$(basename "$host").json"
17
17
+
fi
13
18
fi
14
14
-
fi
15
15
-
done
16
16
-
'';
17
17
-
};
19
19
+
done
20
20
+
'';
21
21
+
};
18
22
}
···
1
1
{ inputs, ... }:
2
2
{
3
3
-
perSystem = { system, ... }: {
4
4
-
packages.nvim = inputs.nixvim.legacyPackages.${system}.makeNixvim {
5
5
-
vimAlias = true;
6
6
-
colorschemes.ayu = {
7
7
-
enable = true;
8
8
-
settings.overrides = {
9
9
-
EoLSpace = { bg = "#883333"; };
10
10
-
};
11
11
-
};
12
12
-
globals.mapleader = " ";
13
13
-
opts = {
14
14
-
mouse = "a";
15
15
-
number = true;
16
16
-
shiftwidth = 2;
17
17
-
clipboard = "unnamedplus";
18
18
-
# undo stuff
19
19
-
undofile = {};
20
20
-
undolevels = 10000;
21
21
-
undoreload = 10000;
22
22
-
listchars = "tab:⇥ ,extends:❯,precedes:❮,nbsp:␣,trail:·,eol:↲";
23
23
-
};
24
24
-
extraConfigVim = ''
25
25
-
set et
26
26
-
27
27
-
" show special characters
28
28
-
set list
29
29
-
30
30
-
" match trailing whitespace
31
31
-
match EoLSpace /\s\+$/
32
32
-
33
33
-
" need to use lua to expand $HOME
34
34
-
lua vim.o.undodir = vim.fs.normalize('$HOME/.vim/undodir')
35
35
-
'';
36
36
-
keymaps = [
37
37
-
{ mode = "i"; key = "<C-p>"; action = "<Nop>"; }
38
38
-
{ mode = "i"; key = "<C-n>"; action = "<Nop>"; }
39
39
-
{ mode = "n"; key = "<C-c>"; action = ":q<cr>"; }
40
40
-
{ mode = "n"; key = "<Space>"; action = "<Nop>"; }
41
41
-
{ mode = "n"; key = "<leader>u"; action = ":UndotreeToggle<cr>"; }
42
42
-
{ mode = "n"; key = "<leader>sd"; action = ":colorscheme ayu-dark<cr>"; }
43
43
-
{ mode = "n"; key = "<leader>sw"; action = ":colorscheme ayu-light<cr>"; }
44
44
-
{ mode = [ "n" "v" ]; key = "<leader>cc"; action = ":CopilotChatOpen<cr>"; }
45
45
-
{ mode = [ "n" "v" ]; key = "<leader>ce"; action = ":CopilotChatExplain<cr>"; }
46
46
-
{ mode = [ "n" "v" ]; key = "<leader>cr"; action = ":CopilotChatReview<cr>"; }
47
47
-
{ mode = [ "n" "v" ]; key = "<leader>cf"; action = ":CopilotChatFix<cr>"; }
48
48
-
{ mode = [ "n" "v" ]; key = "<leader>cd"; action = ":CopilotChatDocs<cr>"; }
49
49
-
{ mode = [ "n" "x" ]; key = "p"; action = "<Plug>(YankyPutAfter)"; }
50
50
-
{ mode = [ "n" "x" ]; key = "P"; action = "<Plug>(YankyPutBefore)"; }
51
51
-
];
52
52
-
plugins.web-devicons.enable = true;
53
53
-
plugins.telescope = {
54
54
-
enable = true;
55
55
-
keymaps = {
56
56
-
"<leader>b" = "buffers";
57
57
-
"<leader>ff" = "find_files";
58
58
-
"<leader>fg" = "live_grep";
59
59
-
"<leader>fh" = "help_tags";
60
60
-
"<leader>fp" = "yank_history";
61
61
-
};
62
62
-
};
63
63
-
plugins.lsp-format.enable = true;
64
64
-
plugins.lsp = {
65
65
-
enable = true;
66
66
-
servers = {
67
67
-
bashls.enable = true; # bash
68
68
-
nixd.enable = true; # nix
69
69
-
ruff-lsp.enable = true; # python
70
70
-
harper-ls.enable = true; # comments
71
71
-
jsonls.enable = true; # json
72
72
-
};
73
73
-
};
74
74
-
plugins.undotree = {
75
75
-
enable = true;
76
76
-
settings.SetFocusWhenToggle = true;
77
77
-
};
78
78
-
plugins.treesitter.enable = true;
79
79
-
plugins.copilot-cmp.enable = true;
80
80
-
plugins.copilot-lua.panel.enabled = false;
81
81
-
plugins.copilot-lua.suggestion.enabled = false;
82
82
-
plugins.cmp_yanky.enable = true;
83
83
-
plugins.cmp = {
84
84
-
enable = true;
85
85
-
autoEnableSources = true;
86
86
-
settings = {
87
87
-
experimental = { ghost_text = true; };
88
88
-
sources = [
89
89
-
{ name = "nvim_lsp"; }
90
90
-
{ name = "emoji"; }
91
91
-
{
92
92
-
name = "buffer"; # text within current buffer
93
93
-
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
94
94
-
keywordLength = 2;
95
95
-
}
96
96
-
{
97
97
-
name = "copilot"; # enable copilot
98
98
-
}
99
99
-
{
100
100
-
name = "path"; # file system paths
101
101
-
keywordLength = 3;
102
102
-
}
103
103
-
{ name = "cmp_yanky"; }
104
104
-
];
105
105
-
106
106
-
mapping = {
107
107
-
"<Tab>" = "cmp.mapping.select_next_item()";
108
108
-
"<S-Tab>" = "cmp.mapping.select_prev_item()";
109
109
-
"<C-n>" = "cmp.mapping.select_next_item()";
110
110
-
"<C-p>" = "cmp.mapping.select_prev_item()";
111
111
-
"<C-e>" = "cmp.mapping.abort()";
112
112
-
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
113
113
-
"<C-f>" = "cmp.mapping.scroll_docs(4)";
114
114
-
"<C-Space>" = "cmp.mapping.complete()";
115
115
-
"<CR>" = "cmp.mapping.confirm({ select = true })";
116
116
-
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
3
3
+
perSystem =
4
4
+
{ system, ... }:
5
5
+
{
6
6
+
packages.nvim = inputs.nixvim.legacyPackages.${system}.makeNixvim {
7
7
+
vimAlias = true;
8
8
+
colorschemes.ayu = {
9
9
+
enable = true;
10
10
+
settings.overrides = {
11
11
+
EoLSpace = {
12
12
+
bg = "#883333";
13
13
+
};
117
14
};
118
15
};
16
16
+
globals.mapleader = " ";
17
17
+
opts = {
18
18
+
mouse = "a";
19
19
+
number = true;
20
20
+
shiftwidth = 2;
21
21
+
clipboard = "unnamedplus";
22
22
+
# undo stuff
23
23
+
undofile = { };
24
24
+
undolevels = 10000;
25
25
+
undoreload = 10000;
26
26
+
listchars = "tab:⇥ ,extends:❯,precedes:❮,nbsp:␣,trail:·,eol:↲";
27
27
+
};
28
28
+
extraConfigVim = ''
29
29
+
set et
30
30
+
31
31
+
" show special characters
32
32
+
set list
33
33
+
34
34
+
" match trailing whitespace
35
35
+
match EoLSpace /\s\+$/
36
36
+
37
37
+
" need to use lua to expand $HOME
38
38
+
lua vim.o.undodir = vim.fs.normalize('$HOME/.vim/undodir')
39
39
+
'';
40
40
+
keymaps = [
41
41
+
{
42
42
+
mode = "i";
43
43
+
key = "<C-p>";
44
44
+
action = "<Nop>";
45
45
+
}
46
46
+
{
47
47
+
mode = "i";
48
48
+
key = "<C-n>";
49
49
+
action = "<Nop>";
50
50
+
}
51
51
+
{
52
52
+
mode = "n";
53
53
+
key = "<C-c>";
54
54
+
action = ":q<cr>";
55
55
+
}
56
56
+
{
57
57
+
mode = "n";
58
58
+
key = "<Space>";
59
59
+
action = "<Nop>";
60
60
+
}
61
61
+
{
62
62
+
mode = "n";
63
63
+
key = "<leader>u";
64
64
+
action = ":UndotreeToggle<cr>";
65
65
+
}
66
66
+
{
67
67
+
mode = "n";
68
68
+
key = "<leader>sd";
69
69
+
action = ":colorscheme ayu-dark<cr>";
70
70
+
}
71
71
+
{
72
72
+
mode = "n";
73
73
+
key = "<leader>sw";
74
74
+
action = ":colorscheme ayu-light<cr>";
75
75
+
}
76
76
+
{
77
77
+
mode = [
78
78
+
"n"
79
79
+
"v"
80
80
+
];
81
81
+
key = "<leader>cc";
82
82
+
action = ":CopilotChatOpen<cr>";
83
83
+
}
84
84
+
{
85
85
+
mode = [
86
86
+
"n"
87
87
+
"v"
88
88
+
];
89
89
+
key = "<leader>ce";
90
90
+
action = ":CopilotChatExplain<cr>";
91
91
+
}
92
92
+
{
93
93
+
mode = [
94
94
+
"n"
95
95
+
"v"
96
96
+
];
97
97
+
key = "<leader>cr";
98
98
+
action = ":CopilotChatReview<cr>";
99
99
+
}
100
100
+
{
101
101
+
mode = [
102
102
+
"n"
103
103
+
"v"
104
104
+
];
105
105
+
key = "<leader>cf";
106
106
+
action = ":CopilotChatFix<cr>";
107
107
+
}
108
108
+
{
109
109
+
mode = [
110
110
+
"n"
111
111
+
"v"
112
112
+
];
113
113
+
key = "<leader>cd";
114
114
+
action = ":CopilotChatDocs<cr>";
115
115
+
}
116
116
+
{
117
117
+
mode = [
118
118
+
"n"
119
119
+
"x"
120
120
+
];
121
121
+
key = "p";
122
122
+
action = "<Plug>(YankyPutAfter)";
123
123
+
}
124
124
+
{
125
125
+
mode = [
126
126
+
"n"
127
127
+
"x"
128
128
+
];
129
129
+
key = "P";
130
130
+
action = "<Plug>(YankyPutBefore)";
131
131
+
}
132
132
+
];
133
133
+
plugins.web-devicons.enable = true;
134
134
+
plugins.telescope = {
135
135
+
enable = true;
136
136
+
keymaps = {
137
137
+
"<leader>b" = "buffers";
138
138
+
"<leader>ff" = "find_files";
139
139
+
"<leader>fg" = "live_grep";
140
140
+
"<leader>fh" = "help_tags";
141
141
+
"<leader>fp" = "yank_history";
142
142
+
};
143
143
+
};
144
144
+
plugins.lsp-format.enable = true;
145
145
+
plugins.lsp = {
146
146
+
enable = true;
147
147
+
servers = {
148
148
+
bashls.enable = true; # bash
149
149
+
nixd.enable = true; # nix
150
150
+
ruff-lsp.enable = true; # python
151
151
+
harper-ls.enable = true; # comments
152
152
+
jsonls.enable = true; # json
153
153
+
};
154
154
+
};
155
155
+
plugins.undotree = {
156
156
+
enable = true;
157
157
+
settings.SetFocusWhenToggle = true;
158
158
+
};
159
159
+
plugins.treesitter.enable = true;
160
160
+
plugins.copilot-cmp.enable = true;
161
161
+
plugins.copilot-lua.panel.enabled = false;
162
162
+
plugins.copilot-lua.suggestion.enabled = false;
163
163
+
plugins.cmp_yanky.enable = true;
164
164
+
plugins.cmp = {
165
165
+
enable = true;
166
166
+
autoEnableSources = true;
167
167
+
settings = {
168
168
+
experimental = {
169
169
+
ghost_text = true;
170
170
+
};
171
171
+
sources = [
172
172
+
{ name = "nvim_lsp"; }
173
173
+
{ name = "emoji"; }
174
174
+
{
175
175
+
name = "buffer"; # text within current buffer
176
176
+
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
177
177
+
keywordLength = 2;
178
178
+
}
179
179
+
{
180
180
+
name = "copilot"; # enable copilot
181
181
+
}
182
182
+
{
183
183
+
name = "path"; # file system paths
184
184
+
keywordLength = 3;
185
185
+
}
186
186
+
{ name = "cmp_yanky"; }
187
187
+
];
188
188
+
189
189
+
mapping = {
190
190
+
"<Tab>" = "cmp.mapping.select_next_item()";
191
191
+
"<S-Tab>" = "cmp.mapping.select_prev_item()";
192
192
+
"<C-n>" = "cmp.mapping.select_next_item()";
193
193
+
"<C-p>" = "cmp.mapping.select_prev_item()";
194
194
+
"<C-e>" = "cmp.mapping.abort()";
195
195
+
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
196
196
+
"<C-f>" = "cmp.mapping.scroll_docs(4)";
197
197
+
"<C-Space>" = "cmp.mapping.complete()";
198
198
+
"<CR>" = "cmp.mapping.confirm({ select = true })";
199
199
+
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
200
200
+
};
201
201
+
};
202
202
+
};
203
203
+
plugins.none-ls = {
204
204
+
enable = true;
205
205
+
sources.formatting.treefmt.enable = true;
206
206
+
};
207
207
+
plugins.bufferline.enable = true;
208
208
+
plugins.which-key.enable = true;
209
209
+
plugins.yanky = {
210
210
+
enable = true;
211
211
+
enableTelescope = true;
212
212
+
};
213
213
+
plugins.comment.enable = true;
214
214
+
plugins.copilot-chat.enable = true;
119
215
};
120
120
-
plugins.none-ls = {
121
121
-
enable = true;
122
122
-
sources.formatting.treefmt.enable = true;
123
123
-
};
124
124
-
plugins.bufferline.enable = true;
125
125
-
plugins.which-key.enable = true;
126
126
-
plugins.yanky = {
127
127
-
enable = true;
128
128
-
enableTelescope = true;
129
129
-
};
130
130
-
plugins.comment.enable = true;
131
131
-
plugins.copilot-chat.enable = true;
132
216
};
133
133
-
};
134
217
}
···
1
1
{ ... }:
2
2
{
3
3
-
perSystem = { system, pkgs, ... }: let
4
4
-
zshrc = ''
5
5
-
autoload -U compinit && compinit
3
3
+
perSystem =
4
4
+
{ pkgs, ... }:
5
5
+
let
6
6
+
zshrc = ''
7
7
+
autoload -U compinit && compinit
6
8
7
7
-
# Setup custom interactive shell init stuff.
8
8
-
# Bind gpg-agent to this TTY if gpg commands are used.
9
9
-
export GPG_TTY=$(tty)
9
9
+
# Setup custom interactive shell init stuff.
10
10
+
# Bind gpg-agent to this TTY if gpg commands are used.
11
11
+
export GPG_TTY=$(tty)
10
12
11
13
12
12
-
unsetopt nomatch # no matches found urls
13
13
-
setopt autocd extendedglob
14
14
-
bindkey -e
14
14
+
unsetopt nomatch # no matches found urls
15
15
+
setopt autocd extendedglob
16
16
+
bindkey -e
15
17
16
16
-
#C-x C-e open line in editor
17
17
-
autoload -z edit-command-line
18
18
-
zle -N edit-command-line
19
19
-
bindkey "^X^E" edit-command-line
18
18
+
#C-x C-e open line in editor
19
19
+
autoload -z edit-command-line
20
20
+
zle -N edit-command-line
21
21
+
bindkey "^X^E" edit-command-line
20
22
21
21
-
#fzf inclusion
22
22
-
source ${pkgs.fzf}/share/fzf/completion.zsh
23
23
-
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
23
23
+
#fzf inclusion
24
24
+
source ${pkgs.fzf}/share/fzf/completion.zsh
25
25
+
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
24
26
25
25
-
# atuin distributed shell history
26
26
-
export ATUIN_CONFIG_DIR=${pkgs.writeTextDir "/config.toml" ''
27
27
-
auto_sync = true
28
28
-
update_check = false
29
29
-
sync_address = "http://green.r:8888"
30
30
-
sync_frequency = 0
31
31
-
style = "compact"
32
32
-
''};
33
33
-
export ATUIN_NOBIND="true" # disable all keybdinings of atuin
34
34
-
eval "$(atuin init zsh)"
35
35
-
bindkey '^r' _atuin_search_widget # bind ctrl+r to atuin
36
36
-
# use zsh only session history
37
37
-
fc -p
27
27
+
# atuin distributed shell history
28
28
+
export ATUIN_CONFIG_DIR=${pkgs.writeTextDir "/config.toml" ''
29
29
+
auto_sync = true
30
30
+
update_check = false
31
31
+
sync_address = "http://green.r:8888"
32
32
+
sync_frequency = 0
33
33
+
style = "compact"
34
34
+
''};
35
35
+
export ATUIN_NOBIND="true" # disable all keybdinings of atuin
36
36
+
eval "$(atuin init zsh)"
37
37
+
bindkey '^r' _atuin_search_widget # bind ctrl+r to atuin
38
38
+
# use zsh only session history
39
39
+
fc -p
38
40
39
39
-
#completion magic
40
40
-
autoload -Uz compinit
41
41
-
compinit
42
42
-
zstyle ':completion:*' menu select
41
41
+
#completion magic
42
42
+
autoload -Uz compinit
43
43
+
compinit
44
44
+
zstyle ':completion:*' menu select
43
45
44
44
-
#enable automatic rehashing of $PATH
45
45
-
zstyle ':completion:*' rehash true
46
46
+
#enable automatic rehashing of $PATH
47
47
+
zstyle ':completion:*' rehash true
46
48
47
47
-
# fancy mv which interactively gets the second argument if not given
48
48
-
function mv() {
49
49
-
if [[ "$#" -ne 1 ]] || [[ ! -e "$1" ]]; then
50
50
-
command mv -v "$@"
51
51
-
return
52
52
-
fi
49
49
+
# fancy mv which interactively gets the second argument if not given
50
50
+
function mv() {
51
51
+
if [[ "$#" -ne 1 ]] || [[ ! -e "$1" ]]; then
52
52
+
command mv -v "$@"
53
53
+
return
54
54
+
fi
53
55
54
54
-
newfilename="$1"
55
55
-
vared newfilename
56
56
-
command mv -v -- "$1" "$newfilename"
57
57
-
}
56
56
+
newfilename="$1"
57
57
+
vared newfilename
58
58
+
command mv -v -- "$1" "$newfilename"
59
59
+
}
58
60
59
59
-
#emacs bindings
60
60
-
bindkey "[7~" beginning-of-line
61
61
-
bindkey "[8~" end-of-line
62
62
-
bindkey "Oc" emacs-forward-word
63
63
-
bindkey "Od" emacs-backward-word
61
61
+
#emacs bindings
62
62
+
bindkey "[7~" beginning-of-line
63
63
+
bindkey "[8~" end-of-line
64
64
+
bindkey "Oc" emacs-forward-word
65
65
+
bindkey "Od" emacs-backward-word
64
66
65
65
-
# direnv integration
66
66
-
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
67
67
+
# direnv integration
68
68
+
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
67
69
68
68
-
# This function is called whenever a command is not found.
69
69
-
command_not_found_handler() {
70
70
-
local p='${pkgs.nix-index}/etc/profile.d/command-not-found.sh'
71
71
-
if [ -x "$p" ] && [ -f '/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' ]; then
72
72
-
# Run the helper program.
73
73
-
"$p" "$@"
70
70
+
# This function is called whenever a command is not found.
71
71
+
command_not_found_handler() {
72
72
+
local p='${pkgs.nix-index}/etc/profile.d/command-not-found.sh'
73
73
+
if [ -x "$p" ] && [ -f '/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' ]; then
74
74
+
# Run the helper program.
75
75
+
"$p" "$@"
74
76
75
75
-
# Retry the command if we just installed it.
76
76
-
if [ $? = 126 ]; then
77
77
-
"$@"
77
77
+
# Retry the command if we just installed it.
78
78
+
if [ $? = 126 ]; then
79
79
+
"$@"
80
80
+
else
81
81
+
return 127
82
82
+
fi
78
83
else
84
84
+
# Indicate than there was an error so ZSH falls back to its default handler
85
85
+
echo "$1: command not found" >&2
79
86
return 127
80
87
fi
88
88
+
}
89
89
+
90
90
+
91
91
+
# Setup aliases.
92
92
+
alias -- grep='grep --color=auto'
93
93
+
alias -- ip='ip -color=auto'
94
94
+
alias -- l='ls -alh'
95
95
+
alias -- la='ls -la'
96
96
+
alias -- ll='ls -l'
97
97
+
alias -- ls='ls --color'
98
98
+
alias -- ns='nix-shell --command zsh'
99
99
+
100
100
+
# Setup prompt.
101
101
+
autoload -U promptinit
102
102
+
promptinit
103
103
+
104
104
+
p_error='%(?..%F{red}%?%f )'
105
105
+
t_error='%(?..%? )'
106
106
+
107
107
+
case $UID in
108
108
+
0)
109
109
+
p_username='%F{red}root%f'
110
110
+
t_username='root'
111
111
+
;;
112
112
+
1337)
113
113
+
p_username=""
114
114
+
t_username=""
115
115
+
;;
116
116
+
*)
117
117
+
p_username='%F{blue}%n%f'
118
118
+
t_username='%n'
119
119
+
;;
120
120
+
esac
121
121
+
122
122
+
if test -n "$SSH_CLIENT"; then
123
123
+
p_hostname='@%F{magenta}%M%f '
124
124
+
t_hostname='@%M '
81
125
else
82
82
-
# Indicate than there was an error so ZSH falls back to its default handler
83
83
-
echo "$1: command not found" >&2
84
84
-
return 127
126
126
+
p_hostname=""
127
127
+
t_hostname=""
85
128
fi
86
86
-
}
87
129
130
130
+
#check if in nix shell
131
131
+
if test -n "$IN_NIX_SHELL"; then
132
132
+
p_nixshell='%F{green}[s]%f '
133
133
+
t_nixshell='[s] '
134
134
+
else
135
135
+
p_nixshell=""
136
136
+
t_nixshell=""
137
137
+
fi
88
138
89
89
-
# Setup aliases.
90
90
-
alias -- grep='grep --color=auto'
91
91
-
alias -- ip='ip -color=auto'
92
92
-
alias -- l='ls -alh'
93
93
-
alias -- la='ls -la'
94
94
-
alias -- ll='ls -l'
95
95
-
alias -- ls='ls --color'
96
96
-
alias -- ns='nix-shell --command zsh'
97
97
-
98
98
-
# Setup prompt.
99
99
-
autoload -U promptinit
100
100
-
promptinit
101
101
-
102
102
-
p_error='%(?..%F{red}%?%f )'
103
103
-
t_error='%(?..%? )'
104
104
-
105
105
-
case $UID in
106
106
-
0)
107
107
-
p_username='%F{red}root%f'
108
108
-
t_username='root'
139
139
+
PROMPT="$p_error$p_username$p_hostname$p_nixshell%~ "
140
140
+
TITLE="$t_error$t_username$t_hostname$t_nixshell%~"
141
141
+
case $TERM in
142
142
+
(*xterm* | *rxvt*)
143
143
+
function precmd {
144
144
+
PROMPT_EVALED=$(print -P "$TITLE")
145
145
+
echo -ne "\033]0;$$ $PROMPT_EVALED\007"
146
146
+
}
147
147
+
# This seems broken for some reason
148
148
+
# # This is seen while the shell waits for a command to complete.
149
149
+
# function preexec {
150
150
+
# PROMPT_EVALED=$(print -P "$TITLE")
151
151
+
# echo -ne "\033]0;$$ $PROMPT_EVALED $1\007"
152
152
+
# }
109
153
;;
110
110
-
1337)
111
111
-
p_username=""
112
112
-
t_username=""
113
113
-
;;
114
114
-
*)
115
115
-
p_username='%F{blue}%n%f'
116
116
-
t_username='%n'
117
117
-
;;
118
118
-
esac
119
119
-
120
120
-
if test -n "$SSH_CLIENT"; then
121
121
-
p_hostname='@%F{magenta}%M%f '
122
122
-
t_hostname='@%M '
123
123
-
else
124
124
-
p_hostname=""
125
125
-
t_hostname=""
126
126
-
fi
127
127
-
128
128
-
#check if in nix shell
129
129
-
if test -n "$IN_NIX_SHELL"; then
130
130
-
p_nixshell='%F{green}[s]%f '
131
131
-
t_nixshell='[s] '
132
132
-
else
133
133
-
p_nixshell=""
134
134
-
t_nixshell=""
135
135
-
fi
136
136
-
137
137
-
PROMPT="$p_error$p_username$p_hostname$p_nixshell%~ "
138
138
-
TITLE="$t_error$t_username$t_hostname$t_nixshell%~"
139
139
-
case $TERM in
140
140
-
(*xterm* | *rxvt*)
141
141
-
function precmd {
142
142
-
PROMPT_EVALED=$(print -P "$TITLE")
143
143
-
echo -ne "\033]0;$$ $PROMPT_EVALED\007"
144
144
-
}
145
145
-
# This seems broken for some reason
146
146
-
# # This is seen while the shell waits for a command to complete.
147
147
-
# function preexec {
148
148
-
# PROMPT_EVALED=$(print -P "$TITLE")
149
149
-
# echo -ne "\033]0;$$ $PROMPT_EVALED $1\007"
150
150
-
# }
151
151
-
;;
152
152
-
esac
154
154
+
esac
153
155
154
156
155
155
-
# Disable some features to support TRAMP.
156
156
-
if [ "$TERM" = dumb ]; then
157
157
-
unsetopt zle prompt_cr prompt_subst
158
158
-
unset RPS1 RPROMPT
159
159
-
PS1='$ '
160
160
-
PROMPT='$ '
161
161
-
fi
162
162
-
'';
163
163
-
in {
164
164
-
packages.sh = pkgs.writeScriptBin "sh" ''
165
165
-
zdotdir=$(mktemp -d)
166
166
-
export ZDOTDIR=${pkgs.writeTextDir "/.zshrc" zshrc}
167
167
-
exec ${pkgs.zsh}/bin/zsh "$@"
168
168
-
'';
169
169
-
};
157
157
+
# Disable some features to support TRAMP.
158
158
+
if [ "$TERM" = dumb ]; then
159
159
+
unsetopt zle prompt_cr prompt_subst
160
160
+
unset RPS1 RPROMPT
161
161
+
PS1='$ '
162
162
+
PROMPT='$ '
163
163
+
fi
164
164
+
'';
165
165
+
in
166
166
+
{
167
167
+
packages.sh = pkgs.writeScriptBin "sh" ''
168
168
+
zdotdir=$(mktemp -d)
169
169
+
export ZDOTDIR=${pkgs.writeTextDir "/.zshrc" zshrc}
170
170
+
exec ${pkgs.zsh}/bin/zsh "$@"
171
171
+
'';
172
172
+
};
170
173
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
systemd.services.antimicrox = {
4
9
after = [ "display-manager.service" ];
···
1
1
-
{ config, lib, pkgs, ...}:
1
1
+
{ ... }:
2
2
{
3
3
services.nginx = {
4
4
enable = true;
···
1
1
-
{ config, lib, pkgs, ...}:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
# nixpkgs.config.packageOverrides = p: {
4
4
# nix-serve = p.haskellPackages.nix-serve-ng;
···
8
8
clanCore.facts.services."nix-serve" = {
9
9
secret."nix-serve.key" = { };
10
10
public."nix-serve.pub" = { };
11
11
-
generator.path = with pkgs; [ coreutils nix ];
11
11
+
generator.path = with pkgs; [
12
12
+
coreutils
13
13
+
nix
14
14
+
];
12
15
generator.script = ''
13
16
nix-store --generate-binary-cache-key "$secrets"/nix-serve.key "$facts"/nix-serve.pub
14
17
'';
···
36
39
};
37
40
};
38
41
}
39
39
-
···
1
1
-
{ pkgs
2
2
-
, config
3
3
-
, lib
4
4
-
, inputs
5
5
-
, ...
1
1
+
{
2
2
+
lib,
3
3
+
...
6
4
}:
7
5
let
8
6
ip4 = "95.217.192.59";
···
21
19
22
20
# $TTL 300
23
21
24
24
-
# @ IN NS ns1.lassul.us.
25
25
-
# '';
26
22
in
23
23
+
# @ IN NS ns1.lassul.us.
24
24
+
# '';
27
25
{
28
26
#content of the secret
29
27
#key:
···
45
43
# ];
46
44
settings = {
47
45
server = {
48
48
-
listen = [ "${ip4}@53" "${ip6}@53" ];
46
46
+
listen = [
47
47
+
"${ip4}@53"
48
48
+
"${ip6}@53"
49
49
+
];
49
50
};
50
51
51
52
remote = [
···
110
111
}
111
112
];
112
113
113
113
-
mod-rrl = [{
114
114
-
id = "default";
115
115
-
rate-limit = 200;
116
116
-
slip = 2;
117
117
-
}];
114
114
+
mod-rrl = [
115
115
+
{
116
116
+
id = "default";
117
117
+
rate-limit = 200;
118
118
+
slip = 2;
119
119
+
}
120
120
+
];
118
121
119
119
-
policy = [{
120
120
-
id = "rsa2k";
121
121
-
algorithm = "RSASHA256";
122
122
-
ksk-size = 4096;
123
123
-
zsk-size = 2048;
124
124
-
nsec3 = true;
125
125
-
}];
122
122
+
policy = [
123
123
+
{
124
124
+
id = "rsa2k";
125
125
+
algorithm = "RSASHA256";
126
126
+
ksk-size = 4096;
127
127
+
zsk-size = 2048;
128
128
+
nsec3 = true;
129
129
+
}
130
130
+
];
126
131
127
132
zone = [
128
133
{
129
134
domain = "lassul.us";
130
135
file = "${./lassul.us.zone}";
131
131
-
notify = [ "hetzner_ip4_1" "hetzner_ip4_2" "hetzner_ip4_3" "hetzner_ip6_1" "hetzner_ip6_2" "hetzner_ip6_3" ];
132
132
-
acl = [ "hetzner_ip4_1" "hetzner_ip4_2" "hetzner_ip4_3" "hetzner_ip6_1" "hetzner_ip6_2" "hetzner_ip6_3" ];
136
136
+
notify = [
137
137
+
"hetzner_ip4_1"
138
138
+
"hetzner_ip4_2"
139
139
+
"hetzner_ip4_3"
140
140
+
"hetzner_ip6_1"
141
141
+
"hetzner_ip6_2"
142
142
+
"hetzner_ip6_3"
143
143
+
];
144
144
+
acl = [
145
145
+
"hetzner_ip4_1"
146
146
+
"hetzner_ip4_2"
147
147
+
"hetzner_ip4_3"
148
148
+
"hetzner_ip6_1"
149
149
+
"hetzner_ip6_2"
150
150
+
"hetzner_ip6_3"
151
151
+
];
133
152
dnssec-signing = true;
134
153
dnssec-policy = "rsa2k";
135
154
}
···
138
157
};
139
158
140
159
# disable to enable auto key generation
141
141
-
systemd.services.knot.serviceConfig.SystemCallFilter = lib.mkForce [];
160
160
+
systemd.services.knot.serviceConfig.SystemCallFilter = lib.mkForce [ ];
142
161
143
162
networking.firewall.allowedTCPPorts = [ 53 ];
144
163
networking.firewall.allowedUDPPorts = [ 53 ];
···
1
1
# seems to work, very slow though
2
2
3
3
-
{ config, lib, pkgs, ... }:
3
3
+
{ config, pkgs, ... }:
4
4
let
5
5
6
6
cname = "green-cryfs";
7
7
8
8
-
in {
8
8
+
in
9
9
+
{
9
10
imports = [
10
11
<stockholm/lass/2configs/container-networking.nix>
11
12
<stockholm/lass/2configs/syncthing.nix>
···
14
15
programs.fuse.userAllowOther = true;
15
16
16
17
services.syncthing.declarative.folders."/var/lib/sync-containers/${cname}/cryfs" = {
17
17
-
devices = [ "icarus" "skynet" "littleT" "shodan" "mors" "morpheus" ];
18
18
+
devices = [
19
19
+
"icarus"
20
20
+
"skynet"
21
21
+
"littleT"
22
22
+
"shodan"
23
23
+
"mors"
24
24
+
"morpheus"
25
25
+
];
18
26
ignorePerms = false;
19
27
};
20
28
···
25
33
];
26
34
};
27
35
28
28
-
29
36
systemd.services."container@${cname}".reloadIfChanged = mkForce false;
30
37
containers.${cname} = {
31
31
-
config = { ... }: {
32
32
-
environment.systemPackages = [
33
33
-
pkgs.git
34
34
-
pkgs.rxvt-unicode-unwrapped.terminfo
35
35
-
];
36
36
-
services.openssh.enable = true;
37
37
-
users.users.root.openssh.authorizedKeys.keys = [
38
38
-
config.krebs.users.lass.pubkey
39
39
-
];
40
40
-
system.activationScripts.fuse = {
41
41
-
text = ''
42
42
-
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
43
43
-
'';
44
44
-
deps = [];
38
38
+
config =
39
39
+
{ ... }:
40
40
+
{
41
41
+
environment.systemPackages = [
42
42
+
pkgs.git
43
43
+
pkgs.rxvt-unicode-unwrapped.terminfo
44
44
+
];
45
45
+
services.openssh.enable = true;
46
46
+
users.users.root.openssh.authorizedKeys.keys = [
47
47
+
config.krebs.users.lass.pubkey
48
48
+
];
49
49
+
system.activationScripts.fuse = {
50
50
+
text = ''
51
51
+
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
52
52
+
'';
53
53
+
deps = [ ];
54
54
+
};
45
55
};
46
46
-
};
47
56
allowedDevices = [
48
48
-
{ modifier = "rwm"; node = "/dev/fuse"; }
57
57
+
{
58
58
+
modifier = "rwm";
59
59
+
node = "/dev/fuse";
60
60
+
}
49
61
];
50
62
autoStart = false;
51
63
enableTun = true;
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
let
3
3
4
4
cname = "green";
5
5
6
6
-
in {
6
6
+
in
7
7
+
{
7
8
imports = [
8
9
<stockholm/lass/2configs/container-networking.nix>
9
10
<stockholm/lass/2configs/syncthing.nix>
···
12
13
programs.fuse.userAllowOther = true;
13
14
14
15
services.syncthing.declarative.folders."/var/lib/sync-containers/${cname}/ecryptfs" = {
15
15
-
devices = [ "icarus" "skynet" "littleT" "shodan" "mors" "morpheus" ];
16
16
+
devices = [
17
17
+
"icarus"
18
18
+
"skynet"
19
19
+
"littleT"
20
20
+
"shodan"
21
21
+
"mors"
22
22
+
"morpheus"
23
23
+
];
16
24
ignorePerms = false;
17
25
};
18
26
···
25
33
26
34
systemd.services."container@${cname}".reloadIfChanged = mkForce false;
27
35
containers.${cname} = {
28
28
-
config = { ... }: {
29
29
-
environment.systemPackages = [
30
30
-
pkgs.git
31
31
-
pkgs.rxvt-unicode-unwrapped.terminfo
32
32
-
];
33
33
-
services.openssh.enable = true;
34
34
-
users.users.root.openssh.authorizedKeys.keys = [
35
35
-
config.krebs.users.lass.pubkey
36
36
-
];
37
37
-
system.activationScripts.fuse = {
38
38
-
text = ''
39
39
-
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
40
40
-
'';
41
41
-
deps = [];
36
36
+
config =
37
37
+
{ ... }:
38
38
+
{
39
39
+
environment.systemPackages = [
40
40
+
pkgs.git
41
41
+
pkgs.rxvt-unicode-unwrapped.terminfo
42
42
+
];
43
43
+
services.openssh.enable = true;
44
44
+
users.users.root.openssh.authorizedKeys.keys = [
45
45
+
config.krebs.users.lass.pubkey
46
46
+
];
47
47
+
system.activationScripts.fuse = {
48
48
+
text = ''
49
49
+
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
50
50
+
'';
51
51
+
deps = [ ];
52
52
+
};
42
53
};
43
43
-
};
44
54
allowedDevices = [
45
45
-
{ modifier = "rwm"; node = "/dev/fuse"; }
55
55
+
{
56
56
+
modifier = "rwm";
57
57
+
node = "/dev/fuse";
58
58
+
}
46
59
];
47
60
autoStart = false;
48
61
enableTun = true;
···
93
106
'')
94
107
];
95
108
}
96
96
-
···
1
1
# this seems to work, sadly there are no inotify events on the state directory because bindfs hides them,
2
2
3
3
-
{ config, lib, pkgs, ... }:
3
3
+
{ config, pkgs, ... }:
4
4
5
5
let
6
6
7
7
cname = "green-plain";
8
8
9
9
-
in {
9
9
+
in
10
10
+
{
10
11
imports = [
11
12
<stockholm/lass/2configs/container-networking.nix>
12
13
<stockholm/lass/2configs/syncthing.nix>
···
15
16
programs.fuse.userAllowOther = true;
16
17
17
18
services.syncthing.declarative.folders."/var/lib/containers/${cname}/var/state" = {
18
18
-
devices = [ "icarus" "skynet" "littleT" "shodan" "mors" "morpheus" ];
19
19
+
devices = [
20
20
+
"icarus"
21
21
+
"skynet"
22
22
+
"littleT"
23
23
+
"shodan"
24
24
+
"mors"
25
25
+
"morpheus"
26
26
+
];
19
27
ignorePerms = false;
20
28
};
21
29
···
26
34
];
27
35
};
28
36
29
29
-
30
37
systemd.services."container@${cname}".reloadIfChanged = mkForce false;
31
38
containers.${cname} = {
32
32
-
config = { ... }: {
33
33
-
environment.systemPackages = [
34
34
-
pkgs.git
35
35
-
pkgs.rxvt-unicode-unwrapped.terminfo
36
36
-
];
37
37
-
services.openssh.enable = true;
38
38
-
users.users.root.openssh.authorizedKeys.keys = [
39
39
-
config.krebs.users.lass.pubkey
40
40
-
];
41
41
-
system.activationScripts.fuse = {
42
42
-
text = ''
43
43
-
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
44
44
-
'';
45
45
-
deps = [];
39
39
+
config =
40
40
+
{ ... }:
41
41
+
{
42
42
+
environment.systemPackages = [
43
43
+
pkgs.git
44
44
+
pkgs.rxvt-unicode-unwrapped.terminfo
45
45
+
];
46
46
+
services.openssh.enable = true;
47
47
+
users.users.root.openssh.authorizedKeys.keys = [
48
48
+
config.krebs.users.lass.pubkey
49
49
+
];
50
50
+
system.activationScripts.fuse = {
51
51
+
text = ''
52
52
+
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
53
53
+
'';
54
54
+
deps = [ ];
55
55
+
};
46
56
};
47
47
-
};
48
57
allowedDevices = [
49
49
-
{ modifier = "rwm"; node = "/dev/fuse"; }
58
58
+
{
59
59
+
modifier = "rwm";
60
60
+
node = "/dev/fuse";
61
61
+
}
50
62
];
51
63
autoStart = false;
52
64
enableTun = true;
···
86
98
'')
87
99
];
88
100
}
89
89
-
···
1
1
# this seems to work fine, downsides are, all state is owned by syncthing and could be read by the guests syncthing
2
2
3
3
-
4
4
-
{ config, lib, pkgs, ... }:
3
3
+
{ config, pkgs, ... }:
5
4
6
5
let
7
6
8
7
cname = "green-plain";
9
8
10
10
-
in {
9
9
+
in
10
10
+
{
11
11
imports = [
12
12
<stockholm/lass/2configs/container-networking.nix>
13
13
<stockholm/lass/2configs/syncthing.nix>
14
14
];
15
15
16
16
services.syncthing.declarative.folders."/var/lib/containers/${cname}/var/state" = {
17
17
-
devices = [ "icarus" "skynet" "littleT" "shodan" "mors" "morpheus" ];
17
17
+
devices = [
18
18
+
"icarus"
19
19
+
"skynet"
20
20
+
"littleT"
21
21
+
"shodan"
22
22
+
"mors"
23
23
+
"morpheus"
24
24
+
];
18
25
ignorePerms = false;
19
26
};
20
27
···
27
34
28
35
systemd.services."container@${cname}".reloadIfChanged = mkForce false;
29
36
containers.${cname} = {
30
30
-
config = { ... }: {
31
31
-
environment.systemPackages = [
32
32
-
pkgs.git
33
33
-
pkgs.rxvt-unicode-unwrapped.terminfo
34
34
-
];
35
35
-
services.openssh.enable = true;
36
36
-
users.users.root.openssh.authorizedKeys.keys = [
37
37
-
config.krebs.users.lass.pubkey
38
38
-
];
39
39
-
system.activationScripts.fuse = {
40
40
-
text = ''
41
41
-
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
42
42
-
'';
43
43
-
deps = [];
37
37
+
config =
38
38
+
{ ... }:
39
39
+
{
40
40
+
environment.systemPackages = [
41
41
+
pkgs.git
42
42
+
pkgs.rxvt-unicode-unwrapped.terminfo
43
43
+
];
44
44
+
services.openssh.enable = true;
45
45
+
users.users.root.openssh.authorizedKeys.keys = [
46
46
+
config.krebs.users.lass.pubkey
47
47
+
];
48
48
+
system.activationScripts.fuse = {
49
49
+
text = ''
50
50
+
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
51
51
+
'';
52
52
+
deps = [ ];
53
53
+
};
44
54
};
45
45
-
};
46
55
allowedDevices = [
47
47
-
{ modifier = "rwm"; node = "/dev/fuse"; }
56
56
+
{
57
57
+
modifier = "rwm";
58
58
+
node = "/dev/fuse";
59
59
+
}
48
60
];
49
61
autoStart = false;
50
62
enableTun = true;
···
84
96
'')
85
97
];
86
98
}
87
87
-
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
let
3
3
4
4
cname = "green-plain";
5
5
6
6
-
in {
6
6
+
in
7
7
+
{
7
8
imports = [
8
9
<stockholm/lass/2configs/container-networking.nix>
9
10
<stockholm/lass/2configs/syncthing.nix>
···
12
13
programs.fuse.userAllowOther = true;
13
14
14
15
services.syncthing.declarative.folders."/var/lib/containers/${cname}/var/state" = {
15
15
-
devices = [ "icarus" "skynet" "littleT" "shodan" "mors" "morpheus" ];
16
16
+
devices = [
17
17
+
"icarus"
18
18
+
"skynet"
19
19
+
"littleT"
20
20
+
"shodan"
21
21
+
"mors"
22
22
+
"morpheus"
23
23
+
];
16
24
ignorePerms = false;
17
25
};
18
26
···
25
33
26
34
systemd.services."container@${cname}".reloadIfChanged = mkForce false;
27
35
containers.${cname} = {
28
28
-
config = { ... }: {
29
29
-
environment.systemPackages = [
30
30
-
pkgs.git
31
31
-
pkgs.rxvt-unicode-unwrapped.terminfo
32
32
-
];
33
33
-
services.openssh.enable = true;
34
34
-
users.users.root.openssh.authorizedKeys.keys = [
35
35
-
config.krebs.users.lass.pubkey
36
36
-
];
37
37
-
system.activationScripts.fuse = {
38
38
-
text = ''
39
39
-
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
40
40
-
'';
41
41
-
deps = [];
36
36
+
config =
37
37
+
{ ... }:
38
38
+
{
39
39
+
environment.systemPackages = [
40
40
+
pkgs.git
41
41
+
pkgs.rxvt-unicode-unwrapped.terminfo
42
42
+
];
43
43
+
services.openssh.enable = true;
44
44
+
users.users.root.openssh.authorizedKeys.keys = [
45
45
+
config.krebs.users.lass.pubkey
46
46
+
];
47
47
+
system.activationScripts.fuse = {
48
48
+
text = ''
49
49
+
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
50
50
+
'';
51
51
+
deps = [ ];
52
52
+
};
42
53
};
43
43
-
};
44
54
allowedDevices = [
45
45
-
{ modifier = "rwm"; node = "/dev/fuse"; }
55
55
+
{
56
56
+
modifier = "rwm";
57
57
+
node = "/dev/fuse";
58
58
+
}
46
59
];
47
60
autoStart = false;
48
61
enableTun = true;
···
82
95
'')
83
96
];
84
97
}
85
85
-
···
1
1
# broken, muchsync cant sync into the folders which should be handles by bindfs
2
2
# ls -la also does not show the full directory permissions
3
3
-
{ config, lib, pkgs, ... }:
3
3
+
{ config, pkgs, ... }:
4
4
let
5
5
6
6
cname = "green";
7
7
8
8
-
in {
8
8
+
in
9
9
+
{
9
10
imports = [
10
11
<stockholm/lass/2configs/container-networking.nix>
11
12
<stockholm/lass/2configs/syncthing.nix>
···
14
15
programs.fuse.userAllowOther = true;
15
16
16
17
services.syncthing.declarative.folders."/var/lib/sync-containers/${cname}/securefs" = {
17
17
-
devices = [ "icarus" "skynet" "littleT" "shodan" "mors" "morpheus" ];
18
18
+
devices = [
19
19
+
"icarus"
20
20
+
"skynet"
21
21
+
"littleT"
22
22
+
"shodan"
23
23
+
"mors"
24
24
+
"morpheus"
25
25
+
];
18
26
ignorePerms = false;
19
27
};
20
28
···
27
35
28
36
systemd.services."container@${cname}".reloadIfChanged = mkForce false;
29
37
containers.${cname} = {
30
30
-
config = { ... }: {
31
31
-
environment.systemPackages = [
32
32
-
pkgs.git
33
33
-
pkgs.rxvt-unicode-unwrapped.terminfo
34
34
-
];
35
35
-
services.openssh.enable = true;
36
36
-
users.users.root.openssh.authorizedKeys.keys = [
37
37
-
config.krebs.users.lass.pubkey
38
38
-
];
39
39
-
system.activationScripts.fuse = {
40
40
-
text = ''
41
41
-
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
42
42
-
'';
43
43
-
deps = [];
38
38
+
config =
39
39
+
{ ... }:
40
40
+
{
41
41
+
environment.systemPackages = [
42
42
+
pkgs.git
43
43
+
pkgs.rxvt-unicode-unwrapped.terminfo
44
44
+
];
45
45
+
services.openssh.enable = true;
46
46
+
users.users.root.openssh.authorizedKeys.keys = [
47
47
+
config.krebs.users.lass.pubkey
48
48
+
];
49
49
+
system.activationScripts.fuse = {
50
50
+
text = ''
51
51
+
${pkgs.coreutils}/bin/mknod /dev/fuse c 10 229
52
52
+
'';
53
53
+
deps = [ ];
54
54
+
};
44
55
};
45
45
-
};
46
56
allowedDevices = [
47
47
-
{ modifier = "rwm"; node = "/dev/fuse"; }
57
57
+
{
58
58
+
modifier = "rwm";
59
59
+
node = "/dev/fuse";
60
60
+
}
48
61
];
49
62
autoStart = false;
50
63
enableTun = true;
···
96
109
'')
97
110
];
98
111
}
99
99
-
···
5
5
];
6
6
7
7
krebs.iptables.tables.filter.INPUT.rules = [
8
8
-
{ predicate = "-i int0 -p tcp --dport 1883"; target = "ACCEPT"; } # mosquitto
9
9
-
{ predicate = "-i docker0 -p tcp --dport 1883"; target = "ACCEPT"; } # mosquitto
10
10
-
{ predicate = "-i int0 -p tcp --dport 8123"; target = "ACCEPT"; } # hass
11
11
-
{ predicate = "-i int0 -p tcp --dport 1337"; target = "ACCEPT"; } # zigbee2mqtt frontend
12
12
-
{ predicate = "-i retiolum -p tcp --dport 8123"; target = "ACCEPT"; } # hass
13
13
-
{ predicate = "-i retiolum -p tcp --dport 1337"; target = "ACCEPT"; } # zigbee2mqtt frontend
14
14
-
{ predicate = "-i wiregrill -p tcp --dport 8123"; target = "ACCEPT"; } # hass
15
15
-
{ predicate = "-i zttzibeakb -p tcp --dport 8123"; target = "ACCEPT"; } # hass
8
8
+
{
9
9
+
predicate = "-i int0 -p tcp --dport 1883";
10
10
+
target = "ACCEPT";
11
11
+
} # mosquitto
12
12
+
{
13
13
+
predicate = "-i docker0 -p tcp --dport 1883";
14
14
+
target = "ACCEPT";
15
15
+
} # mosquitto
16
16
+
{
17
17
+
predicate = "-i int0 -p tcp --dport 8123";
18
18
+
target = "ACCEPT";
19
19
+
} # hass
20
20
+
{
21
21
+
predicate = "-i int0 -p tcp --dport 1337";
22
22
+
target = "ACCEPT";
23
23
+
} # zigbee2mqtt frontend
24
24
+
{
25
25
+
predicate = "-i retiolum -p tcp --dport 8123";
26
26
+
target = "ACCEPT";
27
27
+
} # hass
28
28
+
{
29
29
+
predicate = "-i retiolum -p tcp --dport 1337";
30
30
+
target = "ACCEPT";
31
31
+
} # zigbee2mqtt frontend
32
32
+
{
33
33
+
predicate = "-i wiregrill -p tcp --dport 8123";
34
34
+
target = "ACCEPT";
35
35
+
} # hass
36
36
+
{
37
37
+
predicate = "-i zttzibeakb -p tcp --dport 8123";
38
38
+
target = "ACCEPT";
39
39
+
} # hass
16
40
];
17
41
18
42
systemd.services.hass-update = {
···
30
54
volumes = [ "home-assistant:/config" ];
31
55
environment.TZ = "Europe/Berlin";
32
56
image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated
33
33
-
extraOptions = [
34
34
-
"--network=host"
57
57
+
extraOptions = [
58
58
+
"--network=host"
35
59
];
36
60
};
37
61
};
38
62
39
63
services.mosquitto = {
40
64
enable = true;
41
41
-
listeners = [{
42
42
-
acl = [ ];
43
43
-
users.gg23 = { acl = [ "readwrite #" ]; password = "gg23-mqtt"; };
44
44
-
}];
65
65
+
listeners = [
66
66
+
{
67
67
+
acl = [ ];
68
68
+
users.gg23 = {
69
69
+
acl = [ "readwrite #" ];
70
70
+
password = "gg23-mqtt";
71
71
+
};
72
72
+
}
73
73
+
];
45
74
};
46
75
47
76
environment.systemPackages = [ pkgs.mosquitto ];
···
75
75
# button https://www.zigbee2mqtt.io/devices/8718699693985.html#philips-8718699693985
76
76
"0x0017880108016e3e".friendly_name = "going_out_button";
77
77
78
78
-
79
78
# rotation https://www.zigbee2mqtt.io/devices/E1744.html
80
79
"0x8cf681fffe065493" = {
81
80
friendly_name = "r_test";
···
90
89
};
91
90
};
92
91
}
93
93
-
···
6
6
text = builtins.readFile ./brcmfmac4356-pcie.txt;
7
7
destination = "/lib/firmware/brcm/brcmfmac4356-pcie.txt";
8
8
};
9
9
-
in {
9
9
+
in
10
10
+
{
10
11
#imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
11
12
hardware.firmware = [ dummy_firmware ];
12
13
hardware.enableRedistributableFirmware = true;
13
14
14
14
-
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_acpi" "sdhci_pci" ];
15
15
+
boot.initrd.availableKernelModules = [
16
16
+
"xhci_pci"
17
17
+
"usbhid"
18
18
+
"usb_storage"
19
19
+
"sd_mod"
20
20
+
"sdhci_acpi"
21
21
+
"sdhci_pci"
22
22
+
];
15
23
boot.kernelPackages = pkgs.linuxPackages_4_14;
16
24
boot.kernelParams = [
17
25
"fbcon=rotate:1"
···
23
31
services.xserver.dpi = 200;
24
32
fonts.fontconfig.dpi = 200;
25
33
lass.fonts.regular = "xft:Hack-Regular:pixelsize=22,xft:Symbola";
26
26
-
lass.fonts.bold = "xft:Hack-Bold:pixelsize=22,xft:Symbola";
27
27
-
lass.fonts.italic = "xft:Hack-RegularOblique:pixelsize=22,xft:Symbol";
34
34
+
lass.fonts.bold = "xft:Hack-Bold:pixelsize=22,xft:Symbola";
35
35
+
lass.fonts.italic = "xft:Hack-RegularOblique:pixelsize=22,xft:Symbol";
28
36
}
···
1
1
-
{ self, config, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
(self.inputs.stockholm + "/krebs/2configs/hw/x220.nix")
···
6
11
7
12
boot = {
8
13
initrd.luks.devices.luksroot.device = "/dev/sda3";
9
9
-
initrd.availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ];
14
14
+
initrd.availableKernelModules = [
15
15
+
"xhci_hcd"
16
16
+
"ehci_pci"
17
17
+
"ahci"
18
18
+
"usb_storage"
19
19
+
];
10
20
extraModulePackages = [
11
21
config.boot.kernelPackages.tp_smapi
12
22
config.boot.kernelPackages.acpi_call
···
25
35
"/" = {
26
36
device = "/dev/mapper/pool-root";
27
37
fsType = "btrfs";
28
28
-
options = ["defaults" "noatime" "ssd" "compress=lzo"];
38
38
+
options = [
39
39
+
"defaults"
40
40
+
"noatime"
41
41
+
"ssd"
42
42
+
"compress=lzo"
43
43
+
];
29
44
};
30
45
"/boot" = {
31
46
device = "/dev/sda2";
···
33
48
"/home" = {
34
49
device = "/dev/mapper/pool-home";
35
50
fsType = "btrfs";
36
36
-
options = ["defaults" "noatime" "ssd" "compress=lzo"];
51
51
+
options = [
52
52
+
"defaults"
53
53
+
"noatime"
54
54
+
"ssd"
55
55
+
"compress=lzo"
56
56
+
];
37
57
};
38
58
};
39
59
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
security.acme.certs."mail.lassul.us" = {
4
4
group = "lasscert";
···
12
12
clanCore.facts.services."lassul.us-dkim" = {
13
13
secret."lassul.us.dkim.priv" = { };
14
14
public."lassul.us.dkim.pub" = { };
15
15
-
generator.path = with pkgs; [ coreutils openssl ];
15
15
+
generator.path = with pkgs; [
16
16
+
coreutils
17
17
+
openssl
18
18
+
];
16
19
generator.script = ''
17
20
openssl genrsa -out "$secrets"/lassul.us.dkim.priv 2048
18
21
openssl rsa -in "$secrets"/lassul.us.dkim.priv -pubout -outform der 2>/dev/null | openssl base64 -A > "$facts"/lassul.us.dkim.pub
···
1
1
-
{ config, lib, pkgs, ... }:
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
-
{ predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; } # nginx
7
7
+
{
8
8
+
predicate = "-i retiolum -p tcp --dport 80";
9
9
+
target = "ACCEPT";
10
10
+
} # nginx
8
11
# { predicate = "-i retiolum -p tcp --dport 3012"; target = "ACCEPT"; } # grafana
9
12
# { predicate = "-i retiolum -p tcp --dport 9093"; target = "ACCEPT"; } # alertmanager
10
13
# { predicate = "-i retiolum -p tcp --dport 9223"; target = "ACCEPT"; } # alertmanager
···
38
41
services.prometheus = {
39
42
enable = true;
40
43
ruleFiles = [
41
41
-
(pkgs.writeText "prometheus-rules.yml" (builtins.toJSON {
42
42
-
groups = [{
43
43
-
name = "alerting-rules";
44
44
-
rules = import ./alert-rules.nix { inherit lib; };
45
45
-
}];
46
46
-
}))
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
+
))
47
54
];
48
55
scrapeConfigs = [
49
56
{
···
62
69
}
63
70
];
64
71
alertmanagers = [
65
65
-
{ scheme = "http";
72
72
+
{
73
73
+
scheme = "http";
66
74
path_prefix = "/";
67
75
static_configs = [ { targets = [ "localhost:9093" ]; } ];
68
76
}
···
94
102
receivers = [
95
103
{
96
104
name = "all";
97
97
-
webhook_configs = [{
98
98
-
url = "http://127.0.0.1:9223/";
99
99
-
max_alerts = 5;
100
100
-
}];
105
105
+
webhook_configs = [
106
106
+
{
107
107
+
url = "http://127.0.0.1:9223/";
108
108
+
max_alerts = 5;
109
109
+
}
110
110
+
];
101
111
}
102
112
{
103
113
name = "default";
···
1
1
-
{ pkgs, lib, config, ... }:
1
1
+
{
2
2
+
pkgs,
3
3
+
lib,
4
4
+
config,
5
5
+
...
6
6
+
}:
2
7
# To use this module you also need to allow port 9273 either on the internet or on a vpn interface
3
8
# i.e. networking.firewall.interfaces."vpn0".allowedTCPPorts = [ 9273 ];
4
9
# Example prometheus alert rules:
5
10
# - https://github.com/Mic92/dotfiles/blob/master/nixos/eva/modules/prometheus/alert-rules.nix
6
11
let
7
7
-
isVM = lib.any (mod: mod == "xen-blkfront" || mod == "virtio_console") config.boot.initrd.kernelModules;
12
12
+
isVM = lib.any (
13
13
+
mod: mod == "xen-blkfront" || mod == "virtio_console"
14
14
+
) config.boot.initrd.kernelModules;
8
15
# potentially wrong if the nvme is not used at boot...
9
16
hasNvme = lib.any (m: m == "nvme") config.boot.initrd.availableKernelModules;
10
17
···
13
20
${pkgs.jq}/bin/jq -r 'map(.addr_info) | flatten(1) | map(select(.dadfailed == true)) | map(.local) | @text "ipv6_dad_failures count=\(length)i"'
14
21
'';
15
22
16
16
-
zfsChecks = lib.optional
17
17
-
(lib.any (fs: fs == "zfs") (lib.attrNames config.boot.supportedFilesystems))
18
18
-
(pkgs.writeScript "zpool-health" ''
19
19
-
#!${pkgs.gawk}/bin/awk -f
20
20
-
BEGIN {
21
21
-
while ("${pkgs.zfs}/bin/zpool status" | getline) {
22
22
-
if ($1 ~ /pool:/) { printf "zpool_status,name=%s ", $2 }
23
23
-
if ($1 ~ /state:/) { printf " state=\"%s\",", $2 }
24
24
-
if ($1 ~ /errors:/) {
25
25
-
if (index($2, "No")) printf "errors=0i\n"; else printf "errors=%di\n", $2
23
23
+
zfsChecks =
24
24
+
lib.optional (lib.any (fs: fs == "zfs") (lib.attrNames config.boot.supportedFilesystems))
25
25
+
(
26
26
+
pkgs.writeScript "zpool-health" ''
27
27
+
#!${pkgs.gawk}/bin/awk -f
28
28
+
BEGIN {
29
29
+
while ("${pkgs.zfs}/bin/zpool status" | getline) {
30
30
+
if ($1 ~ /pool:/) { printf "zpool_status,name=%s ", $2 }
31
31
+
if ($1 ~ /state:/) { printf " state=\"%s\",", $2 }
32
32
+
if ($1 ~ /errors:/) {
33
33
+
if (index($2, "No")) printf "errors=0i\n"; else printf "errors=%di\n", $2
34
34
+
}
35
35
+
}
26
36
}
27
27
-
}
28
28
-
}
29
29
-
'');
37
37
+
''
38
38
+
);
30
39
31
40
nfsChecks =
32
41
let
33
33
-
collectHosts = shares: fs:
34
34
-
if builtins.elem fs.fsType [ "nfs" "nfs3" "nfs4" ]
42
42
+
collectHosts =
43
43
+
shares: fs:
44
44
+
if
45
45
+
builtins.elem fs.fsType [
46
46
+
"nfs"
47
47
+
"nfs3"
48
48
+
"nfs4"
49
49
+
]
35
50
then
36
51
shares
37
52
// (
···
45
60
${host} = (shares.${host} or [ ]) ++ [ path ];
46
61
}
47
62
)
48
48
-
else shares;
63
63
+
else
64
64
+
shares;
49
65
nfsHosts = lib.foldl collectHosts { } (builtins.attrValues config.fileSystems);
50
66
in
51
51
-
lib.mapAttrsToList
52
52
-
(
53
53
-
host: args:
54
54
-
(pkgs.writeScript "nfs-health" ''
55
55
-
#!${pkgs.gawk}/bin/awk -f
56
56
-
BEGIN {
57
57
-
for (i = 2; i < ARGC; i++) {
58
58
-
mounts[ARGV[i]] = 1
59
59
-
}
60
60
-
while ("${pkgs.nfs-utils}/bin/showmount -e " ARGV[1] | getline) {
61
61
-
if (NR == 1) { continue }
62
62
-
if (mounts[$1] == 1) {
63
63
-
printf "nfs_export,host=%s,path=%s present=1\n", ARGV[1], $1
64
64
-
}
65
65
-
delete mounts[$1]
66
66
-
}
67
67
-
for (mount in mounts) {
68
68
-
printf "nfs_export,host=%s,path=%s present=0\n", ARGV[1], $1
69
69
-
}
67
67
+
lib.mapAttrsToList (
68
68
+
host: args:
69
69
+
(pkgs.writeScript "nfs-health" ''
70
70
+
#!${pkgs.gawk}/bin/awk -f
71
71
+
BEGIN {
72
72
+
for (i = 2; i < ARGC; i++) {
73
73
+
mounts[ARGV[i]] = 1
74
74
+
}
75
75
+
while ("${pkgs.nfs-utils}/bin/showmount -e " ARGV[1] | getline) {
76
76
+
if (NR == 1) { continue }
77
77
+
if (mounts[$1] == 1) {
78
78
+
printf "nfs_export,host=%s,path=%s present=1\n", ARGV[1], $1
70
79
}
71
71
-
'')
72
72
-
+ " ${host} ${builtins.concatStringsSep " " args}"
73
73
-
)
74
74
-
nfsHosts;
80
80
+
delete mounts[$1]
81
81
+
}
82
82
+
for (mount in mounts) {
83
83
+
printf "nfs_export,host=%s,path=%s present=0\n", ARGV[1], $1
84
84
+
}
85
85
+
}
86
86
+
'')
87
87
+
+ " ${host} ${builtins.concatStringsSep " " args}"
88
88
+
) nfsHosts;
75
89
76
90
in
77
91
{
···
82
96
enable = true;
83
97
extraConfig = {
84
98
agent.interval = "60s";
85
85
-
inputs = {
86
86
-
prometheus.urls = lib.mkIf config.services.promtail.enable [
87
87
-
# default promtail port
88
88
-
"http://localhost:9080/metrics"
89
89
-
];
90
90
-
prometheus.metric_version = 2;
91
91
-
kernel_vmstat = { };
92
92
-
nginx.urls = lib.mkIf config.services.nginx.statusPage [
93
93
-
"http://localhost/nginx_status"
94
94
-
];
95
95
-
smart = lib.mkIf (!isVM) {
96
96
-
path_smartctl = pkgs.writeShellScript "smartctl" ''
97
97
-
exec /run/wrappers/bin/sudo ${pkgs.smartmontools}/bin/smartctl "$@"
98
98
-
'';
99
99
-
};
100
100
-
system = { };
101
101
-
mem = { };
102
102
-
file =
103
103
-
[
104
104
-
{
105
105
-
data_format = "influx";
106
106
-
file_tag = "name";
107
107
-
files = [ "/var/log/telegraf/*" ];
108
108
-
}
109
109
-
]
110
110
-
++ lib.optional (lib.any (fs: fs == "ext4") (lib.attrNames config.boot.supportedFilesystems)) {
111
111
-
name_override = "ext4_errors";
112
112
-
files = [ "/sys/fs/ext4/*/errors_count" ];
113
113
-
data_format = "value";
99
99
+
inputs =
100
100
+
{
101
101
+
prometheus.urls = lib.mkIf config.services.promtail.enable [
102
102
+
# default promtail port
103
103
+
"http://localhost:9080/metrics"
104
104
+
];
105
105
+
prometheus.metric_version = 2;
106
106
+
kernel_vmstat = { };
107
107
+
nginx.urls = lib.mkIf config.services.nginx.statusPage [
108
108
+
"http://localhost/nginx_status"
109
109
+
];
110
110
+
smart = lib.mkIf (!isVM) {
111
111
+
path_smartctl = pkgs.writeShellScript "smartctl" ''
112
112
+
exec /run/wrappers/bin/sudo ${pkgs.smartmontools}/bin/smartctl "$@"
113
113
+
'';
114
114
};
115
115
-
exec = [
115
115
+
system = { };
116
116
+
mem = { };
117
117
+
file =
118
118
+
[
119
119
+
{
120
120
+
data_format = "influx";
121
121
+
file_tag = "name";
122
122
+
files = [ "/var/log/telegraf/*" ];
123
123
+
}
124
124
+
]
125
125
+
++ lib.optional (lib.any (fs: fs == "ext4") (lib.attrNames config.boot.supportedFilesystems)) {
126
126
+
name_override = "ext4_errors";
127
127
+
files = [ "/sys/fs/ext4/*/errors_count" ];
128
128
+
data_format = "value";
129
129
+
};
130
130
+
exec = [
131
131
+
{
132
132
+
## Commands array
133
133
+
commands = [ ipv6DadCheck ] ++ zfsChecks ++ nfsChecks;
134
134
+
data_format = "influx";
135
135
+
}
136
136
+
];
137
137
+
systemd_units = { };
138
138
+
swap = { };
139
139
+
disk.tagdrop = {
140
140
+
fstype = [
141
141
+
"tmpfs"
142
142
+
"ramfs"
143
143
+
"devtmpfs"
144
144
+
"devfs"
145
145
+
"iso9660"
146
146
+
"overlay"
147
147
+
"aufs"
148
148
+
"squashfs"
149
149
+
];
150
150
+
device = [
151
151
+
"rpc_pipefs"
152
152
+
"lxcfs"
153
153
+
"nsfs"
154
154
+
"borgfs"
155
155
+
];
156
156
+
};
157
157
+
diskio = { };
158
158
+
zfs = {
159
159
+
poolMetrics = true;
160
160
+
};
161
161
+
}
162
162
+
// lib.optionalAttrs
163
163
+
(
164
164
+
if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then
165
165
+
config.boot.swraid.enable
166
166
+
else
167
167
+
config.boot.initrd.services.swraid.enable
168
168
+
)
116
169
{
117
117
-
## Commands array
118
118
-
commands =
119
119
-
[ ipv6DadCheck ]
120
120
-
++ zfsChecks
121
121
-
++ nfsChecks;
122
122
-
data_format = "influx";
123
123
-
}
124
124
-
];
125
125
-
systemd_units = { };
126
126
-
swap = { };
127
127
-
disk.tagdrop = {
128
128
-
fstype = [ "tmpfs" "ramfs" "devtmpfs" "devfs" "iso9660" "overlay" "aufs" "squashfs" ];
129
129
-
device = [ "rpc_pipefs" "lxcfs" "nsfs" "borgfs" ];
130
130
-
};
131
131
-
diskio = { };
132
132
-
zfs = {
133
133
-
poolMetrics = true;
134
134
-
};
135
135
-
} // lib.optionalAttrs (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then config.boot.swraid.enable else config.boot.initrd.services.swraid.enable) {
136
136
-
mdstat = { };
137
137
-
};
170
170
+
mdstat = { };
171
171
+
};
138
172
outputs.prometheus_client = {
139
173
listen = ":9273";
140
174
metric_version = 2;
···
1
1
-
{ pkgs, ... }: {
1
1
+
{ pkgs, ... }:
2
2
+
{
2
3
3
4
# usage: pppd call stick
4
5
···
30
31
];
31
32
32
33
}
33
33
-
···
1
1
-
{ pkgs, ... }: {
1
1
+
{ pkgs, ... }:
2
2
+
{
2
3
3
4
# usage: pppd call x220
4
5
···
1
1
-
{ config, lib, ... }:
1
1
+
{ ... }:
2
2
3
3
{
4
4
services.nginx = {
···
17
17
};
18
18
};
19
19
}
20
20
-
···
1
1
-
{ self, config, pkgs, lib, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
lib,
6
6
+
...
7
7
+
}:
2
8
3
9
let
4
10
5
11
inherit (self.inputs.stockholm.lib)
6
12
genid_uint31
7
7
-
;
8
8
-
inherit (import ./util.nix {inherit lib pkgs;})
13
13
+
;
14
14
+
inherit (import ./util.nix { inherit lib pkgs; })
9
15
servePage
10
16
serveOwncloud
11
11
-
serveWordpress;
17
17
+
serveWordpress
18
18
+
;
12
19
13
20
msmtprc = pkgs.writeText "msmtprc" ''
14
21
account localhost
···
20
27
exec ${pkgs.msmtp}/bin/msmtp --read-envelope-from -C ${msmtprc} "$@"
21
28
'';
22
29
23
23
-
in {
30
30
+
in
31
31
+
{
24
32
imports = [
25
33
self.inputs.stockholm.nixosModules.acl
26
34
self.inputs.stockholm.nixosModules.on-failure
27
35
./default.nix
28
36
./sqlBackup.nix
29
29
-
(servePage [ "aldonasiech.com" "www.aldonasiech.com" ])
30
30
-
(servePage [ "apanowicz.de" "www.apanowicz.de" ])
31
31
-
(servePage [ "reich-gebaeudereinigung.de" "www.reich-gebaeudereinigung.de" ])
32
32
-
(servePage [ "illustra.de" "www.illustra.de" ])
33
33
-
(servePage [ "event-extra.de" "www.event-extra.de" ])
37
37
+
(servePage [
38
38
+
"aldonasiech.com"
39
39
+
"www.aldonasiech.com"
40
40
+
])
41
41
+
(servePage [
42
42
+
"apanowicz.de"
43
43
+
"www.apanowicz.de"
44
44
+
])
45
45
+
(servePage [
46
46
+
"reich-gebaeudereinigung.de"
47
47
+
"www.reich-gebaeudereinigung.de"
48
48
+
])
49
49
+
(servePage [
50
50
+
"illustra.de"
51
51
+
"www.illustra.de"
52
52
+
])
53
53
+
(servePage [
54
54
+
"event-extra.de"
55
55
+
"www.event-extra.de"
56
56
+
])
34
57
# (servePage [ "nirwanabluete.de" "www.nirwanabluete.de" ])
35
35
-
(servePage [ "familienrat-hamburg.de" "www.familienrat-hamburg.de" ])
58
58
+
(servePage [
59
59
+
"familienrat-hamburg.de"
60
60
+
"www.familienrat-hamburg.de"
61
61
+
])
36
62
(servePage [ "karlaskop.de" ])
37
63
(servePage [
38
64
"freemonkey.art"
···
75
101
# https://github.com/nextcloud/server/issues/25436
76
102
services.mysql.settings.mysqld.innodb_read_only_compressed = 0;
77
103
78
78
-
services.mysql.ensureDatabases = [ "ubikmedia_de" "o_ubikmedia_de" ];
104
104
+
services.mysql.ensureDatabases = [
105
105
+
"ubikmedia_de"
106
106
+
"o_ubikmedia_de"
107
107
+
];
79
108
services.mysql.ensureUsers = [
80
80
-
{ ensurePermissions = { "ubikmedia_de.*" = "ALL"; }; name = "nginx"; }
81
81
-
{ ensurePermissions = { "o_ubikmedia_de.*" = "ALL"; }; name = "nginx"; }
109
109
+
{
110
110
+
ensurePermissions = {
111
111
+
"ubikmedia_de.*" = "ALL";
112
112
+
};
113
113
+
name = "nginx";
114
114
+
}
115
115
+
{
116
116
+
ensurePermissions = {
117
117
+
"o_ubikmedia_de.*" = "ALL";
118
118
+
};
119
119
+
name = "nginx";
120
120
+
}
82
121
];
83
122
84
123
services.nginx.virtualHosts."ubikmedia.de".locations."/piwika".extraConfig = ''
···
153
192
sslServerKey = "/var/lib/acme/lassul.us/key.pem";
154
193
};
155
194
krebs.iptables.tables.filter.INPUT.rules = [
156
156
-
{ predicate = "-p tcp --dport pop3s"; target = "ACCEPT"; }
157
157
-
{ predicate = "-p tcp --dport imaps"; target = "ACCEPT"; }
195
195
+
{
196
196
+
predicate = "-p tcp --dport pop3s";
197
197
+
target = "ACCEPT";
198
198
+
}
199
199
+
{
200
200
+
predicate = "-p tcp --dport imaps";
201
201
+
target = "ACCEPT";
202
202
+
}
158
203
];
159
204
160
205
environment.systemPackages = [
···
182
227
# server_condition = ''${run{/run/current-system/sw/bin/debug_exim ${config.lass.usershadow.pattern} $auth1 $auth2}{yes}{no}}
183
228
'';
184
229
internet-aliases = [
185
185
-
{ from = "dma@ubikmedia.de"; to = "domsen"; }
186
186
-
{ from = "dma@ubikmedia.eu"; to = "domsen"; }
187
187
-
{ from = "mail@habsys.de"; to = "domsen"; }
188
188
-
{ from = "mail@habsys.eu"; to = "domsen"; }
189
189
-
{ from = "hallo@apanowicz.de"; to = "domsen"; }
190
190
-
{ from = "bruno@apanowicz.de"; to = "bruno"; }
191
191
-
{ from = "mail@jla-trading.com"; to = "jla-trading"; }
192
192
-
{ from = "jms@ubikmedia.eu"; to = "jms"; }
193
193
-
{ from = "ms@ubikmedia.eu"; to = "ms"; }
194
194
-
{ from = "ubik@ubikmedia.eu"; to = "domsen, jms, ms"; }
195
195
-
{ from = "kontakt@alewis.de"; to ="klabusterbeere"; }
196
196
-
{ from = "hallo@jarugadesign.de"; to ="kasia"; }
197
197
-
{ from = "noreply@beeshmooth.ch"; to ="besmooth@gmx.ch"; }
230
230
+
{
231
231
+
from = "dma@ubikmedia.de";
232
232
+
to = "domsen";
233
233
+
}
234
234
+
{
235
235
+
from = "dma@ubikmedia.eu";
236
236
+
to = "domsen";
237
237
+
}
238
238
+
{
239
239
+
from = "mail@habsys.de";
240
240
+
to = "domsen";
241
241
+
}
242
242
+
{
243
243
+
from = "mail@habsys.eu";
244
244
+
to = "domsen";
245
245
+
}
246
246
+
{
247
247
+
from = "hallo@apanowicz.de";
248
248
+
to = "domsen";
249
249
+
}
250
250
+
{
251
251
+
from = "bruno@apanowicz.de";
252
252
+
to = "bruno";
253
253
+
}
254
254
+
{
255
255
+
from = "mail@jla-trading.com";
256
256
+
to = "jla-trading";
257
257
+
}
258
258
+
{
259
259
+
from = "jms@ubikmedia.eu";
260
260
+
to = "jms";
261
261
+
}
262
262
+
{
263
263
+
from = "ms@ubikmedia.eu";
264
264
+
to = "ms";
265
265
+
}
266
266
+
{
267
267
+
from = "ubik@ubikmedia.eu";
268
268
+
to = "domsen, jms, ms";
269
269
+
}
270
270
+
{
271
271
+
from = "kontakt@alewis.de";
272
272
+
to = "klabusterbeere";
273
273
+
}
274
274
+
{
275
275
+
from = "hallo@jarugadesign.de";
276
276
+
to = "kasia";
277
277
+
}
278
278
+
{
279
279
+
from = "noreply@beeshmooth.ch";
280
280
+
to = "besmooth@gmx.ch";
281
281
+
}
198
282
199
199
-
{ from = "testuser@lassul.us"; to = "testuser"; }
200
200
-
{ from = "testuser@ubikmedia.eu"; to = "testuser"; }
283
283
+
{
284
284
+
from = "testuser@lassul.us";
285
285
+
to = "testuser";
286
286
+
}
287
287
+
{
288
288
+
from = "testuser@ubikmedia.eu";
289
289
+
to = "testuser";
290
290
+
}
201
291
];
202
292
sender_domains = [
203
293
"jla-trading.com"
···
218
308
clanCore.facts.services."ubikmedia.eu-dkim" = {
219
309
secret."ubikmedia.eu.dkim.priv" = { };
220
310
public."ubikmedia.eu.dkim.pub" = { };
221
221
-
generator.path = with pkgs; [ coreutils openssl ];
311
311
+
generator.path = with pkgs; [
312
312
+
coreutils
313
313
+
openssl
314
314
+
];
222
315
generator.script = ''
223
223
-
openssl genrsa -out "$secrets"/ubikmedia.eu.dkim.priv 2048
316
316
+
openssl genrsa -out "$secrets"/ubikmedia.eu.dkim.priv 1024
224
317
openssl rsa -in "$secrets"/ubikmedia.eu.dkim.priv -pubout -outform der 2>/dev/null | openssl base64 -A > "$facts"/ubikmedia.eu.dkim.pub
225
318
'';
226
319
};
227
320
clanCore.facts.services."apanowicz.de-dkim" = {
228
321
secret."apanowicz.de.dkim.priv" = { };
229
322
public."apanowicz.de.dkim.pub" = { };
230
230
-
generator.path = with pkgs; [ coreutils openssl ];
323
323
+
generator.path = with pkgs; [
324
324
+
coreutils
325
325
+
openssl
326
326
+
];
231
327
generator.script = ''
232
232
-
openssl genrsa -out "$secrets"/apanowicz.de.dkim.priv 2048
328
328
+
openssl genrsa -out "$secrets"/apanowicz.de.dkim.priv 1024
233
329
openssl rsa -in "$secrets"/apanowicz.de.dkim.priv -pubout -outform der 2>/dev/null | openssl base64 -A > "$facts"/apanowicz.de.dkim.pub
234
330
'';
235
331
};
236
332
clanCore.facts.services."beesmooth.ch-dkim" = {
237
333
secret."beesmooth.ch.dkim.priv" = { };
238
334
public."beesmooth.ch.dkim.pub" = { };
239
239
-
generator.path = with pkgs; [ coreutils openssl ];
335
335
+
generator.path = with pkgs; [
336
336
+
coreutils
337
337
+
openssl
338
338
+
];
240
339
generator.script = ''
241
241
-
openssl genrsa -out "$secrets"/beesmooth.ch.dkim.priv 2048
340
340
+
openssl genrsa -out "$secrets"/beesmooth.ch.dkim.priv 1024
341
341
+
openssl rsa -in "$secrets"/beesmooth.ch.dkim.priv -pubout -outform der 2>/dev/null | openssl base64 -A > "$facts"/beesmooth.ch.dkim.pub
342
342
+
'';
343
343
+
};
344
344
+
clanCore.facts.services."freemonkey.art" = {
345
345
+
secret."beesmooth.ch.dkim.priv" = { };
346
346
+
public."beesmooth.ch.dkim.pub" = { };
347
347
+
generator.path = with pkgs; [
348
348
+
coreutils
349
349
+
openssl
350
350
+
];
351
351
+
generator.script = ''
352
352
+
openssl genrsa -out "$secrets"/beesmooth.ch.dkim.priv 1024
242
353
openssl rsa -in "$secrets"/beesmooth.ch.dkim.priv -pubout -outform der 2>/dev/null | openssl base64 -A > "$facts"/beesmooth.ch.dkim.pub
243
354
'';
244
355
};
···
283
394
description = "maintenance acc for domsen";
284
395
home = "/home/domsen";
285
396
useDefaultShell = true;
286
286
-
extraGroups = [ "syncthing" "download" "xanf" ];
397
397
+
extraGroups = [
398
398
+
"syncthing"
399
399
+
"download"
400
400
+
"xanf"
401
401
+
];
287
402
createHome = true;
288
403
isNormalUser = true;
289
404
};
···
437
552
createHome = true;
438
553
isNormalUser = true;
439
554
};
440
440
-
krebs.acl."/srv/http/familienrat-hamburg.de"."u:familienrat:rwX" = {};
555
555
+
556
556
+
users.users.pr = {
557
557
+
uid = genid_uint31 "pr";
558
558
+
home = "/home/pr";
559
559
+
useDefaultShell = true;
560
560
+
createHome = true;
561
561
+
isNormalUser = true;
562
562
+
};
563
563
+
564
564
+
krebs.acl."/srv/http/familienrat-hamburg.de"."u:familienrat:rwX" = { };
441
565
krebs.acl."/srv/http"."u:familienrat:X" = {
442
566
default = false;
443
567
recursive = false;
444
568
};
445
569
446
446
-
users.groups.xanf = {};
570
570
+
users.groups.xanf = { };
447
571
448
572
krebs.on-failure.plans.restic-backups-domsen = {
449
573
journalctl = {
···
455
579
initialize = true;
456
580
repository = "/backups/domsen";
457
581
passwordFile = "${config.krebs.secret.directory}/domsen_backup_pw";
458
458
-
timerConfig = { OnCalendar = "00:05"; RandomizedDelaySec = "5h"; };
582
582
+
timerConfig = {
583
583
+
OnCalendar = "00:05";
584
584
+
RandomizedDelaySec = "5h";
585
585
+
};
459
586
paths = [
460
587
"/home/domsen/Mail"
461
588
"/home/ms/Mail"
···
468
595
];
469
596
};
470
597
471
471
-
services.syncthing.settings.folders = {
472
472
-
domsen-backups = {
473
473
-
path = "/backups/domsen";
474
474
-
devices = [ "domsen-backup" ];
475
475
-
};
476
476
-
domsen-backup-srv-http = {
477
477
-
path = "/srv/http";
478
478
-
devices = [ "domsen-backup" ];
479
479
-
};
480
480
-
};
598
598
+
# services.syncthing.settings.folders = {
599
599
+
# domsen-backups = {
600
600
+
# path = "/backups/domsen";
601
601
+
# devices = [ "domsen-backup" ];
602
602
+
# };
603
603
+
# domsen-backup-srv-http = {
604
604
+
# path = "/srv/http";
605
605
+
# devices = [ "domsen-backup" ];
606
606
+
# };
607
607
+
# };
481
608
482
609
system.activationScripts.domsen-backups = ''
483
610
${pkgs.coreutils}/bin/chmod 750 /backups
···
487
614
# krebs.acl."/srv/http"."u:syncthing:rwX" = {};
488
615
# krebs.acl."/srv/http"."u:nginx:rwX" = {};
489
616
# krebs.acl."/srv/http/ubikmedia.de"."u:avada:rwX" = {};
490
490
-
krebs.acl."/home/xanf/XANF_TEAM"."g:xanf:rwX" = {};
617
617
+
krebs.acl."/home/xanf/XANF_TEAM"."g:xanf:rwX" = { };
491
618
krebs.acl."/home/xanf"."g:xanf:X" = {
492
619
default = false;
493
620
recursive = false;
494
621
};
495
622
}
496
496
-
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
services.nginx.virtualHosts."flix.lassul.us" = {
4
4
forceSSL = true;
···
10
10
};
11
11
};
12
12
}
13
13
-
···
1
1
-
{... }: {
1
1
+
{ ... }:
2
2
+
{
2
3
services.nginx.virtualHosts."mergebot.lassul.us" = {
3
4
enableACME = true;
4
5
addSSL = true;
···
32
32
33
33
lass.mysqlBackup = {
34
34
enable = true;
35
35
-
config.all = {};
35
35
+
config.all = { };
36
36
};
37
37
}
38
38
-
···
4
4
5
5
rec {
6
6
7
7
-
ssl = domains :
8
8
-
let
9
9
-
domain = head domains;
10
10
-
in {
7
7
+
ssl =
8
8
+
domains:
9
9
+
{
11
10
};
12
11
13
13
-
servePage = domains:
12
12
+
servePage =
13
13
+
domains:
14
14
let
15
15
domain = head domains;
16
16
-
in {
16
16
+
in
17
17
+
{
17
18
services.nginx.virtualHosts.${domain} = {
18
19
enableACME = true;
19
20
addSSL = true;
···
24
25
};
25
26
};
26
27
27
27
-
serveOwncloud = domains:
28
28
+
serveOwncloud =
29
29
+
domains:
28
30
let
29
31
domain = head domains;
30
30
-
in {
32
32
+
in
33
33
+
{
31
34
services.nginx.virtualHosts."${domain}" = {
32
35
enableACME = true;
33
36
addSSL = true;
···
77
80
deny all;
78
81
'';
79
82
80
80
-
locations."~ ^/(?:autotest|occ|issue|indie|db_|console)".extraConfig = ''
83
83
+
locations."~ ^/(?:autotest|occ|issue|indie|db_|console)".extraConfig = ''
81
84
deny all;
82
85
'';
83
86
···
87
90
try_files $uri $uri/ =404;
88
91
'';
89
92
90
90
-
locations."~ \.php(?:$|/)".extraConfig = ''
93
93
+
locations."~ \.php(?:$|/)".extraConfig = ''
91
94
fastcgi_split_path_info ^(.+\.php)(/.+)$;
92
95
include ${pkgs.nginx}/conf/fastcgi_params;
93
96
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
···
131
134
};
132
135
};
133
136
134
134
-
serveWordpress = domains:
137
137
+
serveWordpress =
138
138
+
domains:
135
139
let
136
140
domain = head domains;
137
141
138
138
-
in {
142
142
+
in
143
143
+
{
139
144
services.nginx.virtualHosts."${domain}" = {
140
145
enableACME = true;
141
146
forceSSL = true;
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
systemd.services.weron = {
4
4
wantedBy = [ "multi-user.target" ];
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
systemd.services.weron-signaler = {
4
4
wantedBy = [ "multi-user.target" ];
5
5
-
environment = {
6
6
-
};
5
5
+
environment =
6
6
+
{
7
7
+
};
7
8
serviceConfig = {
8
9
ExecStart = ''${pkgs.weron}/bin/weron signaler --verbose=7 --laddr ":23420"'';
9
10
};
···
1
1
-
{ pkgs }:
2
2
-
pkgs.writers.writePython3Bin "autowifi" { flakeIgnore = [ "E501" ]; } ./autowifi.py
1
1
+
{ pkgs }: pkgs.writers.writePython3Bin "autowifi" { flakeIgnore = [ "E501" ]; } ./autowifi.py
···
1
1
-
{ writers, coreutils, pass, hledger, diffutils }:
1
1
+
{
2
2
+
writers,
3
3
+
coreutils,
4
4
+
pass,
5
5
+
hledger,
6
6
+
diffutils,
7
7
+
}:
2
8
3
9
writers.writeDashBin "bank" ''
4
10
tmp=$(mktemp)
···
11
17
fi
12
18
${coreutils}/bin/rm $tmp
13
19
''
14
14
-
···
1
1
-
{ lib, buildGoModule, fetchFromGitHub }:
1
1
+
{ buildGoModule, fetchFromGitHub }:
2
2
3
3
buildGoModule rec {
4
4
pname = "htmlparser";
···
1
1
-
{ pkgs, lib, vgname ? "vgname", luksmap ? "luksmap", ... }:
1
1
+
{
2
2
+
pkgs,
3
3
+
lib,
4
4
+
vgname ? "vgname",
5
5
+
luksmap ? "luksmap",
6
6
+
...
7
7
+
}:
2
8
3
9
with lib;
4
10
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ lib, pkgs, ... }:
2
2
{
3
3
virtualisation.emptyDiskImages = [
4
4
8000
···
7
7
boot.tmpOnTmpfs = true;
8
8
9
9
environment.systemPackages = [
10
10
-
(pkgs.callPackage ./default.nix {})
10
10
+
(pkgs.callPackage ./default.nix { })
11
11
];
12
12
services.mingetty.autologinUser = lib.mkForce "root";
13
13
}
···
1
1
-
{ pkgs, ... }: let
1
1
+
{ pkgs, ... }:
2
2
+
let
2
3
3
4
keynavrc = pkgs.writeText "keynavrc" ''
4
5
clear
···
21
22
2 click 2
22
23
3 click 3
23
24
'';
24
24
-
in pkgs.writeScriptBin "knav" ''
25
25
+
in
26
26
+
pkgs.writeScriptBin "knav" ''
25
27
${pkgs.keynav}/bin/keynav "loadconfig ${keynavrc}, start"
26
28
''
···
1
1
-
{ lib
2
2
-
, rustPlatform
3
3
-
, fetchFromGitHub
4
4
-
, stdenv
5
5
-
, darwin
1
1
+
{
2
2
+
lib,
3
3
+
rustPlatform,
4
4
+
fetchFromGitHub,
5
5
+
stdenv,
6
6
+
darwin,
6
7
}:
7
8
8
9
rustPlatform.buildRustPackage rec {
···
33
34
homepage = "https://github.com/threefoldtech/mycelium";
34
35
changelog = "https://github.com/threefoldtech/mycelium/blob/${src.rev}/CHANGELOG.md";
35
36
license = licenses.asl20;
36
36
-
maintainers = with maintainers; [ flokli matthewcroughan ];
37
37
+
maintainers = with maintainers; [
38
38
+
flokli
39
39
+
matthewcroughan
40
40
+
];
37
41
mainProgram = "mycelium";
38
42
};
39
43
}
···
10
10
rev = "c6dcd0d";
11
11
sha256 = "10xy20bjdnd5bjv2hf6v5y5wi0mc9555awxkjqf57rk6ngc5w6ss";
12
12
};
13
13
-
in pkgs.writers.writeDashBin "nichtparasoup" ''
13
13
+
in
14
14
+
pkgs.writers.writeDashBin "nichtparasoup" ''
14
15
${py}/bin/python ${src}/nichtparasoup.py "$@"
15
16
''
···
1
1
-
{ pkgs }: let
1
1
+
{ pkgs }:
2
2
+
let
2
3
3
4
review = pkgs.writers.writeBash "review-mail" ''
4
5
mail="$1"
···
30
31
echo '-------------------'
31
32
'';
32
33
33
33
-
in pkgs.writers.writeBashBin "review-mail" ''
34
34
+
in
35
35
+
pkgs.writers.writeBashBin "review-mail" ''
34
36
for mail in $(${pkgs.exim}/bin/exim -bp \
35
37
| ${pkgs.gnugrep}/bin/grep frozen \
36
38
| ${pkgs.gawk}/bin/awk '{print $3}'); do
···
1
1
-
{ lib, nixosTests, python3, python3Packages, fetchFromGitHub, fetchpatch }:
1
1
+
{
2
2
+
lib,
3
3
+
nixosTests,
4
4
+
python3,
5
5
+
python3Packages,
6
6
+
fetchFromGitHub,
7
7
+
fetchpatch,
8
8
+
}:
2
9
3
10
with python3Packages;
4
11
···
58
65
ln -s ../${python3.sitePackages}/searx/static $out/share/
59
66
'';
60
67
61
61
-
passthru.tests = { inherit (nixosTests) searx; };
68
68
+
passthru.tests = {
69
69
+
inherit (nixosTests) searx;
70
70
+
};
62
71
63
72
meta = with lib; {
64
73
homepage = "https://github.com/searx/searx";
65
74
description = "A privacy-respecting, hackable metasearch engine";
66
75
license = licenses.agpl3Plus;
67
67
-
maintainers = with maintainers; [ matejc fpletz globin danielfullmer ];
76
76
+
maintainers = with maintainers; [
77
77
+
matejc
78
78
+
fpletz
79
79
+
globin
80
80
+
danielfullmer
81
81
+
];
68
82
};
69
83
})
···
1
1
-
{ lib, stdenv
2
2
-
, fetchFromGitHub
3
3
-
, python39Packages
4
4
-
, glibcLocales
5
5
-
, coreutils
6
6
-
, git
7
7
-
, extraInputs ? []
8
8
-
}: let
1
1
+
{
2
2
+
lib,
3
3
+
fetchFromGitHub,
4
4
+
python39Packages,
5
5
+
glibcLocales,
6
6
+
coreutils,
7
7
+
git,
8
8
+
extraInputs ? [ ],
9
9
+
}:
10
10
+
let
9
11
10
12
python3Packages = python39Packages;
11
13
12
12
-
in python3Packages.buildPythonApplication rec {
14
14
+
in
15
15
+
python3Packages.buildPythonApplication rec {
13
16
pname = "xonsh2";
14
17
version = "master";
15
18
···
38
41
HOME=$TMPDIR pytest -k 'test_ptk_highlight'
39
42
'';
40
43
41
41
-
checkInputs = [ python3Packages.pytest python3Packages.pytest-rerunfailures glibcLocales git ];
44
44
+
checkInputs = [
45
45
+
python3Packages.pytest
46
46
+
python3Packages.pytest-rerunfailures
47
47
+
glibcLocales
48
48
+
git
49
49
+
];
42
50
43
43
-
propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit pygments ] ++ extraInputs;
51
51
+
propagatedBuildInputs =
52
52
+
with python3Packages;
53
53
+
[
54
54
+
ply
55
55
+
prompt_toolkit
56
56
+
pygments
57
57
+
]
58
58
+
++ extraInputs;
44
59
45
60
meta = with lib; {
46
61
description = "A Python-ish, BASHwards-compatible shell";
···
19
19
# Auto upgrade nix package and the daemon service.
20
20
services.nix-daemon.enable = true;
21
21
nix = {
22
22
-
package = pkgs.nix;
23
23
-
settings = {
24
24
-
extra-experimental-features = [ "nix-command" "flakes" ];
25
25
-
};
22
22
+
package = pkgs.nix;
23
23
+
settings = {
24
24
+
extra-experimental-features = [
25
25
+
"nix-command"
26
26
+
"flakes"
27
27
+
];
28
28
+
};
26
29
};
27
30
28
31
homebrew = {
···
61
64
# nix.linux-builder.enable = true;
62
65
63
66
# Create /etc/zshrc that loads the nix-darwin environment.
64
64
-
programs.zsh.enable = true; # default shell on catalina
67
67
+
programs.zsh.enable = true; # default shell on catalina
65
68
# programs.fish.enable = true;
66
69
67
70
programs.direnv.enable = true;
···
1
1
-
{ self, config, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
3
3
{
4
4
imports = [
···
23
23
../../2configs/print.nix
24
24
../../2configs/br.nix
25
25
../../2configs/c-base.nix
26
26
-
{ # autorandrs
26
26
+
{
27
27
+
# autorandrs
27
28
services.autorandr = {
28
29
enable = true;
29
30
hooks.postswitch.reset_usb = ''
···
127
128
};
128
129
hardware.pulseaudio.package = pkgs.pulseaudioFull;
129
130
130
130
-
nix.trustedUsers = [ "root" "lass" ];
131
131
+
nix.trustedUsers = [
132
132
+
"root"
133
133
+
"lass"
134
134
+
];
131
135
132
136
services.tor = {
133
137
enable = true;
···
38
38
};
39
39
# Mountpoints inferred from subvolume name
40
40
"/home" = {
41
41
-
mountOptions = [];
41
41
+
mountOptions = [ ];
42
42
mountpoint = "/home";
43
43
};
44
44
"/nix" = {
45
45
-
mountOptions = [];
45
45
+
mountOptions = [ ];
46
46
mountpoint = "/nix";
47
47
};
48
48
};
···
54
54
};
55
55
};
56
56
}
57
57
-
···
1
1
-
{ config, lib, pkgs, modulesPath, ... }:
1
1
+
{ pkgs, modulesPath, ... }:
2
2
{
3
3
imports = [
4
4
./config.nix
···
74
74
services.xserver.displayManager.sessionCommands = ''
75
75
${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keycode 96 = F12 Insert F12 F12' # rebind shift + F12 to shift + insert
76
76
'';
77
77
-
services.udev.extraHwdb = /* sh */ ''
78
78
-
# disable back buttons
79
79
-
evdev:input:b0003v2F24p0135* # /dev/input/event2
80
80
-
KEYBOARD_KEY_70026=reserved
81
81
-
KEYBOARD_KEY_70027=reserved
82
82
-
'';
77
77
+
services.udev.extraHwdb = # sh
78
78
+
''
79
79
+
# disable back buttons
80
80
+
evdev:input:b0003v2F24p0135* # /dev/input/event2
81
81
+
KEYBOARD_KEY_70026=reserved
82
82
+
KEYBOARD_KEY_70027=reserved
83
83
+
'';
83
84
84
85
# update cpu microcode
85
86
hardware.cpu.amd.updateMicrocode = true;
···
92
93
];
93
94
94
95
# suspend to disk
95
95
-
swapDevices = [{
96
96
-
device = "/swapfile";
97
97
-
}];
96
96
+
swapDevices = [
97
97
+
{
98
98
+
device = "/swapfile";
99
99
+
}
100
100
+
];
98
101
boot.resumeDevice = "/dev/mapper/aergia1";
99
102
services.logind.lidSwitch = "suspend-then-hibernate";
100
103
services.logind.extraConfig = ''
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
{
3
3
imports = [
4
4
../../2configs
···
1
1
-
{ lib, pkgs, test, ... }:
2
2
-
if test then {} else {
3
3
-
nixpkgs = lib.mkIf (! test) (lib.mkForce {
4
4
-
file = {
5
5
-
path = toString (pkgs.fetchFromGitHub {
6
6
-
owner = "nixos";
7
7
-
repo = "nixpkgs";
8
8
-
rev = (lib.importJSON ../../../krebs/nixpkgs.json).rev;
9
9
-
sha256 = (lib.importJSON ../../../krebs/nixpkgs.json).sha256;
10
10
-
});
11
11
-
useChecksum = true;
1
1
+
{
2
2
+
lib,
3
3
+
pkgs,
4
4
+
test,
5
5
+
...
6
6
+
}:
7
7
+
if test then
8
8
+
{ }
9
9
+
else
10
10
+
{
11
11
+
nixpkgs = lib.mkIf (!test) (
12
12
+
lib.mkForce {
13
13
+
file = {
14
14
+
path = toString (
15
15
+
pkgs.fetchFromGitHub {
16
16
+
owner = "nixos";
17
17
+
repo = "nixpkgs";
18
18
+
rev = (lib.importJSON ../../../krebs/nixpkgs.json).rev;
19
19
+
sha256 = (lib.importJSON ../../../krebs/nixpkgs.json).sha256;
20
20
+
}
21
21
+
);
22
22
+
useChecksum = true;
23
23
+
};
24
24
+
}
25
25
+
);
26
26
+
nixpkgs-unstable = lib.mkForce {
27
27
+
file.path = "/var/empty";
12
28
};
13
13
-
});
14
14
-
nixpkgs-unstable = lib.mkForce {
15
15
-
file.path = "/var/empty";
16
16
-
};
17
17
-
}
29
29
+
}
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
2
8
3
9
{
4
10
imports = [
···
14
20
../../2configs/wine.nix
15
21
../../2configs/yellow-mounts/samba.nix
16
22
../../2configs/review.nix
17
17
-
{ # moonlight test env
23
23
+
{
24
24
+
# moonlight test env
18
25
imports = [
19
26
../../2configs/sunshine.nix
20
27
../../2configs/mpv.nix
···
22
29
users.users.moon = {
23
30
isNormalUser = true;
24
31
uid = 1338;
25
25
-
extraGroups = [ "video" "audio" "input" "pipewire" ];
32
32
+
extraGroups = [
33
33
+
"video"
34
34
+
"audio"
35
35
+
"input"
36
36
+
"pipewire"
37
37
+
];
26
38
home = "/home/moon";
27
39
password = "moon";
28
40
packages = with pkgs; [
29
29
-
(retroarch.override { cores = [
30
30
-
libretro.bsnes-hd
31
31
-
libretro.mupen64plus
32
32
-
]; })
41
41
+
(retroarch.override {
42
42
+
cores = [
43
43
+
libretro.bsnes-hd
44
44
+
libretro.mupen64plus
45
45
+
];
46
46
+
})
33
47
];
34
48
};
35
49
services.xserver.enable = true;
···
68
82
69
83
programs.adb.enable = true;
70
84
71
71
-
nix.settings.trusted-users = [ "root" "lass" ];
85
85
+
nix.settings.trusted-users = [
86
86
+
"root"
87
87
+
"lass"
88
88
+
];
72
89
73
90
services.tor = {
74
91
enable = true;
···
1
1
-
{ config, lib, pkgs, modulesPath, ... }:
1
1
+
{ pkgs, modulesPath, ... }:
2
2
{
3
3
imports = [
4
4
./config.nix
···
25
25
hardware.opengl.extraPackages = [ pkgs.amdvlk ];
26
26
hardware.opengl.extraPackages32 = [ pkgs.driversi686Linux.amdvlk ];
27
27
28
28
-
boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
28
28
+
boot.initrd.availableKernelModules = [
29
29
+
"nvme"
30
30
+
"ehci_pci"
31
31
+
"xhci_pci"
32
32
+
"usb_storage"
33
33
+
"sd_mod"
34
34
+
"rtsx_pci_sdmmc"
35
35
+
];
29
36
boot.kernelModules = [ "kvm-amd" ];
30
37
31
38
fileSystems."/" = {
···
1
1
-
{ lib, pkgs, test, ... }: let
1
1
+
{ lib, test, ... }:
2
2
+
let
2
3
npkgs = lib.importJSON ../../../krebs/nixpkgs-unstable.json;
3
3
-
in {
4
4
-
nixpkgs = (if test then lib.mkForce ({ derivation = let
5
5
-
rev = npkgs.rev;
6
6
-
sha256 = npkgs.sha256;
7
7
-
in ''
8
8
-
with import (builtins.fetchTarball {
9
9
-
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
10
10
-
sha256 = "${sha256}";
11
11
-
}) {};
12
12
-
pkgs.fetchFromGitHub {
13
13
-
owner = "nixos";
14
14
-
repo = "nixpkgs";
15
15
-
rev = "${rev}";
16
16
-
sha256 = "${sha256}";
17
17
-
}
18
18
-
''; }) else {
19
19
-
git.ref = lib.mkForce npkgs.rev;
20
20
-
});
4
4
+
in
5
5
+
{
6
6
+
nixpkgs = (
7
7
+
if test then
8
8
+
lib.mkForce ({
9
9
+
derivation =
10
10
+
let
11
11
+
rev = npkgs.rev;
12
12
+
sha256 = npkgs.sha256;
13
13
+
in
14
14
+
''
15
15
+
with import (builtins.fetchTarball {
16
16
+
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
17
17
+
sha256 = "${sha256}";
18
18
+
}) {};
19
19
+
pkgs.fetchFromGitHub {
20
20
+
owner = "nixos";
21
21
+
repo = "nixpkgs";
22
22
+
rev = "${rev}";
23
23
+
sha256 = "${sha256}";
24
24
+
}
25
25
+
'';
26
26
+
})
27
27
+
else
28
28
+
{
29
29
+
git.ref = lib.mkForce npkgs.rev;
30
30
+
}
31
31
+
);
21
32
}
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
2
8
3
9
{
4
10
imports = [
···
55
61
}
56
62
{
57
63
users = {
58
58
-
groups.plugdev = {};
64
64
+
groups.plugdev = { };
59
65
users = {
60
66
bitcoin = {
61
67
name = "bitcoin";
···
89
95
# torbrowser
90
96
];
91
97
krebs.iptables.tables.filter.INPUT.rules = [
92
92
-
{ predicate = "-p tcp -i retiolum --dport 5900"; target = "ACCEPT"; }
98
98
+
{
99
99
+
predicate = "-p tcp -i retiolum --dport 5900";
100
100
+
target = "ACCEPT";
101
101
+
}
93
102
];
94
103
}
95
104
];
···
17
17
"/home" = {
18
18
device = "/dev/mapper/pool-home";
19
19
fsType = "btrfs";
20
20
-
options = ["defaults" "noatime" "ssd" "compress=lzo"];
20
20
+
options = [
21
21
+
"defaults"
22
22
+
"noatime"
23
23
+
"ssd"
24
24
+
"compress=lzo"
25
25
+
];
21
26
};
22
27
"/bku" = {
23
28
device = "/dev/mapper/pool-bku";
24
29
fsType = "btrfs";
25
25
-
options = ["defaults" "noatime" "ssd" "compress=lzo"];
30
30
+
options = [
31
31
+
"defaults"
32
32
+
"noatime"
33
33
+
"ssd"
34
34
+
"compress=lzo"
35
35
+
];
26
36
};
27
37
"/backups" = {
28
38
device = "/dev/pool/backup";
···
37
47
38
48
boot = {
39
49
initrd.luks.devices.luksroot.device = "/dev/sda3";
40
40
-
initrd.availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ];
50
50
+
initrd.availableKernelModules = [
51
51
+
"xhci_hcd"
52
52
+
"ehci_pci"
53
53
+
"ahci"
54
54
+
"usb_storage"
55
55
+
];
41
56
};
42
57
43
58
services.logind.lidSwitch = "ignore";
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
3
3
{
4
4
imports = [
···
1
1
-
{ config, lib, pkgs, modulesPath, ... }:
1
1
+
{ modulesPath, ... }:
2
2
3
3
{
4
4
imports = [
···
6
6
(modulesPath + "/profiles/qemu-guest.nix")
7
7
];
8
8
9
9
-
boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "xhci_pci" "sd_mod" "sr_mod" ];
9
9
+
boot.initrd.availableKernelModules = [
10
10
+
"ata_piix"
11
11
+
"virtio_pci"
12
12
+
"xhci_pci"
13
13
+
"sd_mod"
14
14
+
"sr_mod"
15
15
+
];
10
16
boot.initrd.kernelModules = [ ];
11
17
boot.kernelModules = [ ];
12
18
boot.extraModulePackages = [ ];
13
19
boot.loader.grub.devices = [ "/dev/sda" ];
14
20
15
15
-
fileSystems."/" =
16
16
-
{ device = "/dev/disk/by-uuid/84053adc-49bc-4e02-8a19-3838bf3a43fd";
17
17
-
fsType = "ext4";
18
18
-
};
21
21
+
fileSystems."/" = {
22
22
+
device = "/dev/disk/by-uuid/84053adc-49bc-4e02-8a19-3838bf3a43fd";
23
23
+
fsType = "ext4";
24
24
+
};
19
25
20
26
swapDevices = [ ];
21
27
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
imports = [
4
4
../../2configs
···
33
33
clanCore.facts.services.green-container = {
34
34
secret."green.sync.key" = { };
35
35
public."green.sync.pub" = { };
36
36
-
generator.path = with pkgs; [ coreutils openssh ];
36
36
+
generator.path = with pkgs; [
37
37
+
coreutils
38
38
+
openssh
39
39
+
];
37
40
generator.script = ''
38
41
ssh-keygen -t ed25519 -N "" -f "$secrets"/green.sync.key
39
42
mv "$secrets"/green.sync.key "$facts"/green.sync.pub
···
67
70
];
68
71
69
72
krebs.iptables.tables.nat.PREROUTING.rules = [
70
70
-
{ predicate = "-i eth0 -p tcp -m tcp --dport 22"; target = "ACCEPT"; }
73
73
+
{
74
74
+
predicate = "-i eth0 -p tcp -m tcp --dport 22";
75
75
+
target = "ACCEPT";
76
76
+
}
71
77
];
72
78
73
79
# workaround for ssh access from yubikey via android
···
1
1
-
{ lib, pkgs, test, ... }: let
1
1
+
{ lib, test, ... }:
2
2
+
let
2
3
npkgs = lib.importJSON ../../../krebs/nixpkgs-unstable.json;
3
3
-
in if test then {} else {
4
4
-
nixpkgs.git.ref = lib.mkForce npkgs.rev;
5
5
-
nixpkgs-unstable = lib.mkForce { file = "/var/empty"; };
6
6
-
}
4
4
+
in
5
5
+
if test then
6
6
+
{ }
7
7
+
else
8
8
+
{
9
9
+
nixpkgs.git.ref = lib.mkForce npkgs.rev;
10
10
+
nixpkgs-unstable = lib.mkForce { file = "/var/empty"; };
11
11
+
}
···
14
14
source /grub/autoiso.cfg
15
15
}
16
16
'';
17
17
-
extraFiles."/grub/autoiso.cfg" = (pkgs.stdenv.mkDerivation {
18
18
-
name = "autoiso.cfg";
19
19
-
src = pkgs.grub2.src;
20
20
-
phases = [ "unpackPhase" "installPhase" ];
21
21
-
installPhase = ''
22
22
-
cp docs/autoiso.cfg $out
23
23
-
'';
24
24
-
});
17
17
+
extraFiles."/grub/autoiso.cfg" = (
18
18
+
pkgs.stdenv.mkDerivation {
19
19
+
name = "autoiso.cfg";
20
20
+
src = pkgs.grub2.src;
21
21
+
phases = [
22
22
+
"unpackPhase"
23
23
+
"installPhase"
24
24
+
];
25
25
+
installPhase = ''
26
26
+
cp docs/autoiso.cfg $out
27
27
+
'';
28
28
+
}
29
29
+
);
25
30
};
26
31
27
32
services.logind.lidSwitch = "ignore";
···
1
1
-
{ self, modulesPath, lib, ... }:
1
1
+
{
2
2
+
self,
3
3
+
modulesPath,
4
4
+
lib,
5
5
+
...
6
6
+
}:
2
7
3
8
{
4
9
imports = [
···
8
13
(modulesPath + "/installer/scan/not-detected.nix")
9
14
];
10
15
11
11
-
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
16
16
+
boot.initrd.availableKernelModules = [
17
17
+
"ehci_pci"
18
18
+
"ahci"
19
19
+
"xhci_pci"
20
20
+
"usb_storage"
21
21
+
"sd_mod"
22
22
+
"sdhci_pci"
23
23
+
];
12
24
boot.initrd.kernelModules = [ "dm-snapshot" ];
13
25
boot.kernelModules = [ "kvm-intel" ];
14
26
boot.extraModulePackages = [ ];
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
3
3
{
4
4
imports = [
···
1
1
-
{ self, modulesPath, lib, ... }:
1
1
+
{
2
2
+
self,
3
3
+
modulesPath,
4
4
+
lib,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
./config.nix
···
13
18
boot.loader.grub.device = "/dev/disk/by-id/wwn-0x5002538d702f5ac6";
14
19
boot.initrd.luks.devices.ssd.device = "/dev/disk/by-id/wwn-0x5002538d702f5ac6-part3";
15
20
16
16
-
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "sd_mod" "sdhci_pci" ];
21
21
+
boot.initrd.availableKernelModules = [
22
22
+
"ehci_pci"
23
23
+
"ahci"
24
24
+
"xhci_pci"
25
25
+
"sd_mod"
26
26
+
"sdhci_pci"
27
27
+
];
17
28
boot.initrd.kernelModules = [ "dm-snapshot" ];
18
29
boot.kernelModules = [ "kvm-intel" ];
19
30
boot.extraModulePackages = [ ];
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
3
8
{
4
9
imports = [
···
40
45
41
46
programs.adb.enable = true;
42
47
43
43
-
nix.settings.trusted-users = [ "root" "lass" ];
48
48
+
nix.settings.trusted-users = [
49
49
+
"root"
50
50
+
"lass"
51
51
+
];
44
52
45
53
services.tor = {
46
54
enable = true;
···
38
38
};
39
39
# Mountpoints inferred from subvolume name
40
40
"/home" = {
41
41
-
mountOptions = [];
41
41
+
mountOptions = [ ];
42
42
mountpoint = "/home";
43
43
};
44
44
"/nix" = {
45
45
-
mountOptions = [];
45
45
+
mountOptions = [ ];
46
46
mountpoint = "/nix";
47
47
};
48
48
};
···
54
54
};
55
55
};
56
56
}
57
57
-
···
1
1
-
{ config, lib, pkgs, ... }:
2
2
-
let
3
3
-
in
1
1
+
{ config, pkgs, ... }:
4
2
{
5
3
imports = [
6
4
../../2configs
···
1
1
-
{ config, lib, pkgs, modulesPath, ... }:
1
1
+
{ modulesPath, ... }:
2
2
{
3
3
imports = [
4
4
(modulesPath + "/installer/scan/not-detected.nix")
···
8
8
boot = {
9
9
# kernelPackages = pkgs.linuxPackages_rpi4;
10
10
tmpOnTmpfs = true;
11
11
-
initrd.availableKernelModules = [ "usbhid" "usb_storage" "xhci_pci" ];
11
11
+
initrd.availableKernelModules = [
12
12
+
"usbhid"
13
13
+
"usb_storage"
14
14
+
"xhci_pci"
15
15
+
];
12
16
# ttyAMA0 is the serial console broken out to the GPIO
13
17
kernelParams = [
14
14
-
"8250.nr_uarts=1"
15
15
-
"console=ttyAMA0,115200"
16
16
-
"console=tty1"
17
17
-
# Some gui programs need this
18
18
-
"cma=128M"
18
18
+
"8250.nr_uarts=1"
19
19
+
"console=ttyAMA0,115200"
20
20
+
"console=tty1"
21
21
+
# Some gui programs need this
22
22
+
"cma=128M"
19
23
];
20
24
};
21
25
···
1
1
-
{ self, config, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
3
8
{
4
9
imports = [
···
32
37
{
33
38
krebs.iptables.tables.filter.INPUT.rules = [
34
39
#risk of rain
35
35
-
{ predicate = "-p tcp --dport 11100"; target = "ACCEPT"; }
40
40
+
{
41
41
+
predicate = "-p tcp --dport 11100";
42
42
+
target = "ACCEPT";
43
43
+
}
36
44
#quake3
37
37
-
{ predicate = "-p tcp --dport 27950:27965"; target = "ACCEPT"; }
38
38
-
{ predicate = "-p udp --dport 27950:27965"; target = "ACCEPT"; }
45
45
+
{
46
46
+
predicate = "-p tcp --dport 27950:27965";
47
47
+
target = "ACCEPT";
48
48
+
}
49
49
+
{
50
50
+
predicate = "-p udp --dport 27950:27965";
51
51
+
target = "ACCEPT";
52
52
+
}
39
53
];
40
54
}
41
55
{
···
107
121
nixpkgs.config.android_sdk.accept_license = true;
108
122
programs.adb.enable = true;
109
123
110
110
-
111
111
-
112
124
# It may leak your data, but look how FAST it is!1!!
113
125
# https://make-linux-fast-again.com/
114
126
boot.kernelParams = [
···
128
140
"aarch64-linux"
129
141
];
130
142
131
131
-
nix.trustedUsers = [ "root" "lass" ];
143
143
+
nix.trustedUsers = [
144
144
+
"root"
145
145
+
"lass"
146
146
+
];
132
147
133
148
services.nscd.enableNsncd = true;
134
149
···
11
11
"/bku" = {
12
12
device = "/dev/mapper/pool-bku";
13
13
fsType = "btrfs";
14
14
-
options = ["defaults" "noatime" "ssd" "compress=lzo"];
14
14
+
options = [
15
15
+
"defaults"
16
16
+
"noatime"
17
17
+
"ssd"
18
18
+
"compress=lzo"
19
19
+
];
15
20
};
16
21
"/home/virtual" = {
17
22
device = "/dev/mapper/pool-virtual";
···
1
1
-
{ lib, pkgs, test, ... }: let
1
1
+
{ lib, test, ... }:
2
2
+
let
2
3
npkgs = lib.importJSON ../../../krebs/nixpkgs-unstable.json;
3
3
-
in {
4
4
-
nixpkgs = (if test then lib.mkForce ({ derivation = let
5
5
-
rev = npkgs.rev;
6
6
-
sha256 = npkgs.sha256;
7
7
-
in ''
8
8
-
with import (builtins.fetchTarball {
9
9
-
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
10
10
-
sha256 = "${sha256}";
11
11
-
}) {};
12
12
-
pkgs.fetchFromGitHub {
13
13
-
owner = "nixos";
14
14
-
repo = "nixpkgs";
15
15
-
rev = "${rev}";
16
16
-
sha256 = "${sha256}";
17
17
-
}
18
18
-
''; }) else {
19
19
-
git.ref = lib.mkForce npkgs.rev;
20
20
-
});
4
4
+
in
5
5
+
{
6
6
+
nixpkgs = (
7
7
+
if test then
8
8
+
lib.mkForce ({
9
9
+
derivation =
10
10
+
let
11
11
+
rev = npkgs.rev;
12
12
+
sha256 = npkgs.sha256;
13
13
+
in
14
14
+
''
15
15
+
with import (builtins.fetchTarball {
16
16
+
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
17
17
+
sha256 = "${sha256}";
18
18
+
}) {};
19
19
+
pkgs.fetchFromGitHub {
20
20
+
owner = "nixos";
21
21
+
repo = "nixpkgs";
22
22
+
rev = "${rev}";
23
23
+
sha256 = "${sha256}";
24
24
+
}
25
25
+
'';
26
26
+
})
27
27
+
else
28
28
+
{
29
29
+
git.ref = lib.mkForce npkgs.rev;
30
30
+
}
31
31
+
);
21
32
}
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
3
3
{
4
4
imports = [
···
1
1
-
{ lib, ... }: {
1
1
+
{ lib, ... }:
2
2
+
{
2
3
disko.imageBuilder.extraRootModules = [
3
4
"zfs"
4
5
];
···
6
7
services.mingetty.autologinUser = "root";
7
8
};
8
9
disko.devices = {
9
9
-
disk = (lib.genAttrs [ "/dev/nvme0n1" "/dev/nvme1n1" ] (disk: {
10
10
-
type = "disk";
11
11
-
device = disk;
12
12
-
imageSize = "3G";
13
13
-
content = {
14
14
-
type = "gpt";
15
15
-
partitions = {
16
16
-
boot = {
17
17
-
size = "1M";
18
18
-
type = "EF02";
19
19
-
};
20
20
-
ESP = {
21
21
-
size = "1G";
22
22
-
content = {
23
23
-
type = "mdraid";
24
24
-
name = "boot";
10
10
+
disk =
11
11
+
(lib.genAttrs
12
12
+
[
13
13
+
"/dev/nvme0n1"
14
14
+
"/dev/nvme1n1"
15
15
+
]
16
16
+
(disk: {
17
17
+
type = "disk";
18
18
+
device = disk;
19
19
+
imageSize = "3G";
20
20
+
content = {
21
21
+
type = "gpt";
22
22
+
partitions = {
23
23
+
boot = {
24
24
+
size = "1M";
25
25
+
type = "EF02";
26
26
+
};
27
27
+
ESP = {
28
28
+
size = "1G";
29
29
+
content = {
30
30
+
type = "mdraid";
31
31
+
name = "boot";
32
32
+
};
33
33
+
};
34
34
+
zfs = {
35
35
+
size = "100%";
36
36
+
content = {
37
37
+
type = "zfs";
38
38
+
pool = "zroot";
39
39
+
};
40
40
+
};
25
41
};
26
42
};
27
27
-
zfs = {
28
28
-
size = "100%";
29
29
-
content = {
30
30
-
type = "zfs";
31
31
-
pool = "zroot";
32
32
-
};
43
43
+
})
44
44
+
)
45
45
+
// {
46
46
+
hdd1 = {
47
47
+
type = "disk";
48
48
+
device = "/dev/sda";
49
49
+
content = {
50
50
+
type = "zfs";
51
51
+
pool = "tank";
33
52
};
34
53
};
35
54
};
36
36
-
})) // {
37
37
-
hdd1 = {
38
38
-
type = "disk";
39
39
-
device = "/dev/sda";
40
40
-
content = {
41
41
-
type = "zfs";
42
42
-
pool = "tank";
43
43
-
};
44
44
-
};
45
45
-
};
46
55
mdadm = {
47
56
boot = {
48
57
type = "mdadm";
···
60
69
type = "zpool";
61
70
mode = "mirror";
62
71
mountpoint = "/";
63
63
-
rootFsOptions = {
64
64
-
};
72
72
+
rootFsOptions =
73
73
+
{
74
74
+
};
65
75
datasets = {
66
76
reserved = {
67
77
type = "zfs_fs";
···
1
1
-
{ self, modulesPath, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
modulesPath,
4
4
+
config,
5
5
+
lib,
6
6
+
pkgs,
7
7
+
...
8
8
+
}:
2
9
{
3
10
4
11
imports = [
···
13
20
14
21
boot.loader.grub.enable = true;
15
22
boot.loader.grub.efiSupport = true;
16
16
-
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "sd_mod" ];
23
23
+
boot.initrd.availableKernelModules = [
24
24
+
"xhci_pci"
25
25
+
"ahci"
26
26
+
"nvme"
27
27
+
"sd_mod"
28
28
+
];
17
29
boot.kernelParams = [
18
30
"boot.shell_on_fail"
19
31
];
···
13
13
clan.password-store.targetDirectory = "/var/state/secrets";
14
14
15
15
services.nginx.enable = true;
16
16
-
networking.firewall.allowedTCPPorts = [ 80 443 ];
16
16
+
networking.firewall.allowedTCPPorts = [
17
17
+
80
18
18
+
443
19
19
+
];
17
20
security.acme = {
18
21
acceptTerms = true;
19
22
defaults.email = "acme@lassul.us";
···
26
29
clanCore.facts.services.orange-container = {
27
30
secret."orange.sync.key" = { };
28
31
public."orange.sync.pub" = { };
29
29
-
generator.path = with pkgs; [ coreutils openssh ];
32
32
+
generator.path = with pkgs; [
33
33
+
coreutils
34
34
+
openssh
35
35
+
];
30
36
generator.script = ''
31
37
ssh-keygen -t ed25519 -N "" -f "$secrets"/orange.sync.key
32
38
mv "$secrets"/orange.sync.key "$facts"/orange.sync.pub
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
services.postgresqlBackup.enable = true;
4
4
5
5
systemd.services.borgbackup-job-hetzner.serviceConfig.ReadWritePaths = [ "/var/log/telegraf" ];
6
6
7
7
clanCore.facts.services.borgbackup = {
8
8
-
secret."borgbackup.ssh.id25519" = {};
9
9
-
public."borgbackup.ssh.id25519.pub" = {};
8
8
+
secret."borgbackup.ssh.id25519" = { };
9
9
+
public."borgbackup.ssh.id25519.pub" = { };
10
10
generator.path = [
11
11
pkgs.coreutils
12
12
pkgs.openssh
···
29
29
compression = "auto,zstd";
30
30
startAt = "*-*-* 02:00:00";
31
31
# TODO: change backup key
32
32
-
environment.BORG_RSH = "ssh -oPort=23 -i ${config.clanCore.facts.services.borgbackup.secret."borgbackup.ssh.id25519".path}";
32
32
+
environment.BORG_RSH = "ssh -oPort=23 -i ${
33
33
+
config.clanCore.facts.services.borgbackup.secret."borgbackup.ssh.id25519".path
34
34
+
}";
33
35
preHook = ''
34
36
set -x
35
37
'';
···
1
1
-
{ self, config, lib, pkgs, ... }: let
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
8
8
+
let
2
9
slib = self.inputs.stockholm.lib;
3
3
-
in {
10
10
+
in
11
11
+
{
4
12
5
13
system.stateVersion = "23.05";
6
14
imports = [
···
23
31
};
24
32
25
33
krebs.iptables.tables.filter.INPUT.rules = [
26
26
-
{ predicate = "-p tcp --dport http"; target = "ACCEPT"; }
27
27
-
{ predicate = "-p tcp --dport https"; target = "ACCEPT"; }
34
34
+
{
35
35
+
predicate = "-p tcp --dport http";
36
36
+
target = "ACCEPT";
37
37
+
}
38
38
+
{
39
39
+
predicate = "-p tcp --dport https";
40
40
+
target = "ACCEPT";
41
41
+
}
28
42
];
29
43
}
30
30
-
{ # TODO make new hfos.nix out of this vv
44
44
+
{
45
45
+
# TODO make new hfos.nix out of this vv
31
46
users.users.riot = {
32
47
uid = slib.genid_uint31 "riot";
33
48
isNormalUser = true;
···
37
52
];
38
53
};
39
54
krebs.iptables.tables.filter.FORWARD.rules = lib.mkBefore [
40
40
-
{ v6 = false; predicate = "--destination 95.216.1.130"; target = "ACCEPT"; }
41
41
-
{ v6 = false; predicate = "--source 95.216.1.130"; target = "ACCEPT"; }
55
55
+
{
56
56
+
v6 = false;
57
57
+
predicate = "--destination 95.216.1.130";
58
58
+
target = "ACCEPT";
59
59
+
}
60
60
+
{
61
61
+
v6 = false;
62
62
+
predicate = "--source 95.216.1.130";
63
63
+
target = "ACCEPT";
64
64
+
}
42
65
];
43
66
}
44
67
{
···
79
102
extraGroups = [
80
103
"download"
81
104
];
82
82
-
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDQFaYOWRUvHP6I37q9Dd4PJOq8FNQqAeJZ8pLx0G62uC450kbPGcG80rHHvXmk7HqQP6biJmMg48bOsvXAScPot2Qhp1Qc35CuUqVhLiTvUAsi8l/iJjhjZ23yRGDCAmW5+JIOzIvECkcbMnG7YoYAQ9trNGHe9qwGzQGhpt3QVClE23WtE3PVKRLQx1VbiabSnAm6tXVd2zpUoSdpWt8Gpi2taM4XXJ5+l744MNxFHvDapN5xqpYzwrA34Ii13jNLWcGbtgxESpR+VjnamdWByrkBsW4X5/xn2K1I1FrujaM/DBHV1QMaDKst9V8+uL5X7aYNt0OUBu2eyZdg6aujY2BYovB9uRyR1JIuSbA/a54MM96yN9WirMUufJF/YZrV0L631t9EW8ORyWUo1GRzMuBHVHQlfApj7NCU/jEddUuTqKgwyRgTmMFMUI4M0tRULAB/7pBE1Vbcx9tg6RsKIk8VkskfbBJW9Y6Sx6YoFlxPdgMNIrBefqEjIV62piP7YLMlvfIDCJ7TNd9dLN86XGggZ/nD5zt6SL1o61vVnw9If8pHosppxADPJsJvcdN6fOe16/tFAeE0JRo0jTcyFVTBGfhpey+rFfuW8wtUyuO5WPUxkOn7xMHGMWHJAtWX2vwVIDtLxvqn48B4SmEOpPD6ii+vcpwqAex3ycqBUQ==" ];
105
105
+
openssh.authorizedKeys.keys = [
106
106
+
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDQFaYOWRUvHP6I37q9Dd4PJOq8FNQqAeJZ8pLx0G62uC450kbPGcG80rHHvXmk7HqQP6biJmMg48bOsvXAScPot2Qhp1Qc35CuUqVhLiTvUAsi8l/iJjhjZ23yRGDCAmW5+JIOzIvECkcbMnG7YoYAQ9trNGHe9qwGzQGhpt3QVClE23WtE3PVKRLQx1VbiabSnAm6tXVd2zpUoSdpWt8Gpi2taM4XXJ5+l744MNxFHvDapN5xqpYzwrA34Ii13jNLWcGbtgxESpR+VjnamdWByrkBsW4X5/xn2K1I1FrujaM/DBHV1QMaDKst9V8+uL5X7aYNt0OUBu2eyZdg6aujY2BYovB9uRyR1JIuSbA/a54MM96yN9WirMUufJF/YZrV0L631t9EW8ORyWUo1GRzMuBHVHQlfApj7NCU/jEddUuTqKgwyRgTmMFMUI4M0tRULAB/7pBE1Vbcx9tg6RsKIk8VkskfbBJW9Y6Sx6YoFlxPdgMNIrBefqEjIV62piP7YLMlvfIDCJ7TNd9dLN86XGggZ/nD5zt6SL1o61vVnw9If8pHosppxADPJsJvcdN6fOe16/tFAeE0JRo0jTcyFVTBGfhpey+rFfuW8wtUyuO5WPUxkOn7xMHGMWHJAtWX2vwVIDtLxvqn48B4SmEOpPD6ii+vcpwqAex3ycqBUQ=="
107
107
+
];
83
108
};
84
109
}
85
110
{
···
143
168
../../2configs/wiregrill.nix
144
169
];
145
170
krebs.iptables.tables.nat.PREROUTING.rules = lib.mkOrder 999 [
146
146
-
{ v6 = false; predicate = "-s 10.244.0.0/16"; target = "ACCEPT"; }
147
147
-
{ v4 = false; predicate = "-s 42:1::/32"; target = "ACCEPT"; }
171
171
+
{
172
172
+
v6 = false;
173
173
+
predicate = "-s 10.244.0.0/16";
174
174
+
target = "ACCEPT";
175
175
+
}
176
176
+
{
177
177
+
v4 = false;
178
178
+
predicate = "-s 42:1::/32";
179
179
+
target = "ACCEPT";
180
180
+
}
148
181
];
149
182
krebs.iptables.tables.filter.FORWARD.rules = lib.mkBefore [
150
150
-
{ predicate = "-i wiregrill -o retiolum"; target = "ACCEPT"; }
151
151
-
{ predicate = "-i retiolum -o wiregrill"; target = "ACCEPT"; }
183
183
+
{
184
184
+
predicate = "-i wiregrill -o retiolum";
185
185
+
target = "ACCEPT";
186
186
+
}
187
187
+
{
188
188
+
predicate = "-i retiolum -o wiregrill";
189
189
+
target = "ACCEPT";
190
190
+
}
152
191
];
153
192
krebs.iptables.tables.nat.POSTROUTING.rules = [
154
154
-
{ v4 = false; predicate = "-s 42:1::/32 ! -d 42:1::/48"; target = "MASQUERADE"; }
155
155
-
{ v6 = false; predicate = "-s 10.244.0.0/16 ! -d 10.244.0.0/16"; target = "MASQUERADE"; }
193
193
+
{
194
194
+
v4 = false;
195
195
+
predicate = "-s 42:1::/32 ! -d 42:1::/48";
196
196
+
target = "MASQUERADE";
197
197
+
}
198
198
+
{
199
199
+
v6 = false;
200
200
+
predicate = "-s 10.244.0.0/16 ! -d 10.244.0.0/16";
201
201
+
target = "MASQUERADE";
202
202
+
}
156
203
];
157
204
services.dnsmasq = {
158
205
enable = true;
···
160
207
161
208
settings = {
162
209
bind-interfaces = true;
163
163
-
interface = [ "wiregrill" "retiolum " ];
210
210
+
interface = [
211
211
+
"wiregrill"
212
212
+
"retiolum "
213
213
+
];
164
214
};
165
215
};
166
216
}
167
217
{
168
218
krebs.iptables.tables.filter.INPUT.rules = [
169
169
-
{ predicate = "-p udp --dport 60000:61000"; target = "ACCEPT"; }
219
219
+
{
220
220
+
predicate = "-p udp --dport 60000:61000";
221
221
+
target = "ACCEPT";
222
222
+
}
170
223
];
171
224
}
172
225
../../2configs/services/coms/murmur.nix
173
173
-
{ # acme fallback for neoprism migration
226
226
+
{
227
227
+
# acme fallback for neoprism migration
174
228
services.nginx.virtualHosts."lassul.us".acmeFallbackHost = "orange.r";
175
229
services.nginx.virtualHosts."radio.lassul.us".acmeFallbackHost = "neoprism.r";
176
230
services.nginx.virtualHosts."flix.lassul.us".acmeFallbackHost = "neoprism.r";
···
1
1
-
{ modulesPath, config, lib, pkgs, ... }:
1
1
+
{ modulesPath, lib, ... }:
2
2
3
3
{
4
4
···
7
7
(modulesPath + "/installer/scan/not-detected.nix")
8
8
];
9
9
10
10
-
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" ];
10
10
+
boot.initrd.availableKernelModules = [
11
11
+
"xhci_pci"
12
12
+
"ahci"
13
13
+
"sd_mod"
14
14
+
];
11
15
boot.kernelModules = [ "kvm-intel" ];
12
16
boot.swraid.enable = true;
13
17
···
71
75
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
72
76
73
77
boot.loader.grub.enable = true;
74
74
-
boot.loader.grub.devices = [ "/dev/sda" "/dev/sdb" ];
78
78
+
boot.loader.grub.devices = [
79
79
+
"/dev/sda"
80
80
+
"/dev/sdb"
81
81
+
];
75
82
76
83
# we don't pay for power there and this might solve a problem we observed at least once
77
84
# https://www.thomas-krenn.com/de/wiki/PCIe_Bus_Error_Status_00001100_beheben
78
78
-
boot.kernelParams = [ "pcie_aspm=off" "net.ifnames=0" "nomodeset" ];
85
85
+
boot.kernelParams = [
86
86
+
"pcie_aspm=off"
87
87
+
"net.ifnames=0"
88
88
+
"nomodeset"
89
89
+
];
79
90
networking.dhcpcd.enable = false;
80
80
-
81
91
82
92
networking.useNetworkd = lib.mkForce false;
83
93
systemd.network.enable = lib.mkForce false;
···
86
96
networking = {
87
97
hostId = "2283aaae";
88
98
defaultGateway = "95.216.1.129";
89
89
-
defaultGateway6 = { address = "fe80::1"; interface = "ext-br"; };
99
99
+
defaultGateway6 = {
100
100
+
address = "fe80::1";
101
101
+
interface = "ext-br";
102
102
+
};
90
103
# Use google's public DNS server
91
104
nameservers = [ "8.8.8.8" ];
92
105
interfaces.ext-br.ipv4.addresses = [
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
imports = [
4
4
../../2configs
···
25
25
clanCore.facts.services.radio-container = {
26
26
secret."radio.sync.key" = { };
27
27
public."radio.sync.pub" = { };
28
28
-
generator.path = with pkgs; [ coreutils openssh ];
28
28
+
generator.path = with pkgs; [
29
29
+
coreutils
30
30
+
openssh
31
31
+
];
29
32
generator.script = ''
30
33
ssh-keygen -t ed25519 -N "" -f "$secrets"/radio.sync.key
31
34
mv "$secrets"/radio.sync.key "$facts"/radio.sync.pub
···
1
1
-
{ lib, pkgs, test, ... }: let
1
1
+
{ lib, test, ... }:
2
2
+
let
2
3
npkgs = lib.importJSON ../../../krebs/nixpkgs-unstable.json;
3
3
-
in if test then {} else {
4
4
-
nixpkgs.git.ref = lib.mkForce npkgs.rev;
5
5
-
nixpkgs-unstable = lib.mkForce { file = "/var/empty"; };
6
6
-
}
4
4
+
in
5
5
+
if test then
6
6
+
{ }
7
7
+
else
8
8
+
{
9
9
+
nixpkgs.git.ref = lib.mkForce npkgs.rev;
10
10
+
nixpkgs-unstable = lib.mkForce { file = "/var/empty"; };
11
11
+
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, ... }:
2
2
3
3
{
4
4
imports = [
···
21
21
22
22
services.logind.lidSwitch = "ignore";
23
23
services.logind.lidSwitchDocked = "ignore";
24
24
-
nix.trustedUsers = [ "root" "lass" ];
24
24
+
nix.trustedUsers = [
25
25
+
"root"
26
26
+
"lass"
27
27
+
];
25
28
system.stateVersion = "22.05";
26
29
}
···
12
12
loader.grub.device = "/dev/sda";
13
13
14
14
initrd.luks.devices.lusksroot.device = "/dev/sda2";
15
15
-
initrd.availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ];
15
15
+
initrd.availableKernelModules = [
16
16
+
"xhci_hcd"
17
17
+
"ehci_pci"
18
18
+
"ahci"
19
19
+
"usb_storage"
20
20
+
];
16
21
};
17
22
fileSystems = {
18
23
"/" = {
···
26
31
"/home" = {
27
32
device = "/dev/mapper/pool-home";
28
33
fsType = "btrfs";
29
29
-
options = ["defaults" "noatime" "ssd" "compress=lzo"];
34
34
+
options = [
35
35
+
"defaults"
36
36
+
"noatime"
37
37
+
"ssd"
38
38
+
"compress=lzo"
39
39
+
];
30
40
};
31
41
"/bku" = {
32
42
device = "/dev/pool/bku";
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
3
8
{
4
9
imports = [
···
103
108
# for usb internet
104
109
hardware.usbWwan.enable = true;
105
110
}
106
106
-
···
6
6
(modulesPath + "/installer/scan/not-detected.nix")
7
7
];
8
8
9
9
-
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
9
9
+
boot.initrd.availableKernelModules = [
10
10
+
"xhci_pci"
11
11
+
"ahci"
12
12
+
"usbhid"
13
13
+
"sd_mod"
14
14
+
];
10
15
boot.initrd.kernelModules = [ "dm-snapshot" ];
11
16
boot.kernelModules = [ "kvm-intel" ];
12
17
boot.extraModulePackages = [ ];
···
16
21
boot.loader.grub.device = "/dev/disk/by-id/ata-SanDisk_SSD_G5_BICS4_20248F446514";
17
22
boot.loader.grub.efiInstallAsRemovable = true;
18
23
19
19
-
fileSystems."/" =
20
20
-
{ device = "/dev/disk/by-uuid/ee5c9099-17fa-401e-852e-67cb4ae068f4";
21
21
-
fsType = "ext4";
22
22
-
};
24
24
+
fileSystems."/" = {
25
25
+
device = "/dev/disk/by-uuid/ee5c9099-17fa-401e-852e-67cb4ae068f4";
26
26
+
fsType = "ext4";
27
27
+
};
23
28
24
24
-
fileSystems."/boot" =
25
25
-
{ device = "/dev/disk/by-uuid/EAA5-88A9";
26
26
-
fsType = "vfat";
27
27
-
};
29
29
+
fileSystems."/boot" = {
30
30
+
device = "/dev/disk/by-uuid/EAA5-88A9";
31
31
+
fsType = "vfat";
32
32
+
};
28
33
29
34
swapDevices = [ ];
30
35
···
1
1
-
{ self, config, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
../../2configs
···
19
24
acceptTerms = true;
20
25
defaults.email = "acme@lassul.us";
21
26
};
22
22
-
networking.firewall.allowedTCPPorts = [ 80 443 ];
27
27
+
networking.firewall.allowedTCPPorts = [
28
28
+
80
29
29
+
443
30
30
+
];
23
31
24
32
# nextcloud
25
33
services.nginx.virtualHosts."c.apanowicz.de" = {
···
89
97
# server_condition = ''${run{/run/current-system/sw/bin/debug_exim ${config.lass.usershadow.pattern} $auth1 $auth2}{yes}{no}}
90
98
'';
91
99
internet-aliases = [
92
92
-
{ from = "dma@ubikmedia.de"; to = "domsen"; }
93
93
-
{ from = "dma@ubikmedia.eu"; to = "domsen"; }
94
94
-
{ from = "hallo@apanowicz.de"; to = "domsen"; }
95
95
-
{ from = "bruno@apanowicz.de"; to = "bruno"; }
96
96
-
{ from = "mail@jla-trading.com"; to = "jla-trading"; }
97
97
-
{ from = "jms@ubikmedia.eu"; to = "jms"; }
98
98
-
{ from = "ms@ubikmedia.eu"; to = "ms"; }
99
99
-
{ from = "ubik@ubikmedia.eu"; to = "domsen, jms, ms"; }
100
100
-
{ from = "kontakt@alewis.de"; to ="klabusterbeere"; }
101
101
-
{ from = "hallo@jarugadesign.de"; to ="kasia"; }
102
102
-
{ from = "noreply@beeshmooth.ch"; to ="besmooth@gmx.ch"; }
100
100
+
{
101
101
+
from = "dma@ubikmedia.de";
102
102
+
to = "domsen";
103
103
+
}
104
104
+
{
105
105
+
from = "dma@ubikmedia.eu";
106
106
+
to = "domsen";
107
107
+
}
108
108
+
{
109
109
+
from = "hallo@apanowicz.de";
110
110
+
to = "domsen";
111
111
+
}
112
112
+
{
113
113
+
from = "bruno@apanowicz.de";
114
114
+
to = "bruno";
115
115
+
}
116
116
+
{
117
117
+
from = "mail@jla-trading.com";
118
118
+
to = "jla-trading";
119
119
+
}
120
120
+
{
121
121
+
from = "jms@ubikmedia.eu";
122
122
+
to = "jms";
123
123
+
}
124
124
+
{
125
125
+
from = "ms@ubikmedia.eu";
126
126
+
to = "ms";
127
127
+
}
128
128
+
{
129
129
+
from = "ubik@ubikmedia.eu";
130
130
+
to = "domsen, jms, ms";
131
131
+
}
132
132
+
{
133
133
+
from = "kontakt@alewis.de";
134
134
+
to = "klabusterbeere";
135
135
+
}
136
136
+
{
137
137
+
from = "hallo@jarugadesign.de";
138
138
+
to = "kasia";
139
139
+
}
140
140
+
{
141
141
+
from = "noreply@beeshmooth.ch";
142
142
+
to = "besmooth@gmx.ch";
143
143
+
}
103
144
104
104
-
{ from = "testuser@ubikmedia.eu"; to = "testuser"; }
145
145
+
{
146
146
+
from = "testuser@ubikmedia.eu";
147
147
+
to = "testuser";
148
148
+
}
105
149
];
106
150
sender_domains = [
107
151
"jla-trading.com"
···
121
165
};
122
166
123
167
# users
124
124
-
users.groups.xanf = {};
168
168
+
users.groups.xanf = { };
125
169
users.users.UBIK-SFTP = {
126
170
uid = pkgs.stockholm.lib.genid_uint31 "UBIK-SFTP";
127
171
home = "/home/UBIK-SFTP";
···
144
188
description = "maintenance acc for domsen";
145
189
home = "/home/domsen";
146
190
useDefaultShell = true;
147
147
-
extraGroups = [ "syncthing" "download" "xanf" ];
191
191
+
extraGroups = [
192
192
+
"syncthing"
193
193
+
"download"
194
194
+
"xanf"
195
195
+
];
148
196
createHome = true;
149
197
isNormalUser = true;
150
198
};
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
3
8
{
4
9
imports = [
···
43
48
systemd.services.xboxdrv = {
44
49
wantedBy = [ "multi-user.target" ];
45
50
script = ''
46
46
-
${pkgs.xboxdrv.overrideAttrs(o: {
47
47
-
patches = o.patches ++ [ (pkgs.fetchurl {
48
48
-
url = "https://patch-diff.githubusercontent.com/raw/xboxdrv/xboxdrv/pull/251.patch";
49
49
-
sha256 = "17784y20mxqrlhgvwvszh8lprxrvgmb7ah9dknmbhj5jhkjl8wq5";
50
50
-
}) ];
51
51
-
})}/bin/xboxdrv --type xbox360 --dbus disabled -D
51
51
+
${
52
52
+
pkgs.xboxdrv.overrideAttrs (o: {
53
53
+
patches = o.patches ++ [
54
54
+
(pkgs.fetchurl {
55
55
+
url = "https://patch-diff.githubusercontent.com/raw/xboxdrv/xboxdrv/pull/251.patch";
56
56
+
sha256 = "17784y20mxqrlhgvwvszh8lprxrvgmb7ah9dknmbhj5jhkjl8wq5";
57
57
+
})
58
58
+
];
59
59
+
})
60
60
+
}/bin/xboxdrv --type xbox360 --dbus disabled -D
52
61
'';
53
62
};
54
63
···
1
1
-
{ modulesPath, pkgs, lib, ... }:
1
1
+
{
2
2
+
modulesPath,
3
3
+
pkgs,
4
4
+
lib,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
./config.nix
···
16
21
"sdhci_pci"
17
22
];
18
23
19
19
-
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
24
24
+
boot.initrd.availableKernelModules = [
25
25
+
"xhci_pci"
26
26
+
"ahci"
27
27
+
"usbhid"
28
28
+
"sd_mod"
29
29
+
];
20
30
boot.initrd.luks.devices.crypted.device = "/dev/sda3";
21
31
boot.kernelModules = [ "kvm-intel" ];
22
32
boot.kernelParams = [
···
1
1
-
{ config, pkgs, lib, ... }: let
1
1
+
{
2
2
+
config,
3
3
+
pkgs,
4
4
+
lib,
5
5
+
...
6
6
+
}:
7
7
+
let
2
8
torrentport = 56709; # port forwarded in airvpn webinterface
3
3
-
in {
9
9
+
in
10
10
+
{
4
11
imports = [
5
12
../../2configs
6
13
../../2configs/retiolum.nix
···
11
18
12
19
# we need to configure another port for the mycelium admin interface, because it conflicts with sonarr.
13
20
services.mycelium.extraArgs = [
14
14
-
"--api-addr" "127.0.0.1:9898"
21
21
+
"--api-addr"
22
22
+
"127.0.0.1:9898"
15
23
];
16
24
17
25
services.transmission.settings.peer-port = torrentport;
···
58
66
ip link set airvpn netns transmission
59
67
ip -n transmission addr add 10.176.43.231/32 dev airvpn
60
68
ip -n transmission addr add fd7d:76ee:e68f:a993:41b3:846b:d271:30d8/128 dev airvpn
61
61
-
ip netns exec transmission wg syncconf airvpn <(wg-quick strip ${config.clanCore.facts.services.airvpn.secret."airvpn.conf".path})
69
69
+
ip netns exec transmission wg syncconf airvpn <(wg-quick strip ${
70
70
+
config.clanCore.facts.services.airvpn.secret."airvpn.conf".path
71
71
+
})
62
72
ip -n transmission link set airvpn up
63
73
ip -n transmission route add default dev airvpn
64
74
ip -6 -n transmission route add default dev airvpn
···
114
124
clanCore.facts.services.yellow-container = {
115
125
secret."yellow.sync.key" = { };
116
126
public."yellow.sync.pub" = { };
117
117
-
generator.path = with pkgs; [ coreutils openssh ];
127
127
+
generator.path = with pkgs; [
128
128
+
coreutils
129
129
+
openssh
130
130
+
];
118
131
generator.script = ''
119
132
ssh-keygen -t ed25519 -N "" -f "$secrets"/yellow.sync.key
120
133
mv "$secrets"/yellow.sync.key "$facts"/yellow.sync.pub
···
1
1
-
{ inputs , ... }:
1
1
+
{ ... }:
2
2
{
3
3
-
perSystem = { system, lib, pkgs, ... }: let
4
4
-
nvim-appname = "lassvim";
3
3
+
perSystem =
4
4
+
{
5
5
+
system,
6
6
+
lib,
7
7
+
pkgs,
8
8
+
...
9
9
+
}:
10
10
+
let
11
11
+
nvim-appname = "lassvim";
5
12
6
6
-
lsp-packages = with pkgs; [
7
7
-
nodejs # copilot
8
8
-
terraform-ls
9
9
-
pyright
10
10
-
11
11
-
# based on ./suggested-pkgs.json
12
12
-
gopls
13
13
-
golangci-lint
14
14
-
nodePackages.bash-language-server
15
15
-
taplo-lsp
16
16
-
marksman
17
17
-
selene
18
18
-
rust-analyzer
19
19
-
yaml-language-server
20
20
-
nil
21
21
-
shellcheck
22
22
-
shfmt
23
23
-
ruff
24
24
-
ruff-lsp
25
25
-
nixfmt-rfc-style
26
26
-
terraform-ls
27
27
-
clang-tools
28
28
-
nodePackages.prettier
29
29
-
stylua
30
30
-
# based on https://github.com/ray-x/go.nvim#go-binaries-install-and-update
31
31
-
go
32
32
-
gofumpt
33
33
-
gomodifytags
34
34
-
gotools
35
35
-
delve
36
36
-
golines
37
37
-
gomodifytags
38
38
-
gotests
39
39
-
iferr
40
40
-
impl
41
41
-
reftools
42
42
-
ginkgo
43
43
-
richgo
44
44
-
govulncheck
45
45
-
46
46
-
#ocaml-ng.ocamlPackages_5_0.ocaml-lsp
47
47
-
#ocaml-ng.ocamlPackages_5_0.ocamlformat
48
48
-
# does not build yet on aarch64
49
49
-
] ++ lib.optional (pkgs.stdenv.hostPlatform.system == "x86_64-linux") pkgs.deno
50
50
-
++ lib.optional (!pkgs.stdenv.hostPlatform.isDarwin) sumneko-lua-language-server;
13
13
+
lsp-packages =
14
14
+
with pkgs;
15
15
+
[
16
16
+
nodejs # copilot
17
17
+
terraform-ls
18
18
+
pyright
51
19
52
52
-
lspEnv = pkgs.buildEnv {
53
53
-
name = "lspEnv";
54
54
-
paths = lsp-packages;
20
20
+
# based on ./suggested-pkgs.json
21
21
+
gopls
22
22
+
golangci-lint
23
23
+
nodePackages.bash-language-server
24
24
+
taplo-lsp
25
25
+
marksman
26
26
+
selene
27
27
+
rust-analyzer
28
28
+
yaml-language-server
29
29
+
nil
30
30
+
shellcheck
31
31
+
shfmt
32
32
+
ruff
33
33
+
ruff-lsp
34
34
+
nixfmt-rfc-style
35
35
+
terraform-ls
36
36
+
clang-tools
37
37
+
nodePackages.prettier
38
38
+
stylua
39
39
+
# based on https://github.com/ray-x/go.nvim#go-binaries-install-and-update
40
40
+
go
41
41
+
gofumpt
42
42
+
gomodifytags
43
43
+
gotools
44
44
+
delve
45
45
+
golines
46
46
+
gomodifytags
47
47
+
gotests
48
48
+
iferr
49
49
+
impl
50
50
+
reftools
51
51
+
ginkgo
52
52
+
richgo
53
53
+
govulncheck
54
54
+
55
55
+
#ocaml-ng.ocamlPackages_5_0.ocaml-lsp
56
56
+
#ocaml-ng.ocamlPackages_5_0.ocamlformat
57
57
+
# does not build yet on aarch64
58
58
+
]
59
59
+
++ lib.optional (pkgs.stdenv.hostPlatform.system == "x86_64-linux") pkgs.deno
60
60
+
++ lib.optional (!pkgs.stdenv.hostPlatform.isDarwin) sumneko-lua-language-server;
61
61
+
62
62
+
lspEnv = pkgs.buildEnv {
63
63
+
name = "lspEnv";
64
64
+
paths = lsp-packages;
65
65
+
};
66
66
+
67
67
+
treesitter-grammars =
68
68
+
let
69
69
+
grammars = lib.filterAttrs (
70
70
+
n: _: lib.hasPrefix "tree-sitter-" n
71
71
+
) pkgs.vimPlugins.nvim-treesitter.builtGrammars;
72
72
+
symlinks = lib.mapAttrsToList (
73
73
+
name: grammar: "ln -s ${grammar}/parser $out/${lib.removePrefix "tree-sitter-" name}.so"
74
74
+
) grammars;
75
75
+
in
76
76
+
(pkgs.runCommand "treesitter-grammars" { } ''
77
77
+
mkdir -p $out
78
78
+
${lib.concatStringsSep "\n" symlinks}
79
79
+
'').overrideAttrs
80
80
+
(_: {
81
81
+
passthru.rev = pkgs.vimPlugins.nvim-treesitter.src.rev;
82
82
+
});
83
83
+
84
84
+
in
85
85
+
{
86
86
+
packages.vim = pkgs.writeShellScriptBin "vim" ''
87
87
+
set -efux
88
88
+
unset VIMINIT
89
89
+
export PATH=${lspEnv}/bin:$PATH
90
90
+
export NVIM_APPNAME=${nvim-appname}
91
91
+
92
92
+
XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config}
93
93
+
XDG_DATA_HOME=''${XDG_DATA_HOME:-$HOME/.local/share}
94
94
+
95
95
+
mkdir -p "$XDG_CONFIG_HOME/$NVIM_APPNAME" "$XDG_DATA_HOME"
96
96
+
chmod -R u+w "$XDG_CONFIG_HOME/$NVIM_APPNAME"
97
97
+
rm -rf "$XDG_CONFIG_HOME/$NVIM_APPNAME"
98
98
+
${pkgs.coreutils}/bin/cp -arfT '${./config}'/ "$XDG_CONFIG_HOME/$NVIM_APPNAME"
99
99
+
chmod -R u+w "$XDG_CONFIG_HOME/$NVIM_APPNAME"
100
100
+
echo "${treesitter-grammars.rev}" > "$XDG_CONFIG_HOME/$NVIM_APPNAME/treesitter-rev"
101
101
+
102
102
+
${pkgs.neovim}/bin/nvim --headless -c 'quitall' # install plugins
103
103
+
mkdir -p "$XDG_DATA_HOME/$NVIM_APPNAME/lib/" "$XDG_DATA_HOME/$NVIM_APPNAME/site/"
104
104
+
${pkgs.coreutils}/bin/ln -sfT "${pkgs.vimPlugins.telescope-fzf-native-nvim}/build/libfzf.so" "$XDG_DATA_HOME/$NVIM_APPNAME/lib/libfzf.so"
105
105
+
${pkgs.coreutils}/bin/ln -sfT "${treesitter-grammars}" "$XDG_DATA_HOME/$NVIM_APPNAME/site/parser"
106
106
+
exec ${pkgs.neovim}/bin/nvim "$@"
107
107
+
'';
55
108
};
56
56
-
57
57
-
treesitter-grammars = pkgs.runCommand "treesitter-grammars" { } (
58
58
-
lib.concatMapStringsSep "\n" (grammar: ''
59
59
-
mkdir -p $out
60
60
-
ln -s $(readlink -f ${grammar}/parser/*.so) $out/${lib.last (builtins.split "-" grammar.name)}.so
61
61
-
'') pkgs.vimPlugins.nvim-treesitter.withAllGrammars.dependencies
62
62
-
);
63
63
-
64
64
-
in {
65
65
-
packages.vim = pkgs.writeShellScriptBin "vim" ''
66
66
-
set -efux
67
67
-
unset VIMINIT
68
68
-
export PATH=${lspEnv}/bin:$PATH
69
69
-
export NVIM_APPNAME=${nvim-appname}
70
70
-
71
71
-
XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config}
72
72
-
XDG_DATA_HOME=''${XDG_DATA_HOME:-$HOME/.local/share}
73
73
-
74
74
-
mkdir -p "$XDG_CONFIG_HOME/$NVIM_APPNAME" "$XDG_DATA_HOME"
75
75
-
chmod -R u+w "$XDG_CONFIG_HOME/$NVIM_APPNAME"
76
76
-
rm -rf "$XDG_CONFIG_HOME/$NVIM_APPNAME"
77
77
-
${pkgs.coreutils}/bin/cp -arfT '${./config}'/ "$XDG_CONFIG_HOME/$NVIM_APPNAME"
78
78
-
chmod -R u+w "$XDG_CONFIG_HOME/$NVIM_APPNAME"
79
79
-
${pkgs.neovim}/bin/nvim --headless -c 'quitall' # install plugins
80
80
-
mkdir -p "$XDG_DATA_HOME/$NVIM_APPNAME/lib/" "$XDG_DATA_HOME/$NVIM_APPNAME/site/"
81
81
-
${pkgs.coreutils}/bin/ln -sfT "${pkgs.vimPlugins.telescope-fzf-native-nvim}/build/libfzf.so" "$XDG_DATA_HOME/$NVIM_APPNAME/lib/libfzf.so"
82
82
-
${pkgs.coreutils}/bin/ln -sfT "${treesitter-grammars}" "$XDG_DATA_HOME/$NVIM_APPNAME/site/parser"
83
83
-
exec ${pkgs.neovim}/bin/nvim "$@"
84
84
-
'';
85
85
-
};
86
109
}
···
1
1
-
{ self, pkgs, lib, ... }:
1
1
+
{
2
2
+
self,
3
3
+
pkgs,
4
4
+
lib,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
../../alacritty.nix
···
27
32
freeMemThreshold = 5;
28
33
};
29
34
30
30
-
users.users.mainUser.extraGroups = [ "audio" "pipewire" "video" "input" ];
35
35
+
users.users.mainUser.extraGroups = [
36
36
+
"audio"
37
37
+
"pipewire"
38
38
+
"video"
39
39
+
"input"
40
40
+
];
31
41
32
42
xdg.portal.enable = true;
33
43
xdg.portal.wlr.enable = true;
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
../../alacritty.nix
···
18
23
lass ALL= (root) NOPASSWD:SETENV: ${pkgs.sshuttle}/bin/.sshuttle-wrapped
19
24
'';
20
25
}
21
21
-
{ #font magic
26
26
+
{
27
27
+
#font magic
22
28
options.lass.fonts = {
23
29
regular = lib.mkOption {
24
30
type = lib.types.str;
···
41
47
}
42
48
];
43
49
44
44
-
users.users.mainUser.extraGroups = [ "audio" "pipewire" "video" ];
50
50
+
users.users.mainUser.extraGroups = [
51
51
+
"audio"
52
52
+
"pipewire"
53
53
+
"video"
54
54
+
];
45
55
46
56
time.timeZone = "Europe/Berlin";
47
57
···
131
141
};
132
142
};
133
143
134
134
-
nixpkgs.config.packageOverrides = super: {
144
144
+
nixpkgs.config.packageOverrides = _super: {
135
145
dmenu = pkgs.writers.writeDashBin "dmenu" ''
136
146
${pkgs.fzfmenu}/bin/fzfmenu "$@"
137
147
'';
···
1
1
-
{ config, lib, pkgs, ... }: let
1
1
+
{ pkgs, ... }:
2
2
+
let
2
3
3
4
term = "/run/current-system/sw/bin/alacritty";
4
5
5
5
-
in {
6
6
+
in
7
7
+
{
6
8
imports = [
7
9
../lib/wayland.nix
8
10
];
···
266
268
systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr
267
269
''}
268
270
269
269
-
exec_always ${let
270
270
-
schema = pkgs.gsettings-desktop-schemas;
271
271
-
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
272
272
-
in pkgs.writers.writeDash "gsettings" ''
271
271
+
exec_always ${pkgs.writers.writeDash "gsettings" ''
273
272
set -efux
274
273
export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}:$XDG_DATA_DIRS
275
274
gnome_schema=org.gnome.desktop.interface
···
1
1
-
{ self, config, lib, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
lib,
5
5
+
pkgs,
6
6
+
...
7
7
+
}:
2
8
3
9
{
4
10
imports = [
···
10
16
hs.extra
11
17
hs.xmonad-contrib
12
18
];
13
13
-
config = /* haskell */ ''
14
14
-
{-# LANGUAGE LambdaCase #-}
19
19
+
config = # haskell
20
20
+
''
21
21
+
{-# LANGUAGE LambdaCase #-}
15
22
16
23
17
17
-
module Main where
18
18
-
import XMonad
24
24
+
module Main where
25
25
+
import XMonad
19
26
20
20
-
import qualified XMonad.StackSet as W
21
21
-
import Control.Monad.Extra (whenJustM)
22
22
-
import Data.List (isInfixOf)
23
23
-
import Data.Monoid (Endo)
24
24
-
import System.Environment (getArgs, lookupEnv)
25
25
-
import System.Exit (exitFailure)
26
26
-
import System.IO (hPutStrLn, stderr)
27
27
-
import System.Posix.Process (executeFile)
28
28
-
import Data.Ratio
27
27
+
import qualified XMonad.StackSet as W
28
28
+
import Control.Monad.Extra (whenJustM)
29
29
+
import Data.List (isInfixOf)
30
30
+
import Data.Monoid (Endo)
31
31
+
import System.Environment (getArgs, lookupEnv)
32
32
+
import System.Exit (exitFailure)
33
33
+
import System.IO (hPutStrLn, stderr)
34
34
+
import System.Posix.Process (executeFile)
35
35
+
import Data.Ratio
29
36
30
30
-
import XMonad.Actions.Commands (defaultCommands, runCommand)
31
31
-
import XMonad.Actions.CopyWindow (copy, copyToAll, kill1)
32
32
-
import XMonad.Actions.CycleWS (toggleWS)
33
33
-
import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace, removeEmptyWorkspace)
34
34
-
import XMonad.Actions.DynamicWorkspaces (withWorkspace)
35
35
-
import XMonad.Actions.GridSelect (GSConfig(..), gridselectWorkspace, navNSearch)
36
36
-
import XMonad.Actions.Minimize (minimizeWindow, maximizeWindow, withLastMinimized)
37
37
-
import XMonad.Hooks.EwmhDesktops (ewmh)
38
38
-
import XMonad.Hooks.FloatNext (floatNext)
39
39
-
import XMonad.Hooks.FloatNext (floatNextHook)
40
40
-
import XMonad.Hooks.ManageDocks (avoidStruts, ToggleStruts(ToggleStruts))
41
41
-
import XMonad.Hooks.ManageHelpers (doCenterFloat, doRectFloat, (-?>))
42
42
-
import XMonad.Hooks.Place (placeHook, smart)
43
43
-
import XMonad.Hooks.UrgencyHook (focusUrgent)
44
44
-
import XMonad.Hooks.UrgencyHook (withUrgencyHook, UrgencyHook(..))
45
45
-
import XMonad.Layout.BoringWindows (boringWindows, focusDown, focusUp)
46
46
-
import XMonad.Layout.FixedColumn (FixedColumn(..))
47
47
-
import XMonad.Layout.Grid (Grid(..))
48
48
-
import XMonad.Layout.Minimize (minimize)
49
49
-
import XMonad.Layout.NoBorders (smartBorders, noBorders)
50
50
-
import XMonad.Layout.MouseResizableTile (mouseResizableTile)
51
51
-
import XMonad.Layout.SimplestFloat (simplestFloat)
52
52
-
import XMonad.Layout.StateFull
53
53
-
import XMonad.ManageHook (composeAll)
54
54
-
import XMonad.Prompt (autoComplete, font, height, searchPredicate, XPConfig)
55
55
-
import XMonad.Util.EZConfig (additionalKeysP)
56
56
-
import XMonad.Util.NamedWindows (getName)
57
57
-
import XMonad.Util.Run (safeSpawn)
58
58
-
import XMonad.Util.Ungrab (unGrab)
59
59
-
import XMonad.Util.Paste (sendKey)
37
37
+
import XMonad.Actions.Commands (defaultCommands, runCommand)
38
38
+
import XMonad.Actions.CopyWindow (copy, copyToAll, kill1)
39
39
+
import XMonad.Actions.CycleWS (toggleWS)
40
40
+
import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace, removeEmptyWorkspace)
41
41
+
import XMonad.Actions.DynamicWorkspaces (withWorkspace)
42
42
+
import XMonad.Actions.GridSelect (GSConfig(..), gridselectWorkspace, navNSearch)
43
43
+
import XMonad.Actions.Minimize (minimizeWindow, maximizeWindow, withLastMinimized)
44
44
+
import XMonad.Hooks.EwmhDesktops (ewmh)
45
45
+
import XMonad.Hooks.FloatNext (floatNext)
46
46
+
import XMonad.Hooks.FloatNext (floatNextHook)
47
47
+
import XMonad.Hooks.ManageDocks (avoidStruts, ToggleStruts(ToggleStruts))
48
48
+
import XMonad.Hooks.ManageHelpers (doCenterFloat, doRectFloat, (-?>))
49
49
+
import XMonad.Hooks.Place (placeHook, smart)
50
50
+
import XMonad.Hooks.UrgencyHook (focusUrgent)
51
51
+
import XMonad.Hooks.UrgencyHook (withUrgencyHook, UrgencyHook(..))
52
52
+
import XMonad.Layout.BoringWindows (boringWindows, focusDown, focusUp)
53
53
+
import XMonad.Layout.FixedColumn (FixedColumn(..))
54
54
+
import XMonad.Layout.Grid (Grid(..))
55
55
+
import XMonad.Layout.Minimize (minimize)
56
56
+
import XMonad.Layout.NoBorders (smartBorders, noBorders)
57
57
+
import XMonad.Layout.MouseResizableTile (mouseResizableTile)
58
58
+
import XMonad.Layout.SimplestFloat (simplestFloat)
59
59
+
import XMonad.Layout.StateFull
60
60
+
import XMonad.ManageHook (composeAll)
61
61
+
import XMonad.Prompt (autoComplete, font, height, searchPredicate, XPConfig)
62
62
+
import XMonad.Util.EZConfig (additionalKeysP)
63
63
+
import XMonad.Util.NamedWindows (getName)
64
64
+
import XMonad.Util.Run (safeSpawn)
65
65
+
import XMonad.Util.Ungrab (unGrab)
66
66
+
import XMonad.Util.Paste (sendKey)
60
67
61
61
-
data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show)
68
68
+
data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show)
62
69
63
63
-
instance UrgencyHook LibNotifyUrgencyHook where
64
64
-
urgencyHook LibNotifyUrgencyHook w = do
65
65
-
name <- getName w
66
66
-
Just idx <- fmap (W.findTag w) $ gets windowset
70
70
+
instance UrgencyHook LibNotifyUrgencyHook where
71
71
+
urgencyHook LibNotifyUrgencyHook w = do
72
72
+
name <- getName w
73
73
+
Just idx <- fmap (W.findTag w) $ gets windowset
67
74
68
68
-
safeSpawn "${pkgs.libnotify}/bin/notify-send" [show name, "workspace " ++ idx]
75
75
+
safeSpawn "${pkgs.libnotify}/bin/notify-send" [show name, "workspace " ++ idx]
69
76
70
70
-
myTerm :: FilePath
71
71
-
myTerm = "/run/current-system/sw/bin/alacritty"
77
77
+
myTerm :: FilePath
78
78
+
myTerm = "/run/current-system/sw/bin/alacritty"
72
79
73
73
-
myFont :: String
74
74
-
myFont = "${config.lass.fonts.regular}"
80
80
+
myFont :: String
81
81
+
myFont = "${config.lass.fonts.regular}"
75
82
76
76
-
main :: IO ()
77
77
-
main = do
78
78
-
xmonad $ ewmh
79
79
-
$ withUrgencyHook LibNotifyUrgencyHook
80
80
-
$ def
81
81
-
{ terminal = myTerm
82
82
-
, modMask = mod4Mask
83
83
-
, layoutHook = myLayoutHook
84
84
-
, manageHook = floatHooks
85
85
-
, startupHook =
86
86
-
whenJustM (liftIO (lookupEnv "XMONAD_STARTUP_HOOK"))
87
87
-
(\path -> forkFile path [] Nothing)
88
88
-
, normalBorderColor = "#1c1c1c"
89
89
-
, focusedBorderColor = "#ff0000"
90
90
-
, workspaces = [ "dashboard", "sys", "wp" ]
91
91
-
} `additionalKeysP` myKeyMap
83
83
+
main :: IO ()
84
84
+
main = do
85
85
+
xmonad $ ewmh
86
86
+
$ withUrgencyHook LibNotifyUrgencyHook
87
87
+
$ def
88
88
+
{ terminal = myTerm
89
89
+
, modMask = mod4Mask
90
90
+
, layoutHook = myLayoutHook
91
91
+
, manageHook = floatHooks
92
92
+
, startupHook =
93
93
+
whenJustM (liftIO (lookupEnv "XMONAD_STARTUP_HOOK"))
94
94
+
(\path -> forkFile path [] Nothing)
95
95
+
, normalBorderColor = "#1c1c1c"
96
96
+
, focusedBorderColor = "#ff0000"
97
97
+
, workspaces = [ "dashboard", "sys", "wp" ]
98
98
+
} `additionalKeysP` myKeyMap
92
99
93
93
-
myLayoutHook = defLayout
94
94
-
where
95
95
-
defLayout = smartBorders $
96
96
-
minimize .
97
97
-
boringWindows $
98
98
-
(
99
99
-
noBorders StateFull |||
100
100
-
(avoidStruts $ Mirror (Tall 1 (3/100) (1/2))) |||
101
101
-
FixedColumn 2 80 80 1 |||
102
102
-
Tall 1 (3/100) (1/2) |||
103
103
-
simplestFloat |||
104
104
-
mouseResizableTile |||
105
105
-
Grid
106
106
-
)
100
100
+
myLayoutHook = defLayout
101
101
+
where
102
102
+
defLayout = smartBorders $
103
103
+
minimize .
104
104
+
boringWindows $
105
105
+
(
106
106
+
noBorders StateFull |||
107
107
+
(avoidStruts $ Mirror (Tall 1 (3/100) (1/2))) |||
108
108
+
FixedColumn 2 80 80 1 |||
109
109
+
Tall 1 (3/100) (1/2) |||
110
110
+
simplestFloat |||
111
111
+
mouseResizableTile |||
112
112
+
Grid
113
113
+
)
107
114
108
108
-
floatHooks = composeAll
109
109
-
[ className =? "Pinentry" --> doCenterFloat
110
110
-
, className =? "Pager" --> doCenterFloat
111
111
-
, title =? "pager" --> doCenterFloat
112
112
-
, title =? "fzfmenu" --> doCenterFloat
113
113
-
, title =? "glxgears" --> doCenterFloat
114
114
-
, resource =? "Dialog" --> doFloat
115
115
-
, title =? "Upload to Imgur" -->
116
116
-
doRectFloat (W.RationalRect 0 0 (1 % 8) (1 % 8))
117
117
-
, placeHook (smart (1,0))
118
118
-
, floatNextHook
119
119
-
]
115
115
+
floatHooks = composeAll
116
116
+
[ className =? "Pinentry" --> doCenterFloat
117
117
+
, className =? "Pager" --> doCenterFloat
118
118
+
, title =? "pager" --> doCenterFloat
119
119
+
, title =? "fzfmenu" --> doCenterFloat
120
120
+
, title =? "glxgears" --> doCenterFloat
121
121
+
, resource =? "Dialog" --> doFloat
122
122
+
, title =? "Upload to Imgur" -->
123
123
+
doRectFloat (W.RationalRect 0 0 (1 % 8) (1 % 8))
124
124
+
, placeHook (smart (1,0))
125
125
+
, floatNextHook
126
126
+
]
120
127
121
121
-
myKeyMap :: [([Char], X ())]
122
122
-
myKeyMap =
123
123
-
[ ("M4-p", forkFile "${pkgs.writers.writeDash "passmenu-wrapped" ''
124
124
-
set -efux
125
125
-
export TERM=dumb
126
126
-
${pkgs.pass}/bin/passmenu --type
127
127
-
''}" [] Nothing)
128
128
+
myKeyMap :: [([Char], X ())]
129
129
+
myKeyMap =
130
130
+
[ ("M4-p", forkFile "${pkgs.writers.writeDash "passmenu-wrapped" ''
131
131
+
set -efux
132
132
+
export TERM=dumb
133
133
+
${pkgs.pass}/bin/passmenu --type
134
134
+
''}" [] Nothing)
128
135
129
129
-
, ("M4-S-p", forkFile "${self.packages.${pkgs.system}.otpmenu}/bin/otpmenu" [] Nothing)
136
136
+
, ("M4-S-p", forkFile "${self.packages.${pkgs.system}.otpmenu}/bin/otpmenu" [] Nothing)
130
137
131
131
-
, ("M4-S-q", restart "xmonad" True)
138
138
+
, ("M4-S-q", restart "xmonad" True)
132
139
133
133
-
, ("<XF86AudioMute>", spawn "${pkgs.pulseaudio.out}/bin/pactl -- set-sink-mute @DEFAULT_SINK@ toggle")
134
134
-
, ("<XF86AudioRaiseVolume>", spawn "${pkgs.pulseaudio.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ +4%")
135
135
-
, ("<XF86AudioLowerVolume>", spawn "${pkgs.pulseaudio.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ -4%")
136
136
-
, ("<XF86MonBrightnessDown>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -dec 1")
137
137
-
, ("<XF86MonBrightnessUp>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -inc 1")
138
138
-
, ("M4-C-k", spawn "${pkgs.xorg.xkill}/bin/xkill")
140
140
+
, ("<XF86AudioMute>", spawn "${pkgs.pulseaudio.out}/bin/pactl -- set-sink-mute @DEFAULT_SINK@ toggle")
141
141
+
, ("<XF86AudioRaiseVolume>", spawn "${pkgs.pulseaudio.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ +4%")
142
142
+
, ("<XF86AudioLowerVolume>", spawn "${pkgs.pulseaudio.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ -4%")
143
143
+
, ("<XF86MonBrightnessDown>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -dec 1")
144
144
+
, ("<XF86MonBrightnessUp>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -inc 1")
145
145
+
, ("M4-C-k", spawn "${pkgs.xorg.xkill}/bin/xkill")
139
146
140
140
-
, ("M4-<Tab>", focusDown)
141
141
-
, ("M4-S-<Tab>", focusUp)
142
142
-
, ("M4-j", focusDown)
143
143
-
, ("M4-k", focusUp)
147
147
+
, ("M4-<Tab>", focusDown)
148
148
+
, ("M4-S-<Tab>", focusUp)
149
149
+
, ("M4-j", focusDown)
150
150
+
, ("M4-k", focusUp)
144
151
145
145
-
, ("M4-a", focusUrgent)
146
146
-
, ("M4-S-r", renameWorkspace myXPConfig)
147
147
-
, ("M4-S-a", addWorkspacePrompt myXPConfig)
148
148
-
, ("M4-S-<Backspace>", removeEmptyWorkspace)
149
149
-
, ("M4-S-c", kill1)
150
150
-
, ("M4-<Esc>", toggleWS)
151
151
-
, ("M4-S-<Enter>", spawn myTerm)
152
152
-
, ("M4-x", floatNext True >> spawn myTerm)
153
153
-
, ("M4-c", spawn "/run/current-system/sw/bin/emacsclient -c")
154
154
-
-- , ("M4-c", unGrab)
155
155
-
, ("M4-f", floatNext True)
156
156
-
, ("M4-b", spawn "/run/current-system/sw/bin/klem")
152
152
+
, ("M4-a", focusUrgent)
153
153
+
, ("M4-S-r", renameWorkspace myXPConfig)
154
154
+
, ("M4-S-a", addWorkspacePrompt myXPConfig)
155
155
+
, ("M4-S-<Backspace>", removeEmptyWorkspace)
156
156
+
, ("M4-S-c", kill1)
157
157
+
, ("M4-<Esc>", toggleWS)
158
158
+
, ("M4-S-<Enter>", spawn myTerm)
159
159
+
, ("M4-x", floatNext True >> spawn myTerm)
160
160
+
, ("M4-c", spawn "/run/current-system/sw/bin/emacsclient -c")
161
161
+
-- , ("M4-c", unGrab)
162
162
+
, ("M4-f", floatNext True)
163
163
+
, ("M4-b", spawn "/run/current-system/sw/bin/klem")
157
164
158
158
-
, ("M4-c", defaultCommands >>= runCommand)
159
159
-
, ("M4-v", withWorkspace autoXPConfig (windows . W.greedyView))
160
160
-
, ("M4-S-v", withWorkspace autoXPConfig (windows . W.shift))
161
161
-
, ("M4-C-v", withWorkspace autoXPConfig (windows . copy))
165
165
+
, ("M4-c", defaultCommands >>= runCommand)
166
166
+
, ("M4-v", withWorkspace autoXPConfig (windows . W.greedyView))
167
167
+
, ("M4-S-v", withWorkspace autoXPConfig (windows . W.shift))
168
168
+
, ("M4-C-v", withWorkspace autoXPConfig (windows . copy))
162
169
163
163
-
, ("M4-m", withFocused minimizeWindow)
164
164
-
, ("M4-S-m", withLastMinimized maximizeWindow)
170
170
+
, ("M4-m", withFocused minimizeWindow)
171
171
+
, ("M4-S-m", withLastMinimized maximizeWindow)
165
172
166
166
-
, ("M4-S-q", return ())
173
173
+
, ("M4-S-q", return ())
167
174
168
168
-
, ("M4-d", floatNext True >> spawn "${pkgs.writers.writeDash "clipmenu" ''
169
169
-
PATH=${lib.makeBinPath [
170
170
-
pkgs.coreutils
171
171
-
pkgs.gawk
172
172
-
pkgs.dmenu
173
173
-
]}
174
174
-
${pkgs.clipmenu}/bin/clipmenu
175
175
-
''}")
175
175
+
, ("M4-d", floatNext True >> spawn "${pkgs.writers.writeDash "clipmenu" ''
176
176
+
PATH=${
177
177
+
lib.makeBinPath [
178
178
+
pkgs.coreutils
179
179
+
pkgs.gawk
180
180
+
pkgs.dmenu
181
181
+
]
182
182
+
}
183
183
+
${pkgs.clipmenu}/bin/clipmenu
184
184
+
''}")
176
185
177
177
-
, ("M4-<Insert>", spawn "${pkgs.writers.writeDash "paste" ''
178
178
-
${pkgs.coreutils}/bin/sleep 0.4
179
179
-
${pkgs.xclip}/bin/xclip -o | ${pkgs.xdotool}/bin/xdotool type -f -
180
180
-
''}")
186
186
+
, ("M4-<Insert>", spawn "${pkgs.writers.writeDash "paste" ''
187
187
+
${pkgs.coreutils}/bin/sleep 0.4
188
188
+
${pkgs.xclip}/bin/xclip -o | ${pkgs.xdotool}/bin/xdotool type -f -
189
189
+
''}")
181
190
182
182
-
, ("M4-<F1>", spawn "/run/current-system/sw/bin/gamepad_mouse_toggle")
183
183
-
, ("M4-<F2>", windows copyToAll)
184
184
-
, ("M4-<F5>", spawn "${pkgs.acpilight}/bin/xbacklight -set 1")
185
185
-
, ("M4-<F6>", spawn "${pkgs.acpilight}/bin/xbacklight -set 10")
186
186
-
, ("M4-<F7>", spawn "${pkgs.acpilight}/bin/xbacklight -set 33")
187
187
-
, ("M4-<F8>", spawn "${pkgs.acpilight}/bin/xbacklight -set 100")
191
191
+
, ("M4-<F1>", spawn "/run/current-system/sw/bin/gamepad_mouse_toggle")
192
192
+
, ("M4-<F2>", windows copyToAll)
193
193
+
, ("M4-<F5>", spawn "${pkgs.acpilight}/bin/xbacklight -set 1")
194
194
+
, ("M4-<F6>", spawn "${pkgs.acpilight}/bin/xbacklight -set 10")
195
195
+
, ("M4-<F7>", spawn "${pkgs.acpilight}/bin/xbacklight -set 33")
196
196
+
, ("M4-<F8>", spawn "${pkgs.acpilight}/bin/xbacklight -set 100")
188
197
189
189
-
, ("M4-<F9>", spawn "${pkgs.redshift}/bin/redshift -O 4000 -g 0.9:0.8:0.8")
190
190
-
, ("M4-<F10>", spawn "${pkgs.redshift}/bin/redshift -x")
198
198
+
, ("M4-<F9>", spawn "${pkgs.redshift}/bin/redshift -O 4000 -g 0.9:0.8:0.8")
199
199
+
, ("M4-<F10>", spawn "${pkgs.redshift}/bin/redshift -x")
191
200
192
192
-
, ("M4-<F11>", spawn "${config.lass.screenlock.command}")
201
201
+
, ("M4-<F11>", spawn "${config.lass.screenlock.command}")
193
202
194
194
-
, ("M4-u", spawn "${pkgs.xcalib}/bin/xcalib -invert -alter")
195
195
-
, ("M4-y", spawn "/run/current-system/sw/bin/switch-theme toggle")
203
203
+
, ("M4-u", spawn "${pkgs.xcalib}/bin/xcalib -invert -alter")
204
204
+
, ("M4-y", spawn "/run/current-system/sw/bin/switch-theme toggle")
196
205
197
197
-
${lib.optionalString (builtins.hasAttr "warpd" pkgs) '', ("M4-s", spawn "${pkgs.warpd}/bin/warpd --hint")''}
198
198
-
, ("M4-i", spawn "/run/current-system/sw/bin/screenshot")
206
206
+
${lib.optionalString (builtins.hasAttr "warpd" pkgs) '', ("M4-s", spawn "${pkgs.warpd}/bin/warpd --hint")''}
207
207
+
, ("M4-i", spawn "/run/current-system/sw/bin/screenshot")
199
208
200
200
-
--, ("M4-w", screenWorkspace 0 >>= (windows . W.greedyView))
201
201
-
--, ("M4-e", screenWorkspace 1 >>= (windows . W.greedyView))
202
202
-
--, ("M4-r", screenWorkspace 2 >>= (windows . W.greedyView))
203
203
-
]
209
209
+
--, ("M4-w", screenWorkspace 0 >>= (windows . W.greedyView))
210
210
+
--, ("M4-e", screenWorkspace 1 >>= (windows . W.greedyView))
211
211
+
--, ("M4-r", screenWorkspace 2 >>= (windows . W.greedyView))
212
212
+
]
204
213
205
205
-
forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
206
206
-
forkFile path args env =
207
207
-
xfork (executeFile path True args env) >> return ()
214
214
+
forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
215
215
+
forkFile path args env =
216
216
+
xfork (executeFile path True args env) >> return ()
208
217
209
209
-
myXPConfig :: XPConfig
210
210
-
myXPConfig = def
211
211
-
{ font = myFont
212
212
-
, height = 40
213
213
-
}
218
218
+
myXPConfig :: XPConfig
219
219
+
myXPConfig = def
220
220
+
{ font = myFont
221
221
+
, height = 40
222
222
+
}
214
223
215
215
-
autoXPConfig :: XPConfig
216
216
-
autoXPConfig = myXPConfig
217
217
-
{ autoComplete = Just 5000
218
218
-
}
224
224
+
autoXPConfig :: XPConfig
225
225
+
autoXPConfig = myXPConfig
226
226
+
{ autoComplete = Just 5000
227
227
+
}
219
228
220
220
-
infixAutoXPConfig :: XPConfig
221
221
-
infixAutoXPConfig = autoXPConfig
222
222
-
{ searchPredicate = isInfixOf
223
223
-
}
229
229
+
infixAutoXPConfig :: XPConfig
230
230
+
infixAutoXPConfig = autoXPConfig
231
231
+
{ searchPredicate = isInfixOf
232
232
+
}
224
233
225
225
-
gridConfig :: GSConfig WorkspaceId
226
226
-
gridConfig = def
227
227
-
{ gs_cellwidth = 100
228
228
-
, gs_cellheight = 30
229
229
-
, gs_cellpadding = 2
230
230
-
, gs_navigate = navNSearch
231
231
-
, gs_font = myFont
232
232
-
}
234
234
+
gridConfig :: GSConfig WorkspaceId
235
235
+
gridConfig = def
236
236
+
{ gs_cellwidth = 100
237
237
+
, gs_cellheight = 30
238
238
+
, gs_cellpadding = 2
239
239
+
, gs_navigate = navNSearch
240
240
+
, gs_font = myFont
241
241
+
}
233
242
234
234
-
'';
243
243
+
'';
235
244
};
236
245
}
···
1
1
-
{ pkgs, ... }: let
1
1
+
{ pkgs, ... }:
2
2
+
let
2
3
3
4
prosody-contrib-plugins = pkgs.fetchFromGitHub {
4
5
owner = "jitsi-contrib";
···
7
8
sha256 = "sha256-1Lmj+ZWqZRRvHVgNDXXEqH2DwhE7TwP0gktjihJCg1g=";
8
9
};
9
10
10
10
-
in {
11
11
+
in
12
12
+
{
11
13
14
14
+
nixpkgs.config.permittedInsecurePackages = [
15
15
+
"jitsi-meet-1.0.8043"
16
16
+
];
12
17
services.jitsi-meet = {
13
18
enable = true;
14
19
hostName = "jitsi.lassul.us";
···
16
21
enableWelcomePage = true;
17
22
requireDisplayName = true;
18
23
analytics.disabled = true;
19
19
-
startAudioOnly = true;
24
24
+
startAudioOnly = false; # check if webcams work nicer with that
20
25
channelLastN = 4;
21
26
stunServers = [
22
27
# - https://www.kuketz-blog.de/jitsi-meet-server-einstellungen-fuer-einen-datenschutzfreundlichen-betrieb/
···
53
58
};
54
59
55
60
services.prosody.extraPluginPaths = [ "${prosody-contrib-plugins}/event_sync" ];
56
56
-
services.prosody.extraModules = [ "admin_shell" "event_sync" ];
61
61
+
services.prosody.extraModules = [
62
62
+
"admin_shell"
63
63
+
"event_sync"
64
64
+
];
57
65
services.prosody.extraConfig = ''
58
66
Component "event_sync.jitsi.lassul.us" "event_sync_component"
59
67
muc_component = "conference.jitsi.lassul.us"
···
63
71
'';
64
72
65
73
krebs.iptables.tables.filter.INPUT.rules = [
66
66
-
{ predicate = "-p tcp --dport 4443"; target = "ACCEPT"; }
67
67
-
{ predicate = "-p udp --dport 10000"; target = "ACCEPT"; }
68
68
-
{ predicate = "-p tcp --dport 10000"; target = "ACCEPT"; }
74
74
+
{
75
75
+
predicate = "-p tcp --dport 4443";
76
76
+
target = "ACCEPT";
77
77
+
}
78
78
+
{
79
79
+
predicate = "-p udp --dport 10000";
80
80
+
target = "ACCEPT";
81
81
+
}
82
82
+
{
83
83
+
predicate = "-p tcp --dport 10000";
84
84
+
target = "ACCEPT";
85
85
+
}
69
86
];
70
87
}
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
services.murmur = {
4
4
enable = true;
···
14
14
'';
15
15
};
16
16
krebs.iptables.tables.filter.INPUT.rules = [
17
17
-
{ predicate = "-p tcp --dport 64738"; target = "ACCEPT";}
18
18
-
{ predicate = "-p udp --dport 64738"; target = "ACCEPT";}
17
17
+
{
18
18
+
predicate = "-p tcp --dport 64738";
19
19
+
target = "ACCEPT";
20
20
+
}
21
21
+
{
22
22
+
predicate = "-p udp --dport 64738";
23
23
+
target = "ACCEPT";
24
24
+
}
19
25
];
20
26
21
27
# services.botamusique = {
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, lib, ... }:
2
2
let
3
3
tcpports = [
4
4
4443 # jitsi
···
23
23
'') tcpports}
24
24
'';
25
25
26
26
-
krebs.iptables.tables.nat.PREROUTING.rules = lib.flatten (map (port: [
27
27
-
{ predicate = "-p udp --dport ${toString port}"; target = "DNAT --to-destination ${config.krebs.hosts.orange.nets.retiolum.ip4.addr}:${toString port}"; v6 = false; }
28
28
-
{ predicate = "-p udp --dport ${toString port}"; target = "DNAT --to-destination [${config.krebs.hosts.orange.nets.retiolum.ip6.addr}]:${toString port}"; v4 = false; }
29
29
-
]) udpports);
26
26
+
krebs.iptables.tables.nat.PREROUTING.rules = lib.flatten (
27
27
+
map (port: [
28
28
+
{
29
29
+
predicate = "-p udp --dport ${toString port}";
30
30
+
target = "DNAT --to-destination ${config.krebs.hosts.orange.nets.retiolum.ip4.addr}:${toString port}";
31
31
+
v6 = false;
32
32
+
}
33
33
+
{
34
34
+
predicate = "-p udp --dport ${toString port}";
35
35
+
target = "DNAT --to-destination [${config.krebs.hosts.orange.nets.retiolum.ip6.addr}]:${toString port}";
36
36
+
v4 = false;
37
37
+
}
38
38
+
]) udpports
39
39
+
);
30
40
31
41
services.nginx.virtualHosts."jitsi.lassul.us" = {
32
42
enableACME = true;
···
24
24
# { predicate = "-p tcp --dport 2"; target = "DNAT --to-destination ${config.krebs.hosts.radio.nets.retiolum.ip4.addr}:8000"; v6 = false; }
25
25
# { predicate = "-p tcp --dport 2"; target = "DNAT --to-destination ${config.krebs.hosts.radio.nets.retiolum.ip6.addr}:8000"; v4 = false; }
26
26
# ];
27
27
-
networking.firewall.allowedTCPPorts = [ 8096 8920 ];
28
28
-
networking.firewall.allowedUDPPorts = [ 1900 7359 ];
27
27
+
networking.firewall.allowedTCPPorts = [
28
28
+
8096
29
29
+
8920
30
30
+
];
31
31
+
networking.firewall.allowedUDPPorts = [
32
32
+
1900
33
33
+
7359
34
34
+
];
29
35
containers.yellow.forwardPorts = [
30
30
-
{ hostPort = 8096; containerPort = 8096; protocol = "tcp"; }
31
31
-
{ hostPort = 8920; containerPort = 8920; protocol = "tcp"; }
32
32
-
{ hostPort = 1900; containerPort = 1900; protocol = "udp"; }
33
33
-
{ hostPort = 7359; containerPort = 7359; protocol = "udp"; }
36
36
+
{
37
37
+
hostPort = 8096;
38
38
+
containerPort = 8096;
39
39
+
protocol = "tcp";
40
40
+
}
41
41
+
{
42
42
+
hostPort = 8920;
43
43
+
containerPort = 8920;
44
44
+
protocol = "tcp";
45
45
+
}
46
46
+
{
47
47
+
hostPort = 1900;
48
48
+
containerPort = 1900;
49
49
+
protocol = "udp";
50
50
+
}
51
51
+
{
52
52
+
hostPort = 7359;
53
53
+
containerPort = 7359;
54
54
+
protocol = "udp";
55
55
+
}
34
56
];
35
57
36
58
services.nginx.virtualHosts."flix.lassul.us" = {
···
233
233
};
234
234
235
235
systemd.services.bruellwuerfel =
236
236
-
let
237
237
-
bruellwuerfelSrc = pkgs.fetchFromGitHub {
238
238
-
owner = "krebs";
239
239
-
repo = "bruellwuerfel";
240
240
-
rev = "dc73adf69249fb63a4b024f1f3fbc9e541b27015";
241
241
-
sha256 = "078jp1gbavdp8lnwa09xa5m6bbbd05fi4x5ldkkgin5z04hwlhmd";
236
236
+
let
237
237
+
bruellwuerfelSrc = pkgs.fetchFromGitHub {
238
238
+
owner = "krebs";
239
239
+
repo = "bruellwuerfel";
240
240
+
rev = "dc73adf69249fb63a4b024f1f3fbc9e541b27015";
241
241
+
sha256 = "078jp1gbavdp8lnwa09xa5m6bbbd05fi4x5ldkkgin5z04hwlhmd";
242
242
+
};
243
243
+
in
244
244
+
{
245
245
+
wantedBy = [ "multi-user.target" ];
246
246
+
after = [ "network-online.target" ];
247
247
+
environment = {
248
248
+
IRC_CHANNEL = "#flix";
249
249
+
IRC_NICK = "bruelli";
250
250
+
IRC_SERVER = "irc.r";
251
251
+
IRC_HISTORY_FILE = "/tmp/bruelli.history";
252
252
+
};
253
253
+
serviceConfig = {
254
254
+
ExecStart = "${pkgs.deno}/bin/deno run -A ${bruellwuerfelSrc}/src/index.ts";
255
255
+
};
242
256
};
243
243
-
in {
244
244
-
wantedBy = [ "multi-user.target" ];
245
245
-
after = [ "network-online.target" ];
246
246
-
environment = {
247
247
-
IRC_CHANNEL = "#flix";
248
248
-
IRC_NICK = "bruelli";
249
249
-
IRC_SERVER = "irc.r";
250
250
-
IRC_HISTORY_FILE = "/tmp/bruelli.history";
251
251
-
};
252
252
-
serviceConfig = {
253
253
-
ExecStart = "${pkgs.deno}/bin/deno run -A ${bruellwuerfelSrc}/src/index.ts";
254
254
-
};
255
255
-
};
256
257
257
258
krebs.iptables = {
258
259
enable = true;
259
260
tables.filter.INPUT.rules = [
260
260
-
{ predicate = "-p tcp --dport 80"; target = "ACCEPT"; } # nginx web dir
261
261
-
{ predicate = "-p tcp --dport 443"; target = "ACCEPT"; } # nginx web dir
262
262
-
{ predicate = "-p tcp --dport 9091"; target = "ACCEPT"; } # transmission-web
263
263
-
{ predicate = "-p tcp --dport 51413"; target = "ACCEPT"; } # transmission-traffic
264
264
-
{ predicate = "-p udp --dport 51413"; target = "ACCEPT"; } # transmission-traffic
265
265
-
{ predicate = "-p tcp --dport 8096"; target = "ACCEPT"; } # jellyfin
266
266
-
{ predicate = "-p tcp --dport 8920"; target = "ACCEPT"; } # jellyfin
267
267
-
{ predicate = "-p udp --dport 1900"; target = "ACCEPT"; } # jellyfin
268
268
-
{ predicate = "-p udp --dport 7359"; target = "ACCEPT"; } # jellyfin
269
269
-
{ predicate = "-p tcp --dport 5055"; target = "ACCEPT"; } # jellyseerr
270
270
-
{ predicate = "-p tcp --dport 9696"; target = "ACCEPT"; } # prowlarr
271
271
-
{ predicate = "-p tcp --dport 8989"; target = "ACCEPT"; } # sonarr
272
272
-
{ predicate = "-p tcp --dport 7878"; target = "ACCEPT"; } # radarr
273
273
-
{ predicate = "-p tcp --dport 6767"; target = "ACCEPT"; } # bazarr
261
261
+
{
262
262
+
predicate = "-p tcp --dport 80";
263
263
+
target = "ACCEPT";
264
264
+
} # nginx web dir
265
265
+
{
266
266
+
predicate = "-p tcp --dport 443";
267
267
+
target = "ACCEPT";
268
268
+
} # nginx web dir
269
269
+
{
270
270
+
predicate = "-p tcp --dport 9091";
271
271
+
target = "ACCEPT";
272
272
+
} # transmission-web
273
273
+
{
274
274
+
predicate = "-p tcp --dport 51413";
275
275
+
target = "ACCEPT";
276
276
+
} # transmission-traffic
277
277
+
{
278
278
+
predicate = "-p udp --dport 51413";
279
279
+
target = "ACCEPT";
280
280
+
} # transmission-traffic
281
281
+
{
282
282
+
predicate = "-p tcp --dport 8096";
283
283
+
target = "ACCEPT";
284
284
+
} # jellyfin
285
285
+
{
286
286
+
predicate = "-p tcp --dport 8920";
287
287
+
target = "ACCEPT";
288
288
+
} # jellyfin
289
289
+
{
290
290
+
predicate = "-p udp --dport 1900";
291
291
+
target = "ACCEPT";
292
292
+
} # jellyfin
293
293
+
{
294
294
+
predicate = "-p udp --dport 7359";
295
295
+
target = "ACCEPT";
296
296
+
} # jellyfin
297
297
+
{
298
298
+
predicate = "-p tcp --dport 5055";
299
299
+
target = "ACCEPT";
300
300
+
} # jellyseerr
301
301
+
{
302
302
+
predicate = "-p tcp --dport 9696";
303
303
+
target = "ACCEPT";
304
304
+
} # prowlarr
305
305
+
{
306
306
+
predicate = "-p tcp --dport 8989";
307
307
+
target = "ACCEPT";
308
308
+
} # sonarr
309
309
+
{
310
310
+
predicate = "-p tcp --dport 7878";
311
311
+
target = "ACCEPT";
312
312
+
} # radarr
313
313
+
{
314
314
+
predicate = "-p tcp --dport 6767";
315
315
+
target = "ACCEPT";
316
316
+
} # bazarr
274
317
275
318
# smbd
276
276
-
{ predicate = "-p tcp --dport 445"; target = "ACCEPT"; }
277
277
-
{ predicate = "-p tcp --dport 111"; target = "ACCEPT"; }
278
278
-
{ predicate = "-p udp --dport 111"; target = "ACCEPT"; }
279
279
-
{ predicate = "-p tcp --dport 2049"; target = "ACCEPT"; }
280
280
-
{ predicate = "-p udp --dport 2049"; target = "ACCEPT"; }
281
281
-
{ predicate = "-p tcp --dport 4000:4002"; target = "ACCEPT"; }
282
282
-
{ predicate = "-p udp --dport 4000:4002"; target = "ACCEPT"; }
319
319
+
{
320
320
+
predicate = "-p tcp --dport 445";
321
321
+
target = "ACCEPT";
322
322
+
}
323
323
+
{
324
324
+
predicate = "-p tcp --dport 111";
325
325
+
target = "ACCEPT";
326
326
+
}
327
327
+
{
328
328
+
predicate = "-p udp --dport 111";
329
329
+
target = "ACCEPT";
330
330
+
}
331
331
+
{
332
332
+
predicate = "-p tcp --dport 2049";
333
333
+
target = "ACCEPT";
334
334
+
}
335
335
+
{
336
336
+
predicate = "-p udp --dport 2049";
337
337
+
target = "ACCEPT";
338
338
+
}
339
339
+
{
340
340
+
predicate = "-p tcp --dport 4000:4002";
341
341
+
target = "ACCEPT";
342
342
+
}
343
343
+
{
344
344
+
predicate = "-p udp --dport 4000:4002";
345
345
+
target = "ACCEPT";
346
346
+
}
283
347
];
284
348
285
349
tables.nat.PREROUTING.rules = [
286
350
# transmission rpc port
287
287
-
{ predicate = "-i retiolum -p tcp --dport 9091"; target = "DNAT --to-destination fdb4:3310:947::2"; v4 = false; }
351
351
+
{
352
352
+
predicate = "-i retiolum -p tcp --dport 9091";
353
353
+
target = "DNAT --to-destination fdb4:3310:947::2";
354
354
+
v4 = false;
355
355
+
}
288
356
];
289
357
tables.filter.FORWARD.policy = "ACCEPT"; # we need this so we can forward into the the transmission network namespace
290
358
};
···
1
1
-
{ pkgs, ... }:
1
1
+
{ pkgs, ... }:
2
2
{
3
3
services.nginx.virtualHosts."flix.lassul.us" = {
4
4
forceSSL = true;
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
imports = [
4
4
-
../../git.nix
4
4
+
../../git.nix
5
5
];
6
6
services.nginx.virtualHosts."cgit.lassul.us" = {
7
7
enableACME = true;
···
1
1
-
{ config, pkgs, ... }:
1
1
+
{ ... }:
2
2
{
3
3
services.nginx.virtualHosts."cgit.lassul.us" = {
4
4
forceSSL = true;
···
9
9
args.database = "matrix-synapse";
10
10
name = "psycopg2";
11
11
};
12
12
-
turn_uris = [
12
12
+
turn_uris = [
13
13
"turn:turn.matrix.org?transport=udp"
14
14
"turn:turn.matrix.org?transport=tcp"
15
15
];
···
51
51
52
52
clanCore.facts.services."matrix-synapse" = {
53
53
secret."synapse-registration_shared_secret" = { };
54
54
-
generator.path = with pkgs; [ coreutils pwgen ];
54
54
+
generator.path = with pkgs; [
55
55
+
coreutils
56
56
+
pwgen
57
57
+
];
55
58
generator.script = ''
56
59
echo "registration_shared_secret: $(pwgen -s 32 1)" > "$secrets"/synapse-registration_shared_secret
57
60
'';
···
4
4
"lassul.us" = {
5
5
locations."= /.well-known/matrix/server".extraConfig = ''
6
6
add_header Content-Type application/json;
7
7
-
return 200 '${builtins.toJSON {
8
8
-
"m.server" = "matrix.lassul.us:443";
9
9
-
}}';
7
7
+
return 200 '${
8
8
+
builtins.toJSON {
9
9
+
"m.server" = "matrix.lassul.us:443";
10
10
+
}
11
11
+
}';
10
12
'';
11
13
locations."= /.well-known/matrix/client".extraConfig = ''
12
14
add_header Content-Type application/json;
13
15
add_header Access-Control-Allow-Origin *;
14
14
-
return 200 '${builtins.toJSON {
15
15
-
"m.homeserver" = { "base_url" = "https://matrix.lassul.us"; };
16
16
-
"m.identity_server" = { "base_url" = "https://vector.im"; };
17
17
-
}}';
16
16
+
return 200 '${
17
17
+
builtins.toJSON {
18
18
+
"m.homeserver" = {
19
19
+
"base_url" = "https://matrix.lassul.us";
20
20
+
};
21
21
+
"m.identity_server" = {
22
22
+
"base_url" = "https://vector.im";
23
23
+
};
24
24
+
}
25
25
+
}';
18
26
'';
19
27
};
20
28
"matrix.lassul.us" = {
···
13
13
clanCore.facts.services.nix-serve = {
14
14
secret."nix-serve.key" = { };
15
15
public."nix-serve.pub" = { };
16
16
-
generator.path = with pkgs; [ coreutils nix ];
16
16
+
generator.path = with pkgs; [
17
17
+
coreutils
18
18
+
nix
19
19
+
];
17
20
generator.script = ''
18
21
nix-store --generate-binary-cache-key cache.${config.networking.hostName} "$secrets"/nix-serve.key "$facts"/nix-serve.pub
19
22
'';
···
1
1
+
{ config, ... }:
1
2
{
2
3
imports = [ ./module.nix ];
3
4
clan.hedgedoc.domain = "pad2.lassul.us";
5
5
+
clan.core.facts.services.hedgedoc-github-auth = {
6
6
+
secret."hedgedoc.env" = { };
7
7
+
generator.script = ''
8
8
+
echo "$prompt_value" > "$secrets"/hedgedoc.env
9
9
+
'';
10
10
+
generator.prompt = ''
11
11
+
goto https://github.com/settings/ap:qplications/2352617 and paste the data in the following format:
12
12
+
GITHUB_CLIENT_ID=...
13
13
+
GITHUB_CLIENT_SECRET=...
14
14
+
'';
15
15
+
};
16
16
+
# https://github.com/settings/applications/2352617
17
17
+
services.hedgedoc.environmentFile =
18
18
+
config.clan.core.facts.services.hedgedoc-github-auth.secret."hedgedoc.env".path;
4
19
}
···
1
1
-
{ self, lib, config, ... }:
1
1
+
{
2
2
+
self,
3
3
+
lib,
4
4
+
config,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
self.inputs.clan-core.clanModules.postgresql
5
10
];
6
6
-
clan.postgresql.users.hedgedoc = {};
7
7
-
clan.postgresql.databases.hedgedoc = {};
8
11
options.clan.hedgedoc = {
9
12
domain = lib.mkOption {
10
13
type = lib.types.str;
11
14
description = "The domain of the hedgedoc instance.";
12
15
};
13
16
};
14
14
-
systemd.services.hedgedoc.environment = {
15
15
-
CMD_COOKIE_POLICY = "none";
16
16
-
CMD_CSP_ALLOW_FRAMING = "true";
17
17
-
};
18
18
-
19
19
-
services.hedgedoc = {
20
20
-
enable = true;
21
21
-
settings = {
22
22
-
allowOrigin = [ config.clan.hedgedoc.domain ];
23
23
-
db = {
24
24
-
dialect = "postgres";
25
25
-
host = "/run/postgresql";
26
26
-
database = "hedgedoc";
27
27
-
username = "hedgedoc";
28
28
-
};
29
29
-
# db = {
30
30
-
# dialect = "sqlite";
31
31
-
# storage = "/var/lib/hedgedoc/db.hedgedoc.sqlite";
32
32
-
# };
33
33
-
useCDN = false;
34
34
-
port = 3091;
35
35
-
domain = config.hedgedoc.domain;
36
36
-
allowFreeURL = true;
37
37
-
defaultPermission = "freely";
38
38
-
39
39
-
useSSL = true;
40
40
-
protocolUseSSL = true;
41
41
-
sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ];
42
42
-
sslCertPath = "/var/lib/acme/${config.clan.hedgedoc.domain}/cert.pem";
43
43
-
sslKeyPath = "/var/lib/acme/${config.clan.hedgedoc.domain}/key.pem";
44
44
-
dhParamPath = config.security.dhparams.params.hedgedoc.path;
17
17
+
config = {
18
18
+
clan.postgresql.users.hedgedoc = { };
19
19
+
clan.postgresql.databases.hedgedoc.create.options.OWNER = "matrix-synapse";
20
20
+
systemd.services.hedgedoc.environment = {
21
21
+
CMD_COOKIE_POLICY = "none";
22
22
+
CMD_CSP_ALLOW_FRAMING = "true";
45
23
};
46
24
47
47
-
# https://github.com/settings/applications/2352617
48
48
-
environmentFile = config.clanCore.facts.secretUploadDirectory + "/hedgedoc.env";
49
49
-
};
25
25
+
services.hedgedoc = {
26
26
+
enable = true;
27
27
+
settings = {
28
28
+
allowOrigin = [ config.clan.hedgedoc.domain ];
29
29
+
db = {
30
30
+
dialect = "postgres";
31
31
+
host = "/run/postgresql";
32
32
+
database = "hedgedoc";
33
33
+
username = "hedgedoc";
34
34
+
};
35
35
+
useCDN = false;
36
36
+
port = 3091;
37
37
+
domain = config.clan.hedgedoc.domain;
38
38
+
allowFreeURL = true;
39
39
+
defaultPermission = "freely";
40
40
+
useSSL = false;
41
41
+
debug = true;
42
42
+
};
43
43
+
};
50
44
51
51
-
clanCore.facts.services.hedgedoc-github-auth = {
52
52
-
secret."hedgedoc.env" = { };
53
53
-
generator.script = ''
54
54
-
cat > "$secrets"/hedgedoc.env
55
55
-
'';
56
56
-
generator.prompt = ''
57
57
-
goto https://github.com/settings/ap:qplications/2352617 and paste the data in the following format:
58
58
-
GITHUB_CLIENT_ID=...
59
59
-
GITHUB_CLIENT_SECRET=...
60
60
-
'';
45
45
+
services.nginx.virtualHosts.${config.clan.hedgedoc.domain} = {
46
46
+
enableACME = true;
47
47
+
forceSSL = true;
48
48
+
locations."/" = {
49
49
+
proxyPass = "http://localhost:${toString config.services.hedgedoc.settings.port}";
50
50
+
proxyWebsockets = true;
51
51
+
};
52
52
+
};
53
53
+
61
54
};
62
55
}
···
1
1
-
{ self, config, pkgs, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
imports = [
4
9
self.inputs.stockholm.nixosModules.htgen
···
1
1
<!doctype html>
2
2
3
3
<html lang="en">
4
4
-
<head>
5
5
-
<meta charset="utf-8">
6
6
-
<meta name="viewport" content="width=device-width, initial-scale=1">
4
4
+
<head>
5
5
+
<meta charset="utf-8" />
6
6
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7
7
8
8
-
<title>The_Playlist Voting!</title>
9
9
-
<style>
10
10
-
#good {
11
11
-
display: block;
12
12
-
width: 100%;
13
13
-
border: none;
14
14
-
background-color: #04AA6D;
15
15
-
padding: 14px;
16
16
-
margin: 14px 0 0 0;
17
17
-
height: 100px;
18
18
-
font-size: 16px;
19
19
-
cursor: pointer;
20
20
-
text-align: center;
21
21
-
}
22
22
-
#bad {
23
23
-
display: block;
24
24
-
width: 100%;
25
25
-
border: none;
26
26
-
background-color: red;
27
27
-
padding: 14px;
28
28
-
height: 100px;
8
8
+
<title>The_Playlist Voting!</title>
9
9
+
<style>
10
10
+
#good {
11
11
+
display: block;
12
12
+
width: 100%;
13
13
+
border: none;
14
14
+
background-color: #04aa6d;
15
15
+
padding: 14px;
16
16
+
margin: 14px 0 0 0;
17
17
+
height: 100px;
18
18
+
font-size: 16px;
19
19
+
cursor: pointer;
20
20
+
text-align: center;
21
21
+
}
22
22
+
#bad {
23
23
+
display: block;
24
24
+
width: 100%;
25
25
+
border: none;
26
26
+
background-color: red;
27
27
+
padding: 14px;
28
28
+
height: 100px;
29
29
30
30
-
margin: 14px 0 0 0;
31
31
-
font-size: 16px;
32
32
-
cursor: pointer;
33
33
-
text-align: center;
34
34
-
}
35
35
-
</style>
30
30
+
margin: 14px 0 0 0;
31
31
+
font-size: 16px;
32
32
+
cursor: pointer;
33
33
+
text-align: center;
34
34
+
}
35
35
+
</style>
36
36
+
</head>
36
37
37
37
-
</head>
38
38
+
<body>
39
39
+
<div id="votenote"></div>
40
40
+
<button id="good" type="button">GUT</button>
38
41
39
39
-
<body>
40
40
-
<div id=votenote></div>
41
41
-
<button id=good type="button"> GUT </button>
42
42
+
<button id="bad" type="button">SCHLECHT</button>
43
43
+
<center>
44
44
+
Currently Running: <br />
45
45
+
<div>
46
46
+
<b id="current"></b>
47
47
+
</div>
48
48
+
<div id="vote"></div>
49
49
+
<audio controls autoplay="autoplay">
50
50
+
<source src="https://radio.lassul.us/radio.ogg" type="audio/ogg" />
51
51
+
Your browser does not support the audio element.
52
52
+
</audio>
53
53
+
</center>
42
54
43
43
-
<button id=bad type="button"> SCHLECHT </button>
44
44
-
<center>
45
45
-
Currently Running: <br/><div>
46
46
-
<b id=current></b>
47
47
-
</div>
48
48
-
<div id=vote>
49
49
-
</div>
50
50
-
<audio controls autoplay="autoplay">
51
51
-
<source src="https://radio.lassul.us/radio.ogg" type="audio/ogg">
52
52
-
Your browser does not support the audio element.
53
53
-
</audio>
54
54
-
</center>
55
55
+
<script>
56
56
+
document.getElementById("good").onclick = async () => {
57
57
+
let result = await fetch("https://radio.lassul.us/good", {
58
58
+
method: "POST",
59
59
+
});
60
60
+
document.getElementById("vote").textContent =
61
61
+
"Dieses Lied findest du gut";
62
62
+
};
63
63
+
document.getElementById("bad").onclick = async () => {
64
64
+
let result = await fetch("https://radio.lassul.us/skip", {
65
65
+
method: "POST",
66
66
+
});
67
67
+
document.getElementById("vote").textContent =
68
68
+
"Dieses Lied findest du schlecht";
69
69
+
document.getElementById("bad").disabled = true;
70
70
+
window.setTimeout(function () {
71
71
+
document.getElementById("bad").disabled = false;
72
72
+
}, 100000);
73
73
+
};
55
74
56
56
-
<script>
57
57
-
document.getElementById("good").onclick=async ()=>{
58
58
-
let result = await fetch("https://radio.lassul.us/good", {"method": "POST"})
59
59
-
document.getElementById("vote").textContent = "Dieses Lied findest du gut"
60
60
-
};
61
61
-
document.getElementById("bad").onclick=async ()=>{
62
62
-
let result = await fetch("https://radio.lassul.us/skip", {"method": "POST"})
63
63
-
document.getElementById("vote").textContent = "Dieses Lied findest du schlecht"
64
64
-
document.getElementById("bad").disabled = true
65
65
-
window.setTimeout(function(){
66
66
-
document.getElementById("bad").disabled = false
67
67
-
}, 100000)
68
68
-
69
69
-
};
70
70
-
71
71
-
async function current() {
72
72
-
let result = await fetch("https://radio.lassul.us/current", {"method": "GET"})
73
73
-
let data = await result.json()
74
74
-
document.getElementById("current").textContent = data.name
75
75
-
}
76
76
-
window.onload = function() {
77
77
-
window.setInterval('current()', 10000)
78
78
-
current()
79
79
-
}
80
80
-
81
81
-
</script>
82
82
-
</body>
75
75
+
async function current() {
76
76
+
let result = await fetch("https://radio.lassul.us/current", {
77
77
+
method: "GET",
78
78
+
});
79
79
+
let data = await result.json();
80
80
+
document.getElementById("current").textContent = data.name;
81
81
+
}
82
82
+
window.onload = function () {
83
83
+
window.setInterval("current()", 10000);
84
84
+
current();
85
85
+
};
86
86
+
</script>
87
87
+
</body>
83
88
</html>
···
1
1
-
{ self, config, pkgs, lib, ... }:
1
1
+
{
2
2
+
self,
3
3
+
config,
4
4
+
pkgs,
5
5
+
lib,
6
6
+
...
7
7
+
}:
2
8
3
9
let
4
10
name = "radio";
···
73
79
)"
74
80
'';
75
81
76
76
-
in {
82
82
+
in
83
83
+
{
77
84
imports = [
78
85
./news.nix
79
86
./weather.nix
···
102
109
};
103
110
104
111
users.groups = {
105
105
-
"radio" = {};
112
112
+
"radio" = { };
106
113
};
107
114
108
115
systemd.services.radio_watcher = {
···
148
155
149
156
nixpkgs.config.packageOverrides = opkgs: {
150
157
liquidsoap = opkgs.liquidsoap.override {
151
151
-
runtimePackages = with opkgs; [ bubblewrap curl ffmpeg yt-dlp ];
158
158
+
runtimePackages = with opkgs; [
159
159
+
bubblewrap
160
160
+
curl
161
161
+
ffmpeg
162
162
+
yt-dlp
163
163
+
];
152
164
};
153
165
icecast = opkgs.icecast.overrideAttrs (old: rec {
154
166
version = "2.5-beta3";
···
187
199
krebs.iptables = {
188
200
tables = {
189
201
filter.INPUT.rules = [
190
190
-
{ predicate = "-p tcp --dport 8000"; target = "ACCEPT"; }
191
191
-
{ predicate = "-i retiolum -p tcp --dport 8001"; target = "ACCEPT"; }
192
192
-
{ predicate = "-i retiolum -p tcp --dport 8002"; target = "ACCEPT"; }
202
202
+
{
203
203
+
predicate = "-p tcp --dport 8000";
204
204
+
target = "ACCEPT";
205
205
+
}
206
206
+
{
207
207
+
predicate = "-i retiolum -p tcp --dport 8001";
208
208
+
target = "ACCEPT";
209
209
+
}
210
210
+
{
211
211
+
predicate = "-i retiolum -p tcp --dport 8002";
212
212
+
target = "ACCEPT";
213
213
+
}
193
214
];
194
215
};
195
216
};
···
224
245
activate = "match";
225
246
pattern = "^(?:.*\\s)?\\s*the_playlist:\\s*([0-9A-Za-z._][0-9A-Za-z._-]*)(?:\\s+(.*\\S))?\\s*$";
226
247
command = 1;
227
227
-
arguments = [2];
248
248
+
arguments = [ 2 ];
228
249
commands = {
229
250
skip.filename = "${skip_track}/bin/skip_track";
230
251
next.filename = "${skip_track}/bin/skip_track";
···
348
369
};
349
370
services.syncthing.settings.folders."/home/lass/tmp/the_playlist" = {
350
371
path = lib.mkForce "/var/music/the_playlist";
351
351
-
devices = [ "mors" "prism" "radio" ];
372
372
+
devices = [
373
373
+
"mors"
374
374
+
"prism"
375
375
+
"radio"
376
376
+
];
352
377
};
353
378
krebs.acl."/var/music/the_playlist"."u:lass:X".parents = true;
354
354
-
krebs.acl."/var/music/the_playlist"."u:lass:rwX" = {};
355
355
-
krebs.acl."/var/music/the_playlist"."u:radio:rwX" = {};
379
379
+
krebs.acl."/var/music/the_playlist"."u:lass:rwX" = { };
380
380
+
krebs.acl."/var/music/the_playlist"."u:radio:rwX" = { };
356
381
}
···
25
25
) | .[]'
26
26
'';
27
27
28
28
-
newsshow = pkgs.writers.writeDashBin "newsshow" /* sh */ ''
29
29
-
cat << EOF
30
30
-
hello crabpeople!
31
31
-
$(${pkgs.ddate}/bin/ddate +'Today is %{%A, the %e of %B%}, %Y. %N%nCelebrate %H')
32
32
-
It is $(date --utc +%H) o clock UTC.
33
33
-
todays news:
34
34
-
$(get_current_news)
35
35
-
$(gc_news)
36
36
-
EOF
37
37
-
'';
28
28
+
newsshow =
29
29
+
pkgs.writers.writeDashBin "newsshow" # sh
30
30
+
''
31
31
+
cat << EOF
32
32
+
hello crabpeople!
33
33
+
$(${pkgs.ddate}/bin/ddate +'Today is %{%A, the %e of %B%}, %Y. %N%nCelebrate %H')
34
34
+
It is $(date --utc +%H) o clock UTC.
35
35
+
todays news:
36
36
+
$(get_current_news)
37
37
+
$(gc_news)
38
38
+
EOF
39
39
+
'';
38
40
in
39
41
{
40
42
systemd.services.newsshow = {
···
1
1
-
{ pkgs ? import <nixpkgs> {} }:
1
1
+
{
2
2
+
pkgs ? import <nixpkgs> { },
3
3
+
}:
2
4
pkgs.mkShell {
3
5
buildInputs = [
4
6
pkgs.liquidsoap
···
1
1
{ pkgs, ... }:
2
2
let
3
3
-
model = pkgs.runCommand "model" {} ''
3
3
+
model = pkgs.runCommand "model" { } ''
4
4
mkdir -p $out
5
5
-
ln -s ${pkgs.fetchurl {
6
6
-
url = "https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/libritts/high/en_US-libritts-high.onnx?download=true";
7
7
-
hash = "sha256-kSelWeEWA/ELNm0aIKx0JoJggdvFId5MJCDFdyjXPw8=";
8
8
-
}} $out/model.onnx
9
9
-
ln -s ${pkgs.fetchurl {
10
10
-
url = "https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/libritts/high/en_US-libritts-high.onnx.json?download=true.json";
11
11
-
hash = "sha256-Lv3G1/lUWIuBgBMsvZuAAZM/3QCTLJK8kv0NICip6z0=";
12
12
-
}} $out/model.onnx.json
5
5
+
ln -s ${
6
6
+
pkgs.fetchurl {
7
7
+
url = "https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/libritts/high/en_US-libritts-high.onnx?download=true";
8
8
+
hash = "sha256-kSelWeEWA/ELNm0aIKx0JoJggdvFId5MJCDFdyjXPw8=";
9
9
+
}
10
10
+
} $out/model.onnx
11
11
+
ln -s ${
12
12
+
pkgs.fetchurl {
13
13
+
url = "https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/libritts/high/en_US-libritts-high.onnx.json?download=true.json";
14
14
+
hash = "sha256-Lv3G1/lUWIuBgBMsvZuAAZM/3QCTLJK8kv0NICip6z0=";
15
15
+
}
16
16
+
} $out/model.onnx.json
13
17
'';
14
18
15
19
tts = pkgs.writers.writeBashBin "tts" ''
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ lib, pkgs, ... }:
2
2
let
3
3
weather_for_ips = pkgs.writers.writePython3Bin "weather_for_ips" {
4
4
libraries = [ pkgs.python3Packages.geoip2 ];
···
7
7
8
8
weather_report = pkgs.writers.writeDashBin "weather_report" ''
9
9
set -efux
10
10
-
export PATH="${lib.makeBinPath [
11
11
-
pkgs.coreutils
12
12
-
pkgs.curl
13
13
-
pkgs.jq
14
14
-
]}"
10
10
+
export PATH="${
11
11
+
lib.makeBinPath [
12
12
+
pkgs.coreutils
13
13
+
pkgs.curl
14
14
+
pkgs.jq
15
15
+
]
16
16
+
}"
15
17
curl -fSsz /tmp/GeoLite2-City.mmdb -o /tmp/GeoLite2-City.mmdb http://c.r/GeoLite2-City.mmdb
16
18
MAXMIND_GEOIP_DB="/tmp/GeoLite2-City.mmdb"; export MAXMIND_GEOIP_DB
17
19
(
···
30
32
' |
31
33
${weather_for_ips}/bin/weather_for_ips
32
34
'';
33
33
-
in {
35
35
+
in
36
36
+
{
34
37
systemd.services.weather = {
35
38
path = [
36
39
weather_report
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{ config, pkgs, ... }:
2
2
{
3
3
security.acme = {
4
4
certs."lassul.us" = {
···
34
34
default_type "text/html";
35
35
alias ${pkgs.krebspage}/index.html;
36
36
'';
37
37
-
locations."= /init".extraConfig = let
38
38
-
initscript = pkgs.init.override {
39
39
-
pubkey = config.krebs.users.lass.pubkey;
40
40
-
};
41
41
-
in ''
42
42
-
alias ${initscript}/bin/init;
43
43
-
'';
37
37
+
locations."= /init".extraConfig =
38
38
+
let
39
39
+
initscript = pkgs.init.override {
40
40
+
pubkey = config.krebs.users.lass.pubkey;
41
41
+
};
42
42
+
in
43
43
+
''
44
44
+
alias ${initscript}/bin/init;
45
45
+
'';
44
46
locations."= /blue.pub".extraConfig = ''
45
47
alias ${pkgs.writeText "pub" config.krebs.users.lass-blue.pubkey};
46
48
'';
···
1
1
-
_: {}
1
1
+
_: { }
···
1
1
-
{ config, lib, pkgs, ... }:
1
1
+
{
2
2
+
config,
3
3
+
lib,
4
4
+
pkgs,
5
5
+
...
6
6
+
}:
2
7
{
3
8
services.nginx.virtualHosts."ref.ptkk.de" = {
4
9
enableACME = true;