Compare commits
2 commits
a82a616f11
...
f5096f3917
Author | SHA1 | Date | |
---|---|---|---|
f5096f3917 | |||
131b4b2614 |
11 changed files with 67 additions and 27 deletions
|
@ -104,7 +104,6 @@
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
extra-substituters = [
|
extra-substituters = [
|
||||||
"https://cache.cything.io/central"
|
|
||||||
"https://niri.cachix.org"
|
"https://niri.cachix.org"
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
"https://cache.garnix.io"
|
"https://cache.garnix.io"
|
||||||
|
@ -112,7 +111,6 @@
|
||||||
"https://aseipp-nix-cache.global.ssl.fastly.net"
|
"https://aseipp-nix-cache.global.ssl.fastly.net"
|
||||||
];
|
];
|
||||||
extra-trusted-public-keys = [
|
extra-trusted-public-keys = [
|
||||||
"central:uWhjva6m6dhC2hqNisjn2hXGvdGBs19vPkA1dPEuwFg="
|
|
||||||
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
|
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||||
|
|
|
@ -144,6 +144,9 @@
|
||||||
telegram-desktop
|
telegram-desktop
|
||||||
jadx
|
jadx
|
||||||
gradle
|
gradle
|
||||||
|
localsend
|
||||||
|
scrcpy
|
||||||
|
syncthing
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.waybar.enable = true;
|
programs.waybar.enable = true;
|
||||||
|
|
|
@ -7,32 +7,26 @@
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
listen = "[::]:8090";
|
listen = "[::]:8090";
|
||||||
api-endpoint = "https://cache.cything.io/";
|
api-endpoint = "https://cache.cy7.sh/";
|
||||||
allowed-hosts = [ "cache.cything.io" ];
|
allowed-hosts = [ "cache.cy7.sh" ];
|
||||||
require-proof-of-possession = false;
|
require-proof-of-possession = false;
|
||||||
compression.type = "zstd";
|
compression.type = "zstd";
|
||||||
database.url = "postgresql:///atticd?host=/run/postgresql";
|
database.url = "postgresql:///atticd?host=/run/postgresql";
|
||||||
|
|
||||||
storage = {
|
storage = {
|
||||||
type = "local";
|
type = "s3";
|
||||||
path = "/mnt/attic";
|
region = "auto";
|
||||||
|
bucket = "attic";
|
||||||
|
endpoint = "https://e3e97aac307d106a7becea43cef8fcbd.r2.cloudflarestorage.com";
|
||||||
};
|
};
|
||||||
|
|
||||||
garbage-collection = {
|
garbage-collection = {
|
||||||
default-retention-period = "3 months";
|
default-retention-period = "2 weeks";
|
||||||
};
|
|
||||||
|
|
||||||
chunking = {
|
|
||||||
nar-size-threshold = 0; # disables chunking
|
|
||||||
min-size = 0;
|
|
||||||
avg-size = 0;
|
|
||||||
max-size = 0;
|
|
||||||
concurrent-chunk-uploads = 32;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.caddy.virtualHosts."cache.cything.io".extraConfig = ''
|
services.caddy.virtualHosts."cache.cy7.sh".extraConfig = ''
|
||||||
import common
|
import common
|
||||||
reverse_proxy localhost:8090
|
reverse_proxy localhost:8090
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
@ -10,7 +11,6 @@
|
||||||
./backup.nix
|
./backup.nix
|
||||||
./rclone.nix
|
./rclone.nix
|
||||||
./postgres.nix
|
./postgres.nix
|
||||||
./adguard.nix
|
|
||||||
./hedgedoc.nix
|
./hedgedoc.nix
|
||||||
./miniflux.nix
|
./miniflux.nix
|
||||||
./redlib.nix
|
./redlib.nix
|
||||||
|
@ -92,9 +92,28 @@
|
||||||
53
|
53
|
||||||
853
|
853
|
||||||
];
|
];
|
||||||
extraCommands = ''
|
extraCommands =
|
||||||
|
let
|
||||||
|
ethtool = lib.getExe pkgs.ethtool;
|
||||||
|
tc = lib.getExe' pkgs.iproute2 "tc";
|
||||||
|
in ''
|
||||||
|
# disable TCP segmentation offload (https://wiki.archlinux.org/title/Advanced_traffic_control#Prerequisites)
|
||||||
|
${ethtool} -K ens18 tso off
|
||||||
|
|
||||||
|
# clear existing rules
|
||||||
|
${tc} qdisc del dev ens18 root || true
|
||||||
|
|
||||||
|
# create HTB hierarchy
|
||||||
|
${tc} qdisc add dev ens18 root handle 1: htb default 20
|
||||||
|
${tc} class add dev ens18 parent 1: classid 1:1 htb rate 100% ceil 100%
|
||||||
|
${tc} class add dev ens18 parent 1:1 classid 1:10 htb rate 40% ceil 100%
|
||||||
|
${tc} class add dev ens18 parent 1:1 classid 1:20 htb rate 60% ceil 100%
|
||||||
|
|
||||||
|
# mark traffic
|
||||||
iptables -t mangle -A OUTPUT -m cgroup --path "system.slice/tailscaled.service" -j MARK --set-mark 1
|
iptables -t mangle -A OUTPUT -m cgroup --path "system.slice/tailscaled.service" -j MARK --set-mark 1
|
||||||
iptables -t mangle -A OUTPUT -m cgroup --path "system.slice/tor.service" -j MARK --set-mark 2
|
|
||||||
|
# route marked packets
|
||||||
|
${tc} filter add dev ens18 parent 1: protocol ip prio 1 handle 1 fw flowid 1:10
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
networking.interfaces.ens18 = {
|
networking.interfaces.ens18 = {
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
"--advertise-exit-node"
|
"--advertise-exit-node"
|
||||||
"--accept-dns=false"
|
"--accept-dns=false"
|
||||||
];
|
];
|
||||||
|
extraDaemonFlags = [
|
||||||
|
"--no-logs-no-support"
|
||||||
|
];
|
||||||
useRoutingFeatures = "server";
|
useRoutingFeatures = "server";
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"@wheel"
|
"@wheel"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"central:uWhjva6m6dhC2hqNisjn2hXGvdGBs19vPkA1dPEuwFg="
|
|
||||||
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
|
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||||
|
@ -18,7 +17,6 @@
|
||||||
];
|
];
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://aseipp-nix-cache.global.ssl.fastly.net"
|
"https://aseipp-nix-cache.global.ssl.fastly.net"
|
||||||
"https://cache.cything.io/central"
|
|
||||||
"https://niri.cachix.org"
|
"https://niri.cachix.org"
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
"https://cache.garnix.io"
|
"https://cache.garnix.io"
|
||||||
|
|
|
@ -91,7 +91,10 @@
|
||||||
resolvconf.enable = true;
|
resolvconf.enable = true;
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [ 8080 ]; # for mitmproxy
|
allowedTCPPorts = [
|
||||||
|
8080 # mitmproxy
|
||||||
|
22000 # syncthing
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.nm-applet.enable = true;
|
programs.nm-applet.enable = true;
|
||||||
|
@ -223,6 +226,7 @@
|
||||||
"/home/yt/.local/share/Steam"
|
"/home/yt/.local/share/Steam"
|
||||||
"**/.wine"
|
"**/.wine"
|
||||||
"/home/yt/Games"
|
"/home/yt/Games"
|
||||||
|
"/home/yt/Videos"
|
||||||
];
|
];
|
||||||
repo = "yt";
|
repo = "yt";
|
||||||
passFile = config.sops.secrets."borg/rsyncnet".path;
|
passFile = config.sops.secrets."borg/rsyncnet".path;
|
||||||
|
|
|
@ -6,8 +6,13 @@
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
useRoutingFeatures = "client";
|
useRoutingFeatures = "client";
|
||||||
extraUpFlags = [
|
extraUpFlags = [
|
||||||
"--exit-node=100.122.132.30"
|
"--exit-node=chunk"
|
||||||
"--accept-dns=false"
|
"--accept-dns=false"
|
||||||
|
"--operator=yt"
|
||||||
|
"--exit-node-allow-lan-access"
|
||||||
|
];
|
||||||
|
extraDaemonFlags = [
|
||||||
|
"--no-logs-no-support"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
13
overlay/attic/concurrent-32.patch
Normal file
13
overlay/attic/concurrent-32.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/server/src/config.rs b/server/src/config.rs
|
||||||
|
index 4412cbf..6dd483a 100644
|
||||||
|
--- a/server/src/config.rs
|
||||||
|
+++ b/server/src/config.rs
|
||||||
|
@@ -565,7 +565,7 @@ fn default_default_retention_period() -> Duration {
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_concurrent_chunk_uploads() -> usize {
|
||||||
|
- 10
|
||||||
|
+ 32
|
||||||
|
}
|
||||||
|
|
||||||
|
fn load_config_from_path(path: &Path) -> Result<Config> {
|
|
@ -16,6 +16,9 @@ final: prev: {
|
||||||
cargoLock = null;
|
cargoLock = null;
|
||||||
cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM=";
|
cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM=";
|
||||||
useFetchCargoVendor = true;
|
useFetchCargoVendor = true;
|
||||||
|
patches = [
|
||||||
|
./concurrent-32.patch
|
||||||
|
];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue