Merge branch 'master' of ssh://ssh.nx2.site:50022/nx2/dotfiles

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2026-03-03 16:48:04 +01:00
8 changed files with 85 additions and 26 deletions

View File

@@ -27,15 +27,15 @@
}, },
"NxNORTH": { "NxNORTH": {
"base": { "base": {
"foreground": "#e7ccfe", "foreground": "#e5e5e5",
"background": "#0d0019" "background": "#0c0c0c"
}, },
"to_alter": { "to_alter": {
"accent": "#9f35fc", "accent": "#999999",
"secondary": "#324cff", "secondary": "#dddddd",
"tertiary": "#4a62e7", "tertiary": "#999999",
"special": "#91fc34", "special": "#999999",
"weird": "#fc344f" "weird": "#999999"
} }
}, },
"NxDCS": { "NxDCS": {

View File

@@ -7,10 +7,9 @@
libraries = with pkgs.python3Packages; [ caldav ics pytz ]; libraries = with pkgs.python3Packages; [ caldav ics pytz ];
flakeIgnore = [ "E302" "E305" "E501" "E261" ]; flakeIgnore = [ "E302" "E305" "E501" "E261" ];
} /* python */ '' } /* python */ ''
import os
import json import json
from caldav import DAVClient from caldav import DAVClient
from datetime import datetime, timezone from datetime import datetime, timezone, timedelta
from ics import Calendar from ics import Calendar
from pytz import UTC from pytz import UTC
@@ -33,13 +32,15 @@ def datetime_parser(dct):
return dct return dct
def load_cache(cache_file): def load_cache(cache_file):
if os.path.exists(cache_file): try:
with open(cache_file, "r") as file: with open(cache_file, "r") as file:
return json.load(file, object_hook=datetime_parser) return json.load(file, object_hook=datetime_parser)
except (json.JSONDecodeError, FileNotFoundError):
return None return None
def save_cache(cache_file, data): def save_cache(cache_file, data):
with open(cache_file, "w") as file: with open(cache_file, "w") as file:
data['last_checked'] = datetime.now(timezone.utc)
json.dump(data, file, default=datetime_converter, indent=4) json.dump(data, file, default=datetime_converter, indent=4)
@@ -83,6 +84,11 @@ def is_expired(event_dict: dict):
event_end = event_dict['event_end'].timestamp() event_end = event_dict['event_end'].timestamp()
return not (now <= event_end) return not (now <= event_end)
def is_too_old(event_dict: dict) -> bool:
last_checked = event_dict['last_checked']
now = datetime.now(timezone.utc)
return now - last_checked >= timedelta(minutes=10)
if __name__ == "__main__": if __name__ == "__main__":
password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file
cache_file = "/tmp/caldav_event_cache.json" # Path to cache file cache_file = "/tmp/caldav_event_cache.json" # Path to cache file
@@ -93,7 +99,7 @@ if __name__ == "__main__":
event_dict = load_cache(cache_file) event_dict = load_cache(cache_file)
if (event_dict is None) or (is_expired(event_dict)): if (event_dict is None) or is_expired(event_dict) or is_too_old(event_dict):
event_dict = get_ongoing_or_next_event(url, username, password) event_dict = get_ongoing_or_next_event(url, username, password)
save_cache(cache_file, event_dict) save_cache(cache_file, event_dict)

View File

@@ -130,6 +130,16 @@ in /* css */ ''
border-radius: ${builtins.toString rice.rounding}px; border-radius: ${builtins.toString rice.rounding}px;
} }
} }
@-moz-document domain(notebooklm.google.com) {
body, html, notebook, omnibar {
background-color: transparent !important;
}
header, footer, .studio-panel, .chat-panel, .source-panel {
background-color: rgba(0,0,0,0.5) !important;
backdrop-filter: blur(100px);
border-radius: ${builtins.toString rice.rounding}px;
}
}
@-moz-document domain(moodle.informatik.tu-darmstadt.de) { @-moz-document domain(moodle.informatik.tu-darmstadt.de) {
body, html , .main-inner, .main-inner * { body, html , .main-inner, .main-inner * {

View File

@@ -190,7 +190,7 @@
keys = { keys = {
normal = { normal = {
"C-g" = [ ":new" ":insert-output lazygit" ":buffer-close!" ":redraw" ]; "C-g" = [ ":new" ":insert-output lazygit" ":buffer-close!" ":redraw" ];
"C-i" = [ ":pipe fgl" "toggle_comments" ]; "C-m" = [ ":pipe fgl" "toggle_comments" ];
"A-`" = [ "no_op" ]; "A-`" = [ "no_op" ];
"`" = [ "no_op" ]; "`" = [ "no_op" ];
"ö" = { "s" = [ "switch_case" ]; "u" = [ "switch_to_uppercase" ]; "l" = [ "switch_to_lowercase" ]; }; "ö" = { "s" = [ "switch_case" ]; "u" = [ "switch_to_uppercase" ]; "l" = [ "switch_to_lowercase" ]; };
@@ -215,12 +215,30 @@
language-servers = [ "tinymist" ]; language-servers = [ "tinymist" ];
# language-servers = [ "language-tool" "tinymist" ]; # language-servers = [ "language-tool" "tinymist" ];
} }
{
name = "typst-with-language-tool";
scope = "";
language-servers = [ "language-tool" "tinymist" ];
injection-regex = "";
file-types = [""];
comment-tokens = "//";
indent = { tab-width = 2; unit = " "; };
}
{ {
name = "markdown"; name = "markdown";
language-servers = [ "language-tool" "marksman" ]; language-servers = [ "marksman" ];
file-types = [ "md" "MD" ]; file-types = [ "md" "MD" ];
scope = "text.<name>"; scope = "text.<name>";
} }
{
name = "markdown-with-language-tool";
language-servers = [ "language-tool" "marksman" ];
scope = "text.<name>";
injection-regex = "";
file-types = [""];
# blcok-comment-tokens = { start = "<!--"; end = "-->"; };
indent = { tab-width = 2; unit = " "; };
}
{ {
name = "python"; name = "python";
language-servers = [ "pyright" "ruff" ]; language-servers = [ "pyright" "ruff" ];

View File

@@ -19,15 +19,16 @@
}; };
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [
xdg-desktop-portal-hyprland grim
hyprcursor
hypridle
hyprland-protocols hyprland-protocols
hyprlock hyprlock
hypridle
hyprshot
hyprpicker hyprpicker
hyprcursor hyprshade
grim hyprshot
slurp slurp
xdg-desktop-portal-hyprland
]; ];
@@ -290,7 +291,7 @@ in {
"center, title:^(terminal-file-picker)$" "center, title:^(terminal-file-picker)$"
"size 80% 80%, title:^(terminal-file-picker)$" "size 80% 80%, title:^(terminal-file-picker)$"
"size 30% 30%, initialTitle:^(Select Calendar)$" # "size 30% 30%, initialTitle:^(Select Calendar)$"
]; ];
@@ -425,6 +426,8 @@ in {
# "SUPER, B, exec, bitwarden" # "SUPER, B, exec, bitwarden"
"SUPER, N, togglesplit" "SUPER, N, togglesplit"
# "SUPER, M, exec, /home/nx2/scripts/meme-full-screen/meme-full-screen.sh " # "SUPER, M, exec, /home/nx2/scripts/meme-full-screen/meme-full-screen.sh "
''SUPER, M, exec, sh -c "hyprshade on $(find ${hyper.home}/.config/hypr/shaders -type f | sed -E 's-.*shaders/(.+)\.glsl-\1-g' | rofi -dmenu)"''
"SUPER Shift, M, exec, hyprshade off"
# "SUPER, comma, exec, /home/nx2/scripts/change-language.sh" # "SUPER, comma, exec, /home/nx2/scripts/change-language.sh"
"SUPER, ., exec, echo key x:Prior | dotool" "SUPER, ., exec, echo key x:Prior | dotool"
"SUPER, -, exec, echo key x:Next | dotool" "SUPER, -, exec, echo key x:Next | dotool"

View File

@@ -25,6 +25,7 @@
neofetch neofetch
pastel pastel
pdfgrep pdfgrep
pdftk
pipes pipes
pv pv
reflex reflex

View File

@@ -1,5 +1,5 @@
{ pkgs, ... }@all: with all; let { pkgs, ... }@all: with all; let
nox-var = (pkgs.pkgs-version != "24.05"); not-nod = (pkgs.pkgs-version != "24.05");
tfc = pkgs.unstable.xdg-desktop-portal-termfilechooser; tfc = pkgs.unstable.xdg-desktop-portal-termfilechooser;
in { in {
home.packages = [ home.packages = [
@@ -68,7 +68,8 @@ in {
# Operation # Operation
{ on = "o"; run = "open"; desc = "Open selected files"; } { on = "o"; run = "open"; desc = "Open selected files"; }
{ on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; } { on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; }
{ on = "<Enter>"; run = "open"; desc = "Open selected files"; } { on = "<Enter>"; run = "plugin smart-enter"; desc = "Open selected files"; }
# { on = "<Enter>"; run = "open"; desc = "Open selected files"; }
{ on = "<S-Enter>"; run = "open --interactive"; desc = "Open selected files interactively"; } { on = "<S-Enter>"; run = "open --interactive"; desc = "Open selected files interactively"; }
{ on = "y"; run = [ ''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'' "yank" ]; desc = "Yank selected files (copy)"; } { on = "y"; run = [ ''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'' "yank" ]; desc = "Yank selected files (copy)"; }
{ on = "y"; run = "yank"; desc = "Yank selected files (copy)"; } { on = "y"; run = "yank"; desc = "Yank selected files (copy)"; }
@@ -442,7 +443,7 @@ in {
]; ];
}; };
}; };
} // (if nox-var then { } // (if not-nod then {
shellWrapperName = "ya"; shellWrapperName = "ya";
initLua = /* lua */ '' initLua = /* lua */ ''
require("zoxide"):setup { require("zoxide"):setup {
@@ -469,8 +470,8 @@ in {
return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue") return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue")
end, 500, Header.LEFT) end, 500, Header.LEFT)
''; '';
plugins = with pkgs; { plugins = { inherit (pkgs.yaziPlugins)
inherit glow git; glow git smart-enter;
}; };
} else {}); } else {});

View File

@@ -9,8 +9,10 @@
device-boot = if hyper.host == "NxNORTH" then { device-boot = if hyper.host == "NxNORTH" then {
kernelPackages = pkgs.linuxPackages_zen; kernelPackages = pkgs.linuxPackages_zen;
kernelParams = [ kernelParams = [
"fbcon=margin:1" # "fbcon=margin:1"
"fbcon=nodefer" "fbcon=nodefer"
"video=DP-4:2560x1440@60"
# "video=HDMI-A-3:d"
]; ];
lanzaboote = { lanzaboote = {
enable = true; enable = true;
@@ -66,5 +68,23 @@ in {
config = { config = {
environment.systemPackages = with pkgs; lib.mkIf ( host == "NxNORTH" ) [ sbctl ]; environment.systemPackages = with pkgs; lib.mkIf ( host == "NxNORTH" ) [ sbctl ];
boot = { tmp.useTmpfs = false; } // device-boot; boot = { tmp.useTmpfs = false; } // device-boot;
# thx fxzzi
# sh*tty nvidia makes the tty on my 1440p monitor 1080p
# so just resize it to 1440p
systemd.services.fbset = lib.mkIf (hyper.host == "NxNORTH") {
enable = true;
wantedBy = ["multi-user.target"];
unitConfig = {
Description = "Set framebuffer resolution";
Before = "display-manager.service";
};
serviceConfig = {
Type = "oneshot";
ExecStart = "${lib.getExe pkgs.fbset} -xres 2560 -yres 1440 -match --all";
RemainAfterExit = "yes";
StandardOutput = "journal";
StandardError = "journal";
};
};
}; };
} }