Compare commits
No commits in common. "8b53c43e26392481f432f024df56f01949349fce" and "a82a616f112f1ac788d85172bf6a1d87abb1222d" have entirely different histories.
8b53c43e26
...
a82a616f11
13 changed files with 106 additions and 85 deletions
|
@ -104,7 +104,7 @@
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
extra-substituters = [
|
extra-substituters = [
|
||||||
"https://cache.cy7.sh/central"
|
"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 +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:KNxL0JFzHDGosui8ASem9n/tDmEAYLL9dtVMJ6TWsyg="
|
"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="
|
||||||
|
|
|
@ -19,6 +19,30 @@
|
||||||
};
|
};
|
||||||
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";
|
||||||
|
@ -32,6 +56,7 @@
|
||||||
ungoogled-chromium
|
ungoogled-chromium
|
||||||
librewolf
|
librewolf
|
||||||
bitwarden-desktop
|
bitwarden-desktop
|
||||||
|
bitwarden-cli
|
||||||
fastfetch
|
fastfetch
|
||||||
nwg-look
|
nwg-look
|
||||||
kdePackages.gwenview
|
kdePackages.gwenview
|
||||||
|
@ -42,6 +67,11 @@
|
||||||
signal-desktop
|
signal-desktop
|
||||||
pavucontrol
|
pavucontrol
|
||||||
btop
|
btop
|
||||||
|
grim
|
||||||
|
slurp
|
||||||
|
rofi-wayland
|
||||||
|
rofimoji
|
||||||
|
cliphist
|
||||||
jq
|
jq
|
||||||
bash-language-server
|
bash-language-server
|
||||||
sqlite
|
sqlite
|
||||||
|
@ -58,6 +88,7 @@
|
||||||
pwgen
|
pwgen
|
||||||
lua-language-server
|
lua-language-server
|
||||||
gnumake
|
gnumake
|
||||||
|
foot
|
||||||
minisign
|
minisign
|
||||||
unzip
|
unzip
|
||||||
lm_sensors
|
lm_sensors
|
||||||
|
@ -94,6 +125,7 @@
|
||||||
radare2
|
radare2
|
||||||
p7zip
|
p7zip
|
||||||
qbittorrent
|
qbittorrent
|
||||||
|
# vscodium
|
||||||
nil
|
nil
|
||||||
pkg-config
|
pkg-config
|
||||||
gtk2
|
gtk2
|
||||||
|
@ -112,19 +144,27 @@
|
||||||
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;
|
||||||
|
@ -146,12 +186,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 = "us-east-1";
|
SCCACHE_REGION = "earth";
|
||||||
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 = "warn";
|
SCCACHE_LOG_LEVEL = "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)";
|
||||||
|
|
|
@ -7,26 +7,32 @@
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
listen = "[::]:8090";
|
listen = "[::]:8090";
|
||||||
api-endpoint = "https://cache.cy7.sh/";
|
api-endpoint = "https://cache.cything.io/";
|
||||||
allowed-hosts = [ "cache.cy7.sh" ];
|
allowed-hosts = [ "cache.cything.io" ];
|
||||||
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 = "s3";
|
type = "local";
|
||||||
region = "auto";
|
path = "/mnt/attic";
|
||||||
bucket = "attic";
|
|
||||||
endpoint = "https://e3e97aac307d106a7becea43cef8fcbd.r2.cloudflarestorage.com";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
garbage-collection = {
|
garbage-collection = {
|
||||||
default-retention-period = "2 weeks";
|
default-retention-period = "3 months";
|
||||||
|
};
|
||||||
|
|
||||||
|
chunking = {
|
||||||
|
nar-size-threshold = 0; # disables chunking
|
||||||
|
min-size = 0;
|
||||||
|
avg-size = 0;
|
||||||
|
max-size = 0;
|
||||||
|
concurrent-chunk-uploads = 32;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.caddy.virtualHosts."cache.cy7.sh".extraConfig = ''
|
services.caddy.virtualHosts."cache.cything.io".extraConfig = ''
|
||||||
import common
|
import common
|
||||||
reverse_proxy localhost:8090
|
reverse_proxy localhost:8090
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
@ -11,6 +10,7 @@
|
||||||
./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,6 +31,9 @@
|
||||||
"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;
|
||||||
};
|
};
|
||||||
|
@ -89,35 +92,9 @@
|
||||||
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 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/tailscaled.service" -j MARK --set-mark 1
|
||||||
iptables -t mangle -A OUTPUT -m cgroup --path "system.slice/caddy.service" -j MARK --set-mark 2
|
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
|
|
||||||
${tc} filter add dev ens18 parent 1: protocol ip prio 1 handle 2 fw flowid 1:20
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
networking.interfaces.ens18 = {
|
networking.interfaces.ens18 = {
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
"--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,7 @@
|
||||||
"@wheel"
|
"@wheel"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"central:KNxL0JFzHDGosui8ASem9n/tDmEAYLL9dtVMJ6TWsyg="
|
"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 +18,7 @@
|
||||||
];
|
];
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://aseipp-nix-cache.global.ssl.fastly.net"
|
"https://aseipp-nix-cache.global.ssl.fastly.net"
|
||||||
"https://cache.cy7.sh/central"
|
"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"
|
||||||
|
|
|
@ -17,9 +17,16 @@
|
||||||
"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;
|
||||||
};
|
};
|
||||||
|
@ -84,10 +91,7 @@
|
||||||
resolvconf.enable = true;
|
resolvconf.enable = true;
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [ 8080 ]; # for mitmproxy
|
||||||
8080 # mitmproxy
|
|
||||||
22000 # syncthing
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.nm-applet.enable = true;
|
programs.nm-applet.enable = true;
|
||||||
|
@ -219,7 +223,6 @@
|
||||||
"/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,13 +6,8 @@
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
useRoutingFeatures = "client";
|
useRoutingFeatures = "client";
|
||||||
extraUpFlags = [
|
extraUpFlags = [
|
||||||
"--exit-node=chunk"
|
"--exit-node=100.122.132.30"
|
||||||
"--accept-dns=false"
|
"--accept-dns=false"
|
||||||
"--operator=yt"
|
|
||||||
"--exit-node-allow-lan-access"
|
|
||||||
];
|
|
||||||
extraDaemonFlags = [
|
|
||||||
"--no-logs-no-support"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.my.backup;
|
cfg = config.my.backup;
|
||||||
|
hostname = config.networking.hostName;
|
||||||
defaultPaths = [
|
defaultPaths = [
|
||||||
"/root"
|
"/root"
|
||||||
"/home"
|
"/home"
|
||||||
|
@ -96,6 +97,23 @@ 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";
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
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,9 +16,6 @@ final: prev: {
|
||||||
cargoLock = null;
|
cargoLock = null;
|
||||||
cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM=";
|
cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM=";
|
||||||
useFetchCargoVendor = true;
|
useFetchCargoVendor = true;
|
||||||
patches = [
|
|
||||||
./concurrent-32.patch
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
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
Loading…
Add table
Add a link
Reference in a new issue