Compare commits

..

9 Commits

Author SHA1 Message Date
Lennart J. Kurzweg (Nx2)
272ae1cd55 Merge branch 'master' of ssh://ssh.nx2.site:50022/nx2/dotfiles 2025-05-31 13:48:40 +02:00
Lennart J. Kurzweg (Nx2)
c4052ec34d dev ssl 2025-05-31 13:42:32 +02:00
Lennart J. Kurzweg (Nx2)
f4f80ffbde games on Ace - mindustry 2025-05-31 13:42:27 +02:00
Lennart J. Kurzweg (Nx2)
2de110149f calendar dicos ++ 2025-05-31 13:40:37 +02:00
Lennart J. Kurzweg (Nx2)
b0ab87bbab linux_6.12 ACE 2025-05-31 13:39:47 +02:00
Lennart J. Kurzweg (Nx2)
edde9bd52b proxy dev 2025-05-31 13:38:19 +02:00
Lennart J. Kurzweg (Nx2)
bf56cc88bf gitea theme 2025-05-31 13:36:19 +02:00
Lennart J. Kurzweg (Nx2)
393d7f4fc4 campuszeit 2025-05-31 13:35:52 +02:00
Lennart J. Kurzweg (Nx2)
2ecb4ce65a chatterino token 2025-05-31 13:35:43 +02:00
9 changed files with 93 additions and 26 deletions

Binary file not shown.

View File

@@ -0,0 +1,58 @@
{ pkgs, user, ... }:
{
home.packages = let
u = pkgs.writers.writePython3Bin "nx_fix_campuszeit_python" {
flakeIgnore = [ "E302" "E305" "E226" "E501" ];
} /* python */ ''
import os
import sys
def replace_campus_timezone(directory):
if not os.path.isdir(directory):
print(f"Error: {directory} is not a valid directory.")
return
for filename in os.listdir(directory):
filepath = os.path.join(directory, filename)
if not os.path.isfile(filepath):
continue
with open(filepath, 'r', encoding='utf-8') as f:
content = f.read()
if 'TZID:Europe/Berlin' in content or 'TZID="Europe/Berlin"' in content:
# Remove VTIMEZONE block for CampusNetZeit (optional depending on needs)
# Use a regex if multiple VTIMEZONE blocks may exist
start_idx = content.find('BEGIN:VTIMEZONE')
end_idx = content.find('END:VTIMEZONE', start_idx)
if start_idx != -1 and end_idx != -1:
content = content[:start_idx] + content[end_idx + len('END:VTIMEZONE\n'):]
# Replace all TZID references
content = content.replace('TZID:Europe/Berlin', 'TZID:Europe/Berlin')
content = content.replace('TZID="Europe/Berlin"', 'TZID="Europe/Berlin"')
with open(filepath, 'w', encoding='utf-8') as f:
f.write(content)
print(f"Updated time zone in: {filename}")
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python replace_timezone.py <directory>")
else:
replace_campus_timezone(sys.argv[1])
'';
in [
(pkgs.writeShellApplication {
name = "nx_fix_campuszeit";
text = /*bash*/ ''
echo CHANGING OWNERSHIP OF "$(realpath "$1")" RECURSIVELY
read -r -p "Continue?"
sudo chown -R ${user} "$1"
${u}/bin/nx_fix_campuszeit_python "$1"
sudo chown -R radicale "$1"
'';
})
];
}

View File

@@ -1,5 +1,4 @@
{ pkgs, hyper, ... }:
# lib.mkIf (host == "NxNORTH" || host == "NxACE")
pkgs.lib.mkIf (hyper.host == "NxNORTH")
{
home = {
@@ -9,7 +8,7 @@ pkgs.lib.mkIf (hyper.host == "NxNORTH")
# heroic
mindustry-wayland
# mindustry-wayland
]) ++ [ pkgs.heroic ];
sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";

View File

@@ -118,7 +118,7 @@ in
efiSupport = true;
};
};
kernelPackages = pkgs.linuxPackages; # default kernel of pkgs
kernelPackages = pkgs.linuxPackages_6_12;
};
};
}

View File

@@ -78,11 +78,14 @@ def modify_event(event):
latest_goal = goal
latest_week = week
new_description = [event.description.split("\n")[0] or "::"]
try:
new_description = [event.description.split("\n")[0]]
except AttributeError:
new_description = ["::"]
new_description.append("")
new_description.append(f"Netto: {money_made[0]:.0f},{int(money_made[1] * 10):02d}")
new_description.append(f"This weeks porgress: ({fraction_to_unicode(progress)}/{fraction_to_unicode(goal)})")
new_description.append(f"This weeks deficit: {fraction_to_unicode(deficit)}")
new_description.append(f"You're {fraction_to_unicode(abs(deficit))}h in the {'plus' if deficit < 0 else 'minus'} this week.")
event.description = "\n".join(new_description)

View File

@@ -1,6 +1,5 @@
{ pkgs, hyper, ... }:
# lib.mkIf (host == "NxNORTH" || host == "NxACE")
pkgs.lib.mkIf (hyper.host == "NxNORTH")
pkgs.lib.mkIf (hyper.host == "NxNORTH" || hyper.host == "NxACE")
{
programs = {
steam = {

View File

@@ -41,6 +41,7 @@ let dns-user = "cloudflare"; in
sub6 = "b8082b7afe9e80971fc9f9dda16ec284";
ssh = "c0f14f17f32d6595c202f041dd836eb3";
ssh6 = "f1ecb2d9d0522d4eec06437688ca76da";
dev = "80e76834acc9243696d9763759b22147";
};
passord-file-path = config.sops.secrets."nx2site/cloudflare/global-api-key".path;
in pkgs.writers.writePython3Bin "dyn_dns" {
@@ -84,13 +85,14 @@ def main():
# Perform DNS updates
# https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-update-dns-record
print(f"${hyper.domain}: {update_record(record_id="${record_id.base}", record_name="${hyper.domain}", ip=my_ip, type="A", proxied=True, pw=pw).status_code}")
print(f"*.${hyper.domain}: {update_record(record_id="${record_id.sub}", record_name="*.${hyper.domain}", ip=my_ip, type="A", proxied=True, pw=pw).status_code}")
print(f"ssh.${hyper.domain}: {update_record(record_id="${record_id.ssh}", record_name="ssh.${hyper.domain}", ip=my_ip, type="A", proxied=False, pw=pw).status_code}")
print(f"${hyper.domain}: {update_record(record_id="${record_id.base}", record_name="${hyper.domain}", ip=my_ip, type="A", proxied=True, pw=pw).status_code}", end=", ")
print(f"*.${hyper.domain}: {update_record(record_id="${record_id.sub}", record_name="*.${hyper.domain}", ip=my_ip, type="A", proxied=True, pw=pw).status_code}", end=", ")
print(f"ssh.${hyper.domain}: {update_record(record_id="${record_id.ssh}", record_name="ssh.${hyper.domain}", ip=my_ip, type="A", proxied=False, pw=pw).status_code}", end=", ")
print(f"dev.${hyper.domain}: {update_record(record_id="${record_id.dev}", record_name="dev.${hyper.domain}", ip=my_ip, type="A", proxied=False, pw=pw).status_code}", end=", ")
print(f"${hyper.domain}: {update_record(record_id="${record_id.base6}", record_name="${hyper.domain}", ip=my_ip6, type="AAAA", proxied=True, pw=pw).status_code}")
print(f"*.${hyper.domain}: {update_record(record_id="${record_id.sub6}", record_name="*.${hyper.domain}", ip=my_ip6, type="AAAA", proxied=True, pw=pw).status_code}")
print(f"ssh.${hyper.domain}: {update_record(record_id="${record_id.ssh6}", record_name="ssh.${hyper.domain}", ip=my_ip6, type="AAAA", proxied=False, pw=pw).status_code}")
print(f"${hyper.domain}: {update_record(record_id="${record_id.base6}", record_name="${hyper.domain}", ip=my_ip6, type="AAAA", proxied=True, pw=pw).status_code}", end=", ")
print(f"*.${hyper.domain}: {update_record(record_id="${record_id.sub6}", record_name="*.${hyper.domain}", ip=my_ip6, type="AAAA", proxied=True, pw=pw).status_code}", end=", ")
print(f"ssh.${hyper.domain}: {update_record(record_id="${record_id.ssh6}", record_name="ssh.${hyper.domain}", ip=my_ip6, type="AAAA", proxied=False, pw=pw).status_code}", end="")
if __name__ == "__main__":
main()

View File

@@ -93,8 +93,8 @@ let git-user = "git"; in
domain = "git.${hyper.domain}";
owner = "nx2";
repo = "Gitea-Pitch-Black";
rev = "0.1.0";
hash = "sha256-pU4YhgcPOT3PTcmBTjNE3FcyJgl39JGP41ckhRUKN7Y=";
rev = "0.1.1";
hash = "sha256-40LzF/DobikNzrFjCSzvCT0g4x/CKS2JUWTf/CyJoJs=";
};
in {
"gitea-theme" = /* bash */ ''

View File

@@ -14,7 +14,7 @@
};
certs = {
"${hyper.domain}" = {
extraDomainNames = builtins.map (subd: "${subd}.${hyper.domain}") [ "sync" "dev" ];
extraDomainNames = builtins.map (subd: "${subd}.${hyper.domain}") [ "sync" ];
};
};
};
@@ -136,7 +136,7 @@
listen = dl;
locations = { "/" = { proxyPass = "http://127.0.0.1:8441"; }; };
};
"dav.${hyper.domain}" = lib.mkIf config.services.radicale.enable (vh // {
"dav.${hyper.domain}" = pkgs.lib.mkIf config.services.radicale.enable (vh // {
listen = dl;
locations = { "/" = { proxyPass = "http://127.0.0.1:5232"; }; };
});
@@ -150,16 +150,22 @@
proxyWebsockets = true;
};
};
"pnx.${hyper.domain}" = vh // {
listen = dl;
locations."/" = {
proxyPass = "http://127.0.0.1:8040";
proxyWebsockets = true;
};
};
"wip.${hyper.domain}" = vh // {
listen = dl;
};
"dev.${hyper.domain}" = vh // {
listen = dl ++ [
# { addr = "0.0.0.0"; port = 8000; ssl = true; }
# { addr = "[::0]"; port = 8000; ssl = true; }
];
root = "/var/lib/hugo/nx2site/public";
# locations."/" = {
# proxyPass = "http://127.0.0.1:8000";
# proxyWebsockets = true;
# };
listen = dl;
locations."/" = {
proxyPass = "http://127.0.0.1:8080";
proxyWebsockets = true;
};
};
# is done atomatically
# "cal.${hyper.domain}" = vh // {