Compare commits

...

7 commits

13 changed files with 85 additions and 106 deletions

View file

@ -104,7 +104,7 @@
nixConfig = { nixConfig = {
extra-substituters = [ extra-substituters = [
"https://cache.cything.io/central" "https://cache.cy7.sh/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 +112,7 @@
"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=" "central:KNxL0JFzHDGosui8ASem9n/tDmEAYLL9dtVMJ6TWsyg="
"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="

View file

@ -19,30 +19,6 @@
}; };
programs.home-manager.enable = true; programs.home-manager.enable = true;
systemd.user.startServices = "sd-switch";
# keep this commented when using plasma
# otherwise "system settings" in KDE will not function
# qt = {
# enable = true;
# platformTheme.name = "kde";
# style.name = "breeze-dark";
# style.package = pkgs.kdePackages.breeze;
# };
# this one too
# gtk = {
# enable = true;
# theme = {
# package = pkgs.adw-gtk3;
# name = "adw-gtk3-dark";
# };
# iconTheme = {
# package = pkgs.adwaita-icon-theme;
# name = "Adwaita";
# };
# };
home.pointerCursor = { home.pointerCursor = {
package = pkgs.bibata-cursors; package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic"; name = "Bibata-Modern-Classic";
@ -56,7 +32,6 @@
ungoogled-chromium ungoogled-chromium
librewolf librewolf
bitwarden-desktop bitwarden-desktop
bitwarden-cli
fastfetch fastfetch
nwg-look nwg-look
kdePackages.gwenview kdePackages.gwenview
@ -67,11 +42,6 @@
signal-desktop signal-desktop
pavucontrol pavucontrol
btop btop
grim
slurp
rofi-wayland
rofimoji
cliphist
jq jq
bash-language-server bash-language-server
sqlite sqlite
@ -88,7 +58,6 @@
pwgen pwgen
lua-language-server lua-language-server
gnumake gnumake
foot
minisign minisign
unzip unzip
lm_sensors lm_sensors
@ -125,7 +94,6 @@
radare2 radare2
p7zip p7zip
qbittorrent qbittorrent
# vscodium
nil nil
pkg-config pkg-config
gtk2 gtk2
@ -144,27 +112,19 @@
telegram-desktop telegram-desktop
jadx jadx
gradle gradle
localsend
scrcpy
syncthing
syncthingtray
obsidian
]; ];
programs.waybar.enable = true;
programs.feh.enable = true; programs.feh.enable = true;
xdg.configFile = { xdg.configFile = {
rofi.source = ../rofi;
waybar.source = ../waybar;
mpv.source = ../mpv; mpv.source = ../mpv;
}; };
programs.newsboat = {
enable = true;
extraConfig = ''
urls-source "miniflux"
miniflux-url "https://rss.cything.io/"
miniflux-login "cy"
miniflux-passwordfile /run/secrets/newsboat/miniflux
'';
};
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
@ -186,12 +146,12 @@
# sccache stuff # sccache stuff
RUSTC_WRAPPER = "${lib.getExe pkgs.sccache}"; RUSTC_WRAPPER = "${lib.getExe pkgs.sccache}";
SCCACHE_BUCKET = "sccache"; SCCACHE_BUCKET = "sccache";
SCCACHE_REGION = "earth"; SCCACHE_REGION = "us-east-1";
SCCACHE_ENDPOINT = "https://sccache.s3.cy7.sh"; SCCACHE_ENDPOINT = "https://sccache.s3.cy7.sh";
SCCACHE_ALLOW_CORE_DUMPS = "true"; SCCACHE_ALLOW_CORE_DUMPS = "true";
SCCACHE_S3_USE_SSL = "true"; SCCACHE_S3_USE_SSL = "true";
SCCACHE_CACHE_MULTIARCH = "true"; SCCACHE_CACHE_MULTIARCH = "true";
SCCACHE_LOG_LEVEL = "warn"; SCCACHE_LOG = "warn";
AWS_DEFAULT_REGION = "us-east-1"; AWS_DEFAULT_REGION = "us-east-1";
AWS_ENDPOINT_URL = "https://s3.cy7.sh"; AWS_ENDPOINT_URL = "https://s3.cy7.sh";
AWS_ACCESS_KEY_ID = "$(cat /run/secrets/aws/key_id)"; AWS_ACCESS_KEY_ID = "$(cat /run/secrets/aws/key_id)";

View file

@ -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
''; '';

View file

@ -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
@ -31,9 +31,6 @@
"borg/rsyncnet" = { "borg/rsyncnet" = {
sopsFile = ../../secrets/borg/chunk.yaml; sopsFile = ../../secrets/borg/chunk.yaml;
}; };
"services/ntfy" = {
sopsFile = ../../secrets/services/ntfy.yaml;
};
"rclone/config" = { "rclone/config" = {
sopsFile = ../../secrets/rclone.yaml; sopsFile = ../../secrets/rclone.yaml;
}; };
@ -92,10 +89,36 @@
53 53
853 853
]; ];
extraCommands = '' extraCommands =
iptables -t mangle -A OUTPUT -m cgroup --path "system.slice/tailscaled.service" -j MARK --set-mark 1 let
iptables -t mangle -A OUTPUT -m cgroup --path "system.slice/tor.service" -j MARK --set-mark 2 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 30
${tc} class add dev ens18 parent 1: classid 1:1 htb rate 100% ceil 100%
# tailscale
${tc} class add dev ens18 parent 1:1 classid 1:10 htb rate 30% ceil 100%
# caddy
${tc} class add dev ens18 parent 1:1 classid 1:20 htb rate 30% ceil 100%
# rest
${tc} class add dev ens18 parent 1:1 classid 1:30 htb rate 40% 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/caddy.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
${tc} filter add dev ens18 parent 1: protocol ip prio 1 handle 2 fw flowid 1:20
'';
}; };
networking.interfaces.ens18 = { networking.interfaces.ens18 = {
ipv6.addresses = [ ipv6.addresses = [

View file

@ -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;
}; };

View file

@ -10,7 +10,7 @@
"@wheel" "@wheel"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"central:uWhjva6m6dhC2hqNisjn2hXGvdGBs19vPkA1dPEuwFg=" "central:KNxL0JFzHDGosui8ASem9n/tDmEAYLL9dtVMJ6TWsyg="
"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 +18,7 @@
]; ];
substituters = [ substituters = [
"https://aseipp-nix-cache.global.ssl.fastly.net" "https://aseipp-nix-cache.global.ssl.fastly.net"
"https://cache.cything.io/central" "https://cache.cy7.sh/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"

View file

@ -17,16 +17,9 @@
"borg/rsyncnet" = { "borg/rsyncnet" = {
sopsFile = ../../secrets/borg/yt.yaml; sopsFile = ../../secrets/borg/yt.yaml;
}; };
"services/ntfy" = {
sopsFile = ../../secrets/services/ntfy.yaml;
};
"rsyncnet/id_ed25519" = { "rsyncnet/id_ed25519" = {
sopsFile = ../../secrets/zh5061/yt.yaml; sopsFile = ../../secrets/zh5061/yt.yaml;
}; };
"newsboat/miniflux" = {
sopsFile = ../../secrets/newsboat.yaml;
owner = "yt";
};
"tailscale/auth" = { "tailscale/auth" = {
sopsFile = ../../secrets/services/tailscale.yaml; sopsFile = ../../secrets/services/tailscale.yaml;
}; };
@ -91,7 +84,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 +219,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;

View file

@ -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"
]; ];
}; };
} }

View file

@ -6,7 +6,6 @@
}: }:
let let
cfg = config.my.backup; cfg = config.my.backup;
hostname = config.networking.hostName;
defaultPaths = [ defaultPaths = [
"/root" "/root"
"/home" "/home"
@ -97,23 +96,6 @@ in
]; ];
# warnings are often not that serious # warnings are often not that serious
failOnWarnings = false; failOnWarnings = false;
postHook = ''
invocationId=$(systemctl show -p InvocationID --value borgbackup-job-${cfg.jobName}.service)
title="${hostname}: backup completed with exit code: $exitStatus"
msg=$(journalctl -o cat _SYSTEMD_INVOCATION_ID=$invocationId)
if [ "$exitStatus" -eq 0 ]; then
tag="v"
else
tag="rotating_light"
fi
${pkgs.curl}/bin/curl -sL -u $(cat ${config.sops.secrets."services/ntfy".path}) \
-H "Title: $title" \
-H "Tags: $tag" \
-d "$msg" \
https://ntfy.cything.io/backups > /dev/null
'';
prune.keep = { prune.keep = {
within = "2d"; within = "2d";

View 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> {

View file

@ -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
];
} }
); );
}; };

View file

@ -1,5 +1,4 @@
final: prev: final: prev: {
{
zipline = prev.zipline.overrideAttrs { zipline = prev.zipline.overrideAttrs {
patches = [ patches = [
./no-check-bucket.patch ./no-check-bucket.patch

File diff suppressed because one or more lines are too long