From 9d84b4bcf0ab9497d0642fceb9cab9f5279ce5f9 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Fri, 22 Aug 2025 14:32:18 +0200 Subject: [PATCH 01/15] streamlink oauth --- git-crypt/secrets.nix | Bin 3490 -> 3552 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/git-crypt/secrets.nix b/git-crypt/secrets.nix index d5fa26728ba957023af352b21af41d75b3458d16..ef17bb3b8f964d0e4ffafb641be5905a32ba7a7e 100644 GIT binary patch literal 3552 zcmZQ@_Y83kiVO&0xZ8I0RKMCmU$>1b*bKzZFaMPMy);9&S>$Kc4n6kZQk^ds_L(v% z^f+W*vtE{N`)jY0;EFpNCumuQ1ZJN<^=!w1)vT(=r@Z|hrlVlhb@X4em&a|X6VrpgMp+K-8wT@G1XZaiJeBd4zN^tMFi&z=AS z&repXHm$Xa5Y*XxW<&ez1Gl7}wckJfa>`ZHt%b&Bp*z2dKWCGju=RLf^>cx0!JJ&NsFOqt^dCIwyvL3}2=PEYveL2SQxzkgA+MFdNM{TSq(d2!d)m)SHoskW>*ryw$D6r>?=Sf}|7+j{`I1k! zw^V$~?U`s`>U=n{dGNa4Vf%pE&bttXTi+~@9IyKIS{yiTI}iB~`W zS8zJcee>?m4{w7?jw88S&zna4-s-5I|6OUSY`t~-shuY8yquf^9%jCipOSa8YwOY1 z*>WKh1S{t9Nvy05z2wmtx?(end1qJpr6SkKzJpU~&cbc~{Xo{46*);Y3 z>$BkrUTM9z6@?e(o2;6uDLqr#WSXPh-nZwSrp`Nf z$;tDx^6AQg@TXdOJ8tj5zX&(|#UaPU>=Z>ojOP&NqtV()#C;rs_73QhmKVCcMm^Vdg zmW6bpUSR{nmiR*(RP--|PTx@G$am~-^ZM@*e-B+yJhC@2VQqO*2iI7Kx(IDMJ)T#Ge=ww{f>Oj;FkQsYu=>a(@!m`Te|rFu1Qx_&f9*;`<63zY484B z3Ul2{`KF$mKez7Ot4$wyXA}f_*GqkO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zlzI=SgMsi11*WVjm$;!`*Gv;qld=#>;VQt-<1JHJ(nC>&hbiZne?vHce!tV?a66N1+G=a$ZM8Zwg+W1`*7@v z4!+j$V#BTEBYImF`l!4!D7eaJH|dBIzjyGoY5Y3{(_Z`xo2uf?{NhQ@We2Aki}fu= zskeXj2u@B?YgV}vCU5j7Dd^X8?`)pQOk$j}KQk8@zke^u;=BK46zB71wudYlff_tE zCO;iwI~nh@EN+ooI;ZH9gN1&c+H7rA@LWL>4uczm)==xxx>*V>{|9S_9_@{q)i+)Fj1zvTYIqRB$vQp5q8-{$#m*z1P znyOXy6>I7>iiEH>y{Ref>RQ`d;Kh}YsZgeUwap{&#UqbL{wrq(OML(Oc5&OTjT3J- zOmhkkwfXRIcArvCMwzvv&-0sCdbj>isK3q7p#Ad7xlYZ+VeVJ2C{LX7by{`xy|+>s z-r1Iii|X$`-=7m4%*&y$Ab8IAjY=*vet(^Ep?sry+0LcG-`>kV6x^7zB5UuuoRjx6 zp85-ZbJq+#$F!H_MY}+yjs6``=KnK!)2tH?ukB=V&w9tPDZTy3NsU?Y&nuj^$NpK` zryaDnb8gAzE!x_mA5F{I{(g_U_Bu1#Ek!YN*M<3I)4nct+*(og;B}SZxd#^Y2RPpK zZnz;fz2$C1`L;=$R~9@fd@syT0Yw)g&6 z{OFY4iph-+xZW9xo9pcPb?a;Q6viv_uc+_%F{kP`w@L5Mw5jiQtlg?*J%3V=_Y%_? zKIYgsuX?t@ zjSjz8hc&heJQd(cwpz-#WZ{>oq4HJ|%zRa+9L0C8xvz4MXTirM^+vyit##FlysMjJ uC$7)A8z*4$J9Njo=slY@Kel}PBEe-!a+KMum5o<^*T?Zp(`&R0z5oF4xW&c* From 83af085bd6df8fef90f268ae377a7a9b6e0ebfef Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Fri, 22 Aug 2025 14:33:11 +0200 Subject: [PATCH 02/15] streamlink --- home-modules/chatterino.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/home-modules/chatterino.nix b/home-modules/chatterino.nix index ecdc68b..e0a8915 100644 --- a/home-modules/chatterino.nix +++ b/home-modules/chatterino.nix @@ -207,7 +207,7 @@ in { "external": { "streamlink": { "quality": "", - "options": "--config ${hyper.home}/.config/streamlink/config" + "options": "--config ${hyper.home}.config/streamlink/config" } } } @@ -329,10 +329,9 @@ in { ] } ''; - ".config/streamlink/config".text = '' - twitch-api-header=Authorization=OAuth='$(cat ${config.sops.secrets."streamlink/twitch-oauth".path})' + ".config/streamlink/config".text = /* ini */ '' + twitch-api-header=Authorization=OAuth ${secrets.streamlink.twitch-oauth} player=mpv - player-args='--no-terminal' twitch-low-latency default-stream=best ''; From de8e26e6e3fe51d08245471282ef04577ea75905 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Fri, 22 Aug 2025 14:34:00 +0200 Subject: [PATCH 03/15] hyprbar --- home-modules/bar.nix | 807 ++++++++++++++++++++++ home-modules/hyprland.nix | 54 +- home-modules/mako.nix | 4 +- home-modules/waybar.nix | 379 ---------- home.nix | 2 +- sops-secrets.yaml | 6 +- system-modules/hardware-configuration.nix | 2 + system-modules/health_reminder.nix | 10 +- 8 files changed, 849 insertions(+), 415 deletions(-) create mode 100644 home-modules/bar.nix delete mode 100644 home-modules/waybar.nix diff --git a/home-modules/bar.nix b/home-modules/bar.nix new file mode 100644 index 0000000..f8632bd --- /dev/null +++ b/home-modules/bar.nix @@ -0,0 +1,807 @@ +{ pkgs, hyper, ... }@all: with all; let + sep = " "; +in { + sops.secrets = { + "nx2site/radicale/password" = { }; + }; + home.packages = [ + (pkgs.writeShellApplication { name = "submap_indicator"; text = /*bash*/ '' + print_help() { + echo "Usage: submap_indicator {set |unset}" + } + if [ $# -lt 1 ]; then + print_help; exit 1; + fi + case "$1" in + set) + # Check if there is a second argument for the 'set' operation + if [ $# -eq 2 ]; then + echo "$2" > /tmp/submap-indictor + pkill -RTMIN+8 waybar + pkill -RTMIN+8 hyprpanel + else + echo "Error: 'set' operation requires exactly one string argument." + print_help + exit 1 + fi + ;; + unset) + echo "" > /tmp/submap-indictor + pkill -RTMIN+8 waybar + pkill -RTMIN+8 hyprpanel + ;; + *) + echo "Error: Unknown command '$1'" + print_help + exit 1 + ;; + esac + exit 0 + '';}) + (pkgs.writeShellApplication { name = "cclock"; text = /*bash*/ '' + ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}') + if [ $# -eq 0 ]; then + echo "󰃮${sep}$(date +'%A the')" "$ord" "of" "$(date +'%B')" " ${sep}$(date +'%R')" + elif [ "$1" = "--no-icons" ]; then + echo "$(date +'%A the')" "$ord" "of" "$(date +'%B')" "$(date +'%R')" + fi + '';}) + + (pkgs.writers.writePython3Bin "caldav_event" { + libraries = with pkgs.python3Packages; [ caldav ics pytz ]; + flakeIgnore = [ "E302" "E305" "E501" "E261" ]; + } /* python */ '' +import os +import json +from caldav import DAVClient +from datetime import datetime, timezone +from ics import Calendar +from pytz import UTC + +def get_password(password_file): + with open(password_file, "r") as file: + return file.read().strip() + +def datetime_converter(obj): + if isinstance(obj, datetime): + return obj.isoformat() + return obj + +def datetime_parser(dct): + for key, value in dct.items(): + if isinstance(value, str): + try: + dct[key] = datetime.fromisoformat(value) + except ValueError: + pass + return dct + +def load_cache(cache_file): + if os.path.exists(cache_file): + with open(cache_file, "r") as file: + return json.load(file, object_hook=datetime_parser) + return None + +def save_cache(cache_file, data): + with open(cache_file, "w") as file: + json.dump(data, file, default=datetime_converter, indent=4) + + +def get_ongoing_or_next_event(url, username, password): + now = datetime.now(timezone.utc) + + try: + client = DAVClient(url, username=username, password=password) + principal = client.principal() + calendars = principal.calendars() + + next_event_dict = { + 'event_name': "fake", + 'event_begin': datetime(9000, 1, 1, tzinfo=UTC), # in the year 9000 + 'event_end': datetime(9000, 1, 1, 8, tzinfo=UTC), + } + + for calendar in calendars: + for event in calendar.search(start=now): + calendar_parsed = Calendar(event.data) + for ics_event in calendar_parsed.events: + event_dict = {} + event_dict['event_name'] = ics_event.name or "(No Title)" + event_dict['event_begin'] = ics_event.begin.astimezone(timezone.utc) + event_dict['event_end'] = ics_event.end.astimezone(timezone.utc) + + if event_dict['event_begin'] <= now and now <= event_dict['event_end']: + return event_dict + elif event_dict['event_begin'] >= now and next_event_dict['event_begin'] > event_dict['event_begin']: + next_event_dict = event_dict + return next_event_dict + + except Exception as e: + print(f"Error accessing {url}: {e}") + return None + +def is_expired(event_dict: dict): + now = datetime.now(timezone.utc).timestamp() + event_end = event_dict['event_end'].timestamp() + return not (now <= event_end) + +if __name__ == "__main__": + password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file + cache_file = "/tmp/caldav_event_cache.json" # Path to cache file + url = "https://dav.${hyper.domain}/" + username = "nx2" + password = get_password(password_file) + now = datetime.now(timezone.utc).timestamp() + + event_dict = load_cache(cache_file) + + if (event_dict is None) or (is_expired(event_dict)): + event_dict = get_ongoing_or_next_event(url, username, password) + save_cache(cache_file, event_dict) + + if event_dict is None: # none were found + print("* zen *") + exit(0) + + event_start = event_dict['event_begin'].timestamp() + event_end = event_dict['event_end'].timestamp() + + if event_start <= now <= event_end: # is currently ongoing + action_string = "ends" + t = event_end - now # time_remaining + else: # is in the future + action_string = "starts" + t = event_start - now # time_remaining + + hours, rem = divmod(int(t), 3600) + minutes, _ = divmod(rem, 60) + hour_string = f"{hours} hour{'s ' if hours != 1 else ' '}" if hours > 0 else "" + minu_string = f"{minutes} minute{'s ' if minutes != 1 else ' '}" if minutes > 0 else "" + if hour_string == "" and minu_string == "": + time_string = "now" + elif hour_string == "" or minu_string == "": + time_string = "in " + hour_string + minu_string + else: + time_string = "in " + hour_string + "and " + minu_string + + print(f"{event_dict['event_name']} {action_string} {time_string}") +'') + ]; + programs = { + waybar = { + enable = false; + package = pkgs.waybar; + settings = { + bar = { + # height = 20; + layer = "top"; + position = "bottom"; + margin-top = 0; + # margin-left = rice.gap-size; + # margin-bottom = rice.gap-size; + # margin-right = rice.gap-size; + margin-left = 0; + margin-bottom = 0; + margin-right = 0; + spacing = 10; + fixed-center = true; + modules-left = [ + # "cpu" + # "memory" + "wireplumber" + "backlight" + "battery" + "network" + "hyprland/window" + ]; + modules-center = [ + "hyprland/workspaces" + ]; + modules-right = [ + "custom/mode" + "custom/caldav_event" + "custom/cclock" + "tray" + ]; + "hyprland/workspaces" = { + on-click = "activate"; + format = "{name}"; + all-outputs = false; + active-only = false; + }; + "hyprland/window" = { + # format = "${sep}{}"; + format = "{}"; + separate-outputs = true; + }; + "custom/cclock" = { + exec = "cclock"; + restart-interval = 60; + }; + "custom/caldav_event" = { + format = "󰃰${sep}{}"; + exec = "caldav_event"; + restart-interval = 60; + max-width = 60; + }; + "custom/mode" = { + exec = "cat /tmp/submap-indictor"; + interval = "once"; + signal = 8; + }; + + cpu = { + interval = 1; + format = "󰍛${sep}{}%"; + max-length = 10; + }; + memory = { + interval = 5; + format = "${sep}{avail:.0f}G free"; + }; + battery = { + interval = 60; + tooltip = false; + format = "{icon}${sep}{capacity}%"; + states = { + warning = 15; + critical = 5; + }; + format-icons = [ " " " " " " " " " " ]; + format-charging = "{icon}${sep}+{capacity}%"; + format-plugged = "{icon}${sep}P{capacity}%"; + format-full = "{icon}${sep}F{capacity}%"; + }; + backlight = { + device = "eDP-1"; + format = "{icon}${sep}{percent}%"; + format-icons = [ "" "" "" "" "" "" "" "" "" ]; + }; + network = { + format-wifi = "${sep}{essid}"; + format-ethernet = "󰈀${sep}Wired"; + format-disconnected = "󰌙${sep}Disconnected"; + }; + wireplumber = { + format = "󰕾${sep}{volume}%"; + format-muted = "󰝟${sep}--%"; + }; + }; + }; + style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ '' + * { + font-family: ${rice.font.code.name}; + font-size: 1em; + min-height: 0px; + margin: 0px; + padding: 0px; + } + + window#waybar { + background: rgba(${f background},${builtins.toString rice.transparency}); + } + + #clock, + #custom-cclock, + #custom-mode, + #custom-caldav-event, + #battery, + #cpu, + #tray, + #disk, + #backlight, + #network, + #wireplumber, + #memory, + #window, + #workspaces { + padding: 0px 3px; + margin-top: 0.3em; + border-radius: ${builtins.toString rice.rounding}px; + color: rgb(${f accent.bright}); + } + + #workspaces button { + color: rgb(${f accent.base}); + padding-left: 15px; + padding-right: 15px; + border-radius: ${builtins.toString rice.rounding}px; + } + #workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); } + #workspaces button:hover { color: rgb(${f tertiary.bright}); } + #workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); } + + #window, #custom-caldav_event { + font-family: ${rice.font.base.name}, ${rice.font.code.name}; + color: rgb(${f tertiary.bright}); + } + + #wireplumber.muted { color: rgb(${f tertiary.bright}); } + #wireplumber { padding-left: 10px; } + + #battery.warning:not(.charging) { color: rgb(${f green.base});; } + #battery.charging { color: rgb(${f green.base}); } + #battery.critical { + background: rgb(${f negative.base}); + color: rgb(${f foreground}); + } + + #custom-mode { color: rgb(${f red.base}); } + ''; + }; + hyprpanel = { + enable = true; + package = pkgs.unstable.hyprpanel; + settings = with rice.color; let + t = builtins.toString (builtins.ceil (rice.transparency * 100)); + in { + "bar.layouts" = { + "*" = { + "left" = [ + "volume" + # "microphone" + # "cpu" + # "cputemp" + # "ram" + "battery" + # "bluetooth" + "network" + "windowtitle" + ]; + "middle" = [ "workspaces" ]; + "right" = [ + "submap" + "custom/caldav_event" + "media" + "custom/cclock" + "notifications" + "systray" + ]; + }; + }; + + "bar.bluetooth.label" = true; + + "bar.customModules.submap.enabledIcon" = "[󰧹]"; + "bar.customModules.submap.showSubmapName" = false; + "bar.customModules.submap.label" = false; + "bar.customModules.submap.icon" = true; + "bar.customModules.submap.disabledIcon" = ""; + + "bar.workspaces.applicationIconOncePerWorkspace" = false; + "bar.workspaces.numbered_active_indicator" = "underline"; + "bar.workspaces.scroll_speed" = 1; + "bar.workspaces.showAllActive" = false; + "bar.workspaces.showApplicationIcons" = true; + "bar.workspaces.show_icons" = false; + "bar.workspaces.show_numbered" = false; + "bar.workspaces.showWsIcons" = true; + "bar.workspaces.spacing" = 1; + "bar.workspaces.workspaceMask" = true; + "bar.workspaces.workspaces" = 5; + + "theme.bar.background" = background; + "theme.bar.border.color" = accent.base; + "theme.bar.border_radius" = "0.2em"; + + "theme.bar.buttons.background" = background; + "theme.bar.buttons.background_opacity" = 0; + "theme.bar.buttons.spacing" = "0em"; + "theme.bar.buttons.padding_x" = "0.5rem"; + + "theme.bar.buttons.battery.background" = background; + "theme.bar.buttons.battery.border" = accent.base; + "theme.bar.buttons.battery.icon_background" = background; + "theme.bar.buttons.battery.icon" = accent.base; + "theme.bar.buttons.battery.text" = accent.base; + + "theme.bar.buttons.bluetooth.background" = background; + "theme.bar.buttons.bluetooth.border" = accent.base; + "theme.bar.buttons.bluetooth.icon_background" = background; + "theme.bar.buttons.bluetooth.icon" = accent.base; + "theme.bar.buttons.bluetooth.text" = accent.base; + + "theme.bar.buttons.borderColor" = accent.base; + + "theme.bar.buttons.clock.background" = background; + "theme.bar.buttons.clock.border" = accent.base; + "theme.bar.buttons.clock.icon_background" = background; + "theme.bar.buttons.clock.icon" = accent.base; + "theme.bar.buttons.clock.text" = accent.base; + + "theme.bar.buttons.dashboard.background" = background; + "theme.bar.buttons.dashboard.border" = accent.base; + "theme.bar.buttons.dashboard.icon" = accent.base; + "theme.bar.buttons.icon_background" = background; + + "theme.bar.buttons.icon" = accent.base; + + "theme.bar.buttons.media.background" = background; + "theme.bar.buttons.media.border" = accent.base; + "theme.bar.buttons.media.icon_background" = background; + "theme.bar.buttons.media.icon" = accent.base; + "theme.bar.buttons.media.text" = accent.base; + + "theme.bar.buttons.modules.cava.background" = background; + "theme.bar.buttons.modules.cava.border" = accent.base; + "theme.bar.buttons.modules.cava.icon_background" = background; + "theme.bar.buttons.modules.cava.icon" = accent.base; + "theme.bar.buttons.modules.cava.text" = accent.base; + + "theme.bar.buttons.modules.cpu.background" = background; + "theme.bar.buttons.modules.cpu.border" = accent.base; + "theme.bar.buttons.modules.cpu.icon_background" = background; + "theme.bar.buttons.modules.cpu.icon" = accent.base; + "theme.bar.buttons.modules.cpu.text" = accent.base; + + "theme.bar.buttons.modules.cpuTemp.background" = background; + "theme.bar.buttons.modules.cpuTemp.border" = accent.base; + "theme.bar.buttons.modules.cpuTemp.icon_background" = background; + "theme.bar.buttons.modules.cpuTemp.icon" = accent.base; + "theme.bar.buttons.modules.cpuTemp.text" = accent.base; + + "theme.bar.buttons.modules.hypridle.background" = background; + "theme.bar.buttons.modules.hypridle.border" = accent.base; + "theme.bar.buttons.modules.hypridle.icon_background" = background; + "theme.bar.buttons.modules.hypridle.icon" = accent.base; + "theme.bar.buttons.modules.hypridle.text" = accent.base; + + "theme.bar.buttons.modules.hyprsunset.background" = background; + "theme.bar.buttons.modules.hyprsunset.border" = accent.base; + "theme.bar.buttons.modules.hyprsunset.icon_background" = background; + "theme.bar.buttons.modules.hyprsunset.icon" = accent.base; + "theme.bar.buttons.modules.hyprsunset.text" = accent.base; + + "theme.bar.buttons.modules.kbLayout.background" = background; + "theme.bar.buttons.modules.kbLayout.border" = accent.base; + "theme.bar.buttons.modules.kbLayout.icon_background" = background; + "theme.bar.buttons.modules.kbLayout.icon" = accent.base; + "theme.bar.buttons.modules.kbLayout.text" = accent.base; + + "theme.bar.buttons.modules.microphone.background" = background; + "theme.bar.buttons.modules.microphone.border" = accent.base; + "theme.bar.buttons.modules.microphone.icon_background" = background; + "theme.bar.buttons.modules.microphone.icon" = accent.base; + "theme.bar.buttons.modules.microphone.text" = accent.base; + + "theme.bar.buttons.modules.netstat.background" = background; + "theme.bar.buttons.modules.netstat.border" = accent.base; + "theme.bar.buttons.modules.netstat.icon_background" = background; + "theme.bar.buttons.modules.netstat.icon" = accent.base; + "theme.bar.buttons.modules.netstat.text" = accent.base; + + "theme.bar.buttons.modules.power.background" = background; + "theme.bar.buttons.modules.power.border" = accent.base; + "theme.bar.buttons.modules.power.icon_background" = background; + "theme.bar.buttons.modules.power.icon" = accent.base; + + "theme.bar.buttons.modules.ram.background" = background; + "theme.bar.buttons.modules.ram.border" = accent.base; + "theme.bar.buttons.modules.ram.icon_background" = background; + "theme.bar.buttons.modules.ram.icon" = accent.base; + "theme.bar.buttons.modules.ram.text" = accent.base; + + "theme.bar.buttons.modules.storage.background" = background; + "theme.bar.buttons.modules.storage.border" = accent.base; + "theme.bar.buttons.modules.storage.icon_background" = background; + "theme.bar.buttons.modules.storage.icon" = accent.base; + "theme.bar.buttons.modules.storage.text" = accent.base; + + "theme.bar.buttons.modules.submap.background" = background; + "theme.bar.buttons.modules.submap.border" = accent.base; + "theme.bar.buttons.modules.submap.icon_background" = background; + "theme.bar.buttons.modules.submap.icon" = accent.base; + "theme.bar.buttons.modules.submap.text" = special.base; + + "theme.bar.buttons.modules.updates.background" = background; + "theme.bar.buttons.modules.updates.border" = accent.base; + "theme.bar.buttons.modules.updates.icon_background" = background; + "theme.bar.buttons.modules.updates.icon" = accent.base; + "theme.bar.buttons.modules.updates.text" = accent.base; + + "theme.bar.buttons.modules.weather.background" = background; + "theme.bar.buttons.modules.weather.border" = accent.base; + "theme.bar.buttons.modules.weather.icon_background" = background; + "theme.bar.buttons.modules.weather.icon" = accent.base; + "theme.bar.buttons.modules.weather.text" = accent.base; + + "theme.bar.buttons.modules.worldclock.background" = background; + "theme.bar.buttons.modules.worldclock.border" = accent.base; + "theme.bar.buttons.modules.worldclock.icon_background" = background; + "theme.bar.buttons.modules.worldclock.icon" = accent.base; + "theme.bar.buttons.modules.worldclock.text" = accent.base; + "theme.bar.buttons.monochrome" = false; + + "theme.bar.buttons.network.background" = background; + "theme.bar.buttons.network.border" = accent.base; + "theme.bar.buttons.network.icon_background" = background; + "theme.bar.buttons.network.icon" = accent.base; + "theme.bar.buttons.network.text" = accent.base; + + "theme.bar.buttons.notifications.background" = background; + "theme.bar.buttons.notifications.border" = accent.base; + "theme.bar.buttons.notifications.icon_background" = background; + "theme.bar.buttons.notifications.icon" = accent.base; + "theme.bar.buttons.notifications.total" = accent.base; + + "theme.bar.buttons.opacity" = t; + + "theme.bar.buttons.separator.color" = accent.base; + + "theme.bar.buttons.style" = "default"; + + "theme.bar.buttons.systray.background" = background; + "theme.bar.buttons.systray.border" = accent.base; + "theme.bar.buttons.systray.customIcon" = accent.base; + + "theme.bar.buttons.text" = accent.base; + + "theme.bar.buttons.volume.background" = background; + "theme.bar.buttons.volume.border" = accent.base; + "theme.bar.buttons.volume.icon_background" = background; + "theme.bar.buttons.volume.icon" = accent.base; + "theme.bar.buttons.volume.text" = accent.base; + + "theme.bar.buttons.windowtitle.background" = background; + "theme.bar.buttons.windowtitle.border" = secondary.base; + "theme.bar.buttons.windowtitle.icon_background" = background; + "theme.bar.buttons.windowtitle.icon" = secondary.base; + "theme.bar.buttons.windowtitle.text" = secondary.base; + + "theme.bar.buttons.workspaces.active" = accent.bright; + "theme.bar.buttons.workspaces.available" = accent.base; + "theme.bar.buttons.workspaces.background" = background; + "theme.bar.buttons.workspaces.border" = accent.base; + "theme.bar.buttons.workspaces.hover" = foreground; + "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color" = accent.base; + "theme.bar.buttons.workspaces.numbered_active_highlight_padding" = "0.2em"; + "theme.bar.buttons.workspaces.numbered_active_underline_color" = accent.bright; + "theme.bar.buttons.workspaces.numbered_inactive_padding" = "0.2em"; + "theme.bar.buttons.workspaces.occupied" = secondary.base; + "theme.bar.buttons.workspaces.pill.width" = "4em"; + "theme.bar.buttons.workspaces.smartHighlight" = true; + "theme.bar.buttons.y_margins" = "0em"; + + "theme.bar.location" = "bottom"; + + "theme.bar.menus.menu.battery.background.color" = background; + "theme.bar.menus.menu.battery.border.color" = accent.base; + "theme.bar.menus.menu.battery.card.color" = accent.dark; + "theme.bar.menus.menu.battery.icons.active" = accent.base; + "theme.bar.menus.menu.battery.icons.passive" = accent.base; + "theme.bar.menus.menu.battery.label.color" = accent.base; + "theme.bar.menus.menu.battery.listitems.active" = accent.base; + "theme.bar.menus.menu.battery.listitems.passive" = accent.base; + "theme.bar.menus.menu.battery.slider.background" = background; + "theme.bar.menus.menu.battery.slider.backgroundhover" = background; + "theme.bar.menus.menu.battery.slider.primary" = accent.base; + "theme.bar.menus.menu.battery.slider.puck" = accent.base; + "theme.bar.menus.menu.battery.text" = foreground; + + "theme.bar.menus.menu.bluetooth.background.color" = background; + "theme.bar.menus.menu.bluetooth.border.color" = accent.base; + "theme.bar.menus.menu.bluetooth.card.color" = accent.dark; + "theme.bar.menus.menu.bluetooth.iconbutton.active" = accent.base; + "theme.bar.menus.menu.bluetooth.iconbutton.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.icons.active" = accent.base; + "theme.bar.menus.menu.bluetooth.icons.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.label.color" = accent.base; + "theme.bar.menus.menu.bluetooth.listitems.active" = accent.base; + "theme.bar.menus.menu.bluetooth.listitems.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.scroller.color" = accent.base; + "theme.bar.menus.menu.bluetooth.status" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.disabled" = accent.base; + "theme.bar.menus.menu.bluetooth.switch_divider" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.enabled" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.puck" = accent.base; + "theme.bar.menus.menu.bluetooth.text" = foreground; + + "theme.bar.menus.menu.clock.background.color" = background; + "theme.bar.menus.menu.clock.border.color" = accent.base; + "theme.bar.menus.menu.clock.calendar.contextdays" = foreground; + "theme.bar.menus.menu.clock.calendar.currentday" = accent.base; + "theme.bar.menus.menu.clock.calendar.days" = accent.base; + "theme.bar.menus.menu.clock.calendar.paginator" = accent.base; + "theme.bar.menus.menu.clock.calendar.weekdays" = accent.base; + "theme.bar.menus.menu.clock.calendar.yearmonth" = accent.base; + "theme.bar.menus.menu.clock.card.color" = accent.dark; + "theme.bar.menus.menu.clock.text" = foreground; + "theme.bar.menus.menu.clock.time.time" = accent.base; + "theme.bar.menus.menu.clock.time.timeperiod" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.icon" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.temperature" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.time" = accent.base; + "theme.bar.menus.menu.clock.weather.icon" = accent.base; + "theme.bar.menus.menu.clock.weather.stats" = accent.base; + "theme.bar.menus.menu.clock.weather.status" = accent.base; + "theme.bar.menus.menu.clock.weather.temperature" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.cold" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.extremelycold" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.hot" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.moderate" = accent.base; + + "theme.bar.menus.menu.dashboard.background.color" = background; + "theme.bar.menus.menu.dashboard.border.color" = accent.base; + "theme.bar.menus.menu.dashboard.card.color" = accent.dark; + + "theme.bar.menus.menu.dashboard.controls.bluetooth.background" = background; + "theme.bar.menus.menu.dashboard.controls.bluetooth.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.disabled" = accent.base; + "theme.bar.menus.menu.dashboard.controls.input.background" = background; + "theme.bar.menus.menu.dashboard.controls.input.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.notifications.background" = background; + "theme.bar.menus.menu.dashboard.controls.notifications.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.volume.background" = background; + "theme.bar.menus.menu.dashboard.controls.volume.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.wifi.background" = background; + "theme.bar.menus.menu.dashboard.controls.wifi.text" = foreground; + + "theme.bar.menus.menu.dashboard.directories.left.bottom.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.left.middle.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.left.top.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.bottom.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.middle.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.top.color" = accent.base; + + "theme.bar.menus.menu.dashboard.monitors.bar_background" = background; + "theme.bar.menus.menu.dashboard.monitors.cpu.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.cpu.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.cpu.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.label" = accent.base; + + "theme.bar.menus.menu.dashboard.powermenu.confirmation.background" = background; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.body" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.border" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text" = foreground; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.card" = accent.dark; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.label" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.logout" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.restart" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.shutdown" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.sleep" = accent.base; + "theme.bar.menus.menu.dashboard.profile.name" = accent.base; + "theme.bar.menus.menu.dashboard.shortcuts.background" = background; + "theme.bar.menus.menu.dashboard.shortcuts.recording" = accent.base; + "theme.bar.menus.menu.dashboard.shortcuts.text" = foreground; + + "theme.bar.menus.menu.media.album" = accent.base; + "theme.bar.menus.menu.media.artist" = accent.base; + "theme.bar.menus.menu.media.background.color" = "#000000"; + "theme.bar.menus.menu.media.border.color" = accent.base; + "theme.bar.menus.menu.media.buttons.background" = background; + "theme.bar.menus.menu.media.buttons.enabled" = accent.base; + "theme.bar.menus.menu.media.buttons.inactive" = accent.base; + "theme.bar.menus.menu.media.buttons.text" = foreground; + "theme.bar.menus.menu.media.card.color" = accent.dark; + "theme.bar.menus.menu.media.card.tint" = accent.dark; + "theme.bar.menus.menu.media.slider.background" = accent.dark; + "theme.bar.menus.menu.media.slider.backgroundhover" = secondary.dark; + "theme.bar.menus.menu.media.slider.primary" = accent.base; + "theme.bar.menus.menu.media.slider.puck" = accent.bright; + "theme.bar.menus.menu.media.song" = accent.base; + "theme.bar.menus.menu.media.timestamp" = accent.base; + + "theme.bar.menus.menu.network.background.color" = background; + "theme.bar.menus.menu.network.border.color" = accent.base; + "theme.bar.menus.menu.network.card.color" = accent.dark; + "theme.bar.menus.menu.network.iconbuttons.active" = accent.base; + "theme.bar.menus.menu.network.iconbuttons.passive" = accent.base; + "theme.bar.menus.menu.network.icons.active" = accent.base; + "theme.bar.menus.menu.network.icons.passive" = accent.base; + "theme.bar.menus.menu.network.label.color" = accent.base; + "theme.bar.menus.menu.network.listitems.active" = accent.base; + "theme.bar.menus.menu.network.listitems.passive" = accent.base; + "theme.bar.menus.menu.network.scroller.color" = accent.base; + "theme.bar.menus.menu.network.status.color" = accent.base; + "theme.bar.menus.menu.network.switch.disabled" = accent.base; + "theme.bar.menus.menu.network.switch.enabled" = accent.base; + "theme.bar.menus.menu.network.switch.puck" = accent.base; + "theme.bar.menus.menu.network.text" = foreground; + + "theme.bar.menus.menu.notifications.background" = background; + "theme.bar.menus.menu.notifications.border" = accent.base; + "theme.bar.menus.menu.notifications.card" = accent.dark; + "theme.bar.menus.menu.notifications.clear" = accent.base; + "theme.bar.menus.menu.notifications.label" = accent.base; + "theme.bar.menus.menu.notifications.no_notifications_label" = accent.base; + "theme.bar.menus.menu.notifications.pager.background" = background; + "theme.bar.menus.menu.notifications.pager.button" = accent.dark; + "theme.bar.menus.menu.notifications.pager.label" = accent.base; + "theme.bar.menus.menu.notifications.scrollbar.color" = accent.base; + "theme.bar.menus.menu.notifications.switch.disabled" = accent.base; + "theme.bar.menus.menu.notifications.switch_divider" = accent.base; + "theme.bar.menus.menu.notifications.switch.enabled" = accent.base; + "theme.bar.menus.menu.notifications.switch.puck" = accent.base; + + + "theme.bar.menus.menu.power.background.color" = background; + "theme.bar.menus.menu.power.border.color" = accent.base; + + "theme.bar.menus.menu.power.buttons.logout.background" = background; + "theme.bar.menus.menu.power.buttons.logout.icon_background" = background; + "theme.bar.menus.menu.power.buttons.logout.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.logout.text" = foreground; + + "theme.bar.menus.menu.power.buttons.restart.background" = background; + "theme.bar.menus.menu.power.buttons.restart.icon_background" = background; + "theme.bar.menus.menu.power.buttons.restart.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.restart.text" = foreground; + + "theme.bar.menus.menu.power.buttons.shutdown.background" = background; + "theme.bar.menus.menu.power.buttons.shutdown.icon_background" = background; + "theme.bar.menus.menu.power.buttons.shutdown.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.shutdown.text" = foreground; + + "theme.bar.menus.menu.power.buttons.sleep.background" = background; + "theme.bar.menus.menu.power.buttons.sleep.icon_background" = background; + "theme.bar.menus.menu.power.buttons.sleep.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.sleep.text" = foreground; + + + "theme.bar.menus.menu.systray.dropdownmenu.background" = background; + "theme.bar.menus.menu.systray.dropdownmenu.divider" = accent.base; + "theme.bar.menus.menu.systray.dropdownmenu.text" = foreground; + + "theme.bar.menus.menu.volume.audio_slider.background" = background; + "theme.bar.menus.menu.volume.audio_slider.backgroundhover" = background; + "theme.bar.menus.menu.volume.audio_slider.primary" = accent.base; + "theme.bar.menus.menu.volume.audio_slider.puck" = accent.base; + "theme.bar.menus.menu.volume.background.color" = background; + "theme.bar.menus.menu.volume.border.color" = accent.base; + "theme.bar.menus.menu.volume.card.color" = accent.dark; + "theme.bar.menus.menu.volume.iconbutton.active" = accent.base; + "theme.bar.menus.menu.volume.iconbutton.passive" = accent.base; + "theme.bar.menus.menu.volume.input_slider.background" = background; + "theme.bar.menus.menu.volume.input_slider.backgroundhover" = background; + "theme.bar.menus.menu.volume.input_slider.primary" = accent.base; + "theme.bar.menus.menu.volume.input_slider.puck" = accent.base; + "theme.bar.menus.menu.volume.label.color" = accent.base; + "theme.bar.menus.menu.volume.listitems.active" = accent.base; + "theme.bar.menus.menu.volume.listitems.passive" = accent.base; + "theme.bar.menus.menu.volume.text" = foreground; + + "theme.bar.menus.monochrome" = false; + + "theme.bar.opacity" = t; + "theme.bar.outer_spacing" = "0em"; + "theme.bar.transparent" = false; + + "theme.font.name" = rice.font.code.name; + "theme.font.size" = "12px"; + + "theme.notification.actions.background" = background; + "theme.notification.actions.text" = foreground; + "theme.notification.background" = background; + "theme.notification.border" = accent.base; + "theme.notification.close_button.background" = accent.dark; + "theme.notification.close_button.label" = accent.base; + "theme.notification.label" = accent.base; + "theme.notification.labelicon" = accent.base; + "theme.notification.opacity" = 1.0; + "theme.notification.text" = foreground; + "theme.notification.time" = accent.base; + + "theme.osd.bar_color" = accent.base; + "theme.osd.bar_container" = accent.dark; + "theme.osd.bar_empty_color" = accent.dark; + "theme.osd.bar_overflow_color" = accent.base; + "theme.osd.border.color" = border; + "theme.osd.icon_container" = secondary.dark; + "theme.osd.icon" = secondary.bright; + "theme.osd.label" = accent.bright; + "theme.osd.opacity" = t; + }; + }; + }; +} diff --git a/home-modules/hyprland.nix b/home-modules/hyprland.nix index 2d3e3a8..d123118 100644 --- a/home-modules/hyprland.nix +++ b/home-modules/hyprland.nix @@ -217,7 +217,6 @@ in { "/usr/lib/polkit-kde-authentication-agent-1 " "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" "syncthing -no-browser" - "mako" "fcitx5" # "ibus engine xkb:de::deu" "libinput-gestures" @@ -283,6 +282,11 @@ in { layerrule = [ "blur,waybar" + "blur,bar-0" # hyprpanel + "blur,bar-1" + "blur,bar-2" + "blur,bar-3" + "blur,bar-4" "dimaround,rofi" "blur,rofi" "xray,rofi" @@ -303,13 +307,13 @@ in { "SUPER SHIFT, F1, movetoworkspace, 100" # "SUPER, F2," # "SUPER, F3, toggleopaque" - "SUPER, F4, exec, rm /tmp/caldav_event_cache.json && notify-send 'Cleared Saved Event!' ''" - "SUPER, F5, exec, nx_gcal_event force-lookup" - "SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate" + "SUPER, F4, exec, rm /tmp/caldav_event_cache.json && notify-send 'NxCaldavEvent' 'Cleared saved event cache!' ''" + # "SUPER, F5, exec, nx_gcal_event force-lookup" + # "SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate" "SUPER, F6, exec, ${terminal-exec}'htop'" "SUPER, F7, exec, ${terminal-exec}'nmtui'" ''SUPER, F8, exec, find ~/Pictures/wallpapers/* -type f -not -path "~/Pictures/wallpapers/.git/*" | sort -R | head -n 1 | xargs -d '\n' swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 --transition-duration 2'' - "SUPER, F9, execr, waybar_mode set '󰸉 '" + "SUPER, F9, execr, submap_indicator set '󰸉 '" "SUPER, F9, submap, color" # "SUPER, F10, hyprload,update" "SUPER, F11, exec, waybar" @@ -355,7 +359,7 @@ in { "ALT, TAB, focuscurrentorlast" # "SUPER, TAB, exec, hyprswitch --daemon" "SUPER, Q, killactive" - "SUPER, W, exec, waybar_mode set '󰈹 '" + "SUPER, W, exec, submap_indicator set '󰈹 '" "SUPER, W, submap, browserSM " "SUPER, E, exec, element-desktop" "SUPER, R, exec, rofi -show drun" @@ -378,7 +382,7 @@ in { ########################################################################### ## ROW 3: - "SUPER, A, execr, waybar_mode set ' 󰹑 '" + "SUPER, A, execr, submap_indicator set ' 󰹑 '" "SUPER, A, submap, scrL" "SUPER, S, exec, spotify" "SUPER, D, exec, vesktop" @@ -397,7 +401,7 @@ in { ## ROW 4: # "SUPER, <, overview:toggle" - "SUPER, Y, execr, waybar_mode set '󰹑 '" + "SUPER, Y, execr, submap_indicator set '󰹑 '" "SUPER, Y, submap, scrR" "SUPER, X, exec, pkill wlogout || wlogout --protocol layer-shell -b 3" # "SUPER, C, exec, /home/nx2/scripts/quickconfig/quickconfig.sh " @@ -416,7 +420,7 @@ in { # bindr = SUPER, Ctrl, exec, # ?? # bindr = SUPERALT, Alt_L, exec, - "SUPER, Space, cyclenext" + # "SUPER, Space, cyclenext" "SUPER SHIFT, Space, swapnext" # "SUPER, , " # "SUPER, , " @@ -436,7 +440,7 @@ in { ########################################################################### ## MEGA KEYS: - ", Print, execr, waybar_mode set '󰄀 '" + ", Print, execr, submap_indicator set '󰄀 '" ", Print, submap, screenshot" # "SUPER, Next, resizeactive, 5% 5%" # binde @@ -520,18 +524,18 @@ in { # '8888Y' 'Y8888P' Y8888P' YP YP 88 YP YP '8888Y' extraConfig = let action_simple = { mods ? "", key, cmd }: '' - bind=${mods},${key},execr,waybar_mode unset + bind=${mods},${key},execr,submap_indicator unset bind=${mods},${key},${cmd} bind=${mods},${key},submap,reset ''; extra_workspace = { key, wsnumber }: '' - bind=,${key},execr,waybar_mode unset + bind=,${key},execr,submap_indicator unset bind=,${key},workspace,${wsnumber} bind=,${key},submap,reset - bind=SUPER,${key},execr,waybar_mode unset + bind=SUPER,${key},execr,submap_indicator unset bind=SUPER,${key},workspace,${wsnumber} bind=SUPER,${key},submap,reset - bind=SUPER SHIFT,${key},execr, waybar_mode unset + bind=SUPER SHIFT,${key},execr, submap_indicator unset bind=SUPER SHIFT,${key},movetoworkspace,${wsnumber} bind=SUPER SHIFT,${key},submap,reset ''; @@ -554,35 +558,35 @@ in { ${action_simple { key = "Y"; cmd = "exec,firefox https://youtube.com";}} ${action_simple { key = "P"; cmd = "exec,firefox https://pw.nx2.site";}} ${action_simple { key = "P"; cmd = "exec,firefox https://pw.nx2.site";}} - bind=,Z,exec,waybar_mode set ' ' + bind=,Z,exec,submap_indicator set ' ' bind=,Z,submap,tuda bind=,Z,submap,reset - bind=,Escape,exec,waybar_mode unset + bind=,Escape,exec,submap_indicator unset bind=,Escape,submap,reset submap = reset submap = scrL ${builtins.concatStringsSep "\n" (builtins.map (num: extra_workspace { key = builtins.toString num; wsnumber = "2" + builtins.toString num;}) [1 2 3 4 5 6 7 8 9 0])} - bind = , A, execr, waybar_mode unset + bind = , A, execr, submap_indicator unset bind = , A, submap, reset - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset submap = scrR ${builtins.concatStringsSep "\n" (builtins.map (num: extra_workspace { key = builtins.toString num; wsnumber = "3" + builtins.toString num;}) [1 2 3 4 5 6 7 8 9 0])} - bind = , Y, execr, waybar_mode unset + bind = , Y, execr, submap_indicator unset bind = , Y, submap, reset - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset submap = color - ${action_simple { key = "W"; cmd = ''exec,swww query | sed -n 1p | sed -E 's-.*image: (.*)-"\1"-g' | xargs change_colors_json img && notify-send 'change_colors_json img successfull' ''; }} - ${action_simple { key = "M"; cmd = ''exec,change_colors_json manual && notify-send 'change_colors_json manual successfull' ''; }} + ${action_simple { key = "W"; cmd = ''exec,swww query | sed -n 1p | sed -E 's-.*image: (.*)-"\1"-g' | xargs change_colors_json img && notify-send 'NxTheme' 'change_colors_json img successfull' ''; }} + ${action_simple { key = "M"; cmd = ''exec,change_colors_json manual && notify-send 'NxTheme' 'change_colors_json manual successfull' ''; }} ${action_simple { key = "D"; cmd = ''exec,firefox ${hyper.home}/.config/color-pallete.html''; }} - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset @@ -590,7 +594,7 @@ in { ${action_simple { key = "T"; cmd = ''exec,firefox https://www.tucan.tu-darmstadt.de/''; }} ${action_simple { key = "M"; cmd = ''exec,firefox https://moodle.tu-darmstadt.de/''; }} ${action_simple { key = "I"; cmd = ''exec,firefox https://moodle.informatik.tu-darmstadt.de/''; }} - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset @@ -598,7 +602,7 @@ in { ${action_simple { key = "W"; cmd = ''exec,hyprshot -m window''; }} ${action_simple { key = "M"; cmd = ''exec,hyprshot -m output''; }} ${action_simple { key = "R"; cmd = ''exec,hyprshot -m region''; }} - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset diff --git a/home-modules/mako.nix b/home-modules/mako.nix index 8b6c35a..6ead07d 100644 --- a/home-modules/mako.nix +++ b/home-modules/mako.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }@all: with all; +{ config, pkgs, ... }@all: with all; { home.packages = with pkgs; [ libnotify ]; services.mako = with rice; { - enable = true; + enable = if config.programs.hyprpanel.enable then false else true; settings = { default-timeout = 5000; # in ms background-color = color.background; diff --git a/home-modules/waybar.nix b/home-modules/waybar.nix deleted file mode 100644 index 8c014df..0000000 --- a/home-modules/waybar.nix +++ /dev/null @@ -1,379 +0,0 @@ -{ pkgs, hyper, ... }@all: with all; let - sep = " "; -in { - sops.secrets = { - "nx2site/radicale/password" = { }; - }; - home.packages = [ - (pkgs.writeShellApplication { name = "waybar_mode"; text = /*bash*/ '' - print_help() { - echo "Usage: waybar_mode {set |unset}" - } - if [ $# -lt 1 ]; then - print_help; exit 1; - fi - case "$1" in - set) - # Check if there is a second argument for the 'set' operation - if [ $# -eq 2 ]; then - echo "$2" > /tmp/waybar-mode - pkill -RTMIN+8 waybar - else - echo "Error: 'set' operation requires exactly one string argument." - print_help - exit 1 - fi - ;; - unset) - echo "" > /tmp/waybar-mode - pkill -RTMIN+8 waybar - ;; - *) - echo "Error: Unknown command '$1'" - print_help - exit 1 - ;; - esac - exit 0 - '';}) - (pkgs.writeShellApplication { name = "cclock"; text = /*bash*/ '' - ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}') - if [ $# -eq 0 ]; then - echo "󰃮${sep}$(date +'%A the')" "$ord" "of" "$(date +'%B')" " ${sep}$(date +'%R')" - elif [ "$1" = "--no-icons" ]; then - echo "$(date +'%A the')" "$ord" "of" "$(date +'%B')" "$(date +'%R')" - fi - '';}) - (pkgs.writers.writePython3Bin "caldav_event" { - libraries = with pkgs.python3Packages; [ caldav ics pytz ]; - flakeIgnore = [ "E302" "E305" "E501" "E261" ]; - } /* python */ '' -import os -import json -from caldav import DAVClient -from datetime import datetime, timezone -from ics import Calendar -from pytz import UTC - -def get_password(password_file): - with open(password_file, "r") as file: - return file.read().strip() - -def datetime_converter(obj): - if isinstance(obj, datetime): - return obj.isoformat() - return obj - -def datetime_parser(dct): - for key, value in dct.items(): - if isinstance(value, str): - try: - dct[key] = datetime.fromisoformat(value) - except ValueError: - pass - return dct - -def load_cache(cache_file): - if os.path.exists(cache_file): - with open(cache_file, "r") as file: - return json.load(file, object_hook=datetime_parser) - return None - -def save_cache(cache_file, data): - with open(cache_file, "w") as file: - json.dump(data, file, default=datetime_converter, indent=4) - - -def get_ongoing_or_next_event(url, username, password): - now = datetime.now(timezone.utc) - - try: - client = DAVClient(url, username=username, password=password) - principal = client.principal() - calendars = principal.calendars() - - next_event_dict = { - 'event_name': "fake", - 'event_begin': datetime(9000, 1, 1, tzinfo=UTC), # in the year 9000 - 'event_end': datetime(9000, 1, 1, 8, tzinfo=UTC), - } - - for calendar in calendars: - for event in calendar.search(start=now): - calendar_parsed = Calendar(event.data) - for ics_event in calendar_parsed.events: - event_dict = {} - event_dict['event_name'] = ics_event.name or "(No Title)" - event_dict['event_begin'] = ics_event.begin.astimezone(timezone.utc) - event_dict['event_end'] = ics_event.end.astimezone(timezone.utc) - - if event_dict['event_begin'] <= now and now <= event_dict['event_end']: - return event_dict - elif event_dict['event_begin'] >= now and next_event_dict['event_begin'] > event_dict['event_begin']: - next_event_dict = event_dict - return next_event_dict - - except Exception as e: - print(f"Error accessing {url}: {e}") - return None - -def is_expired(event_dict: dict): - now = datetime.now(timezone.utc).timestamp() - event_start = event_dict['event_begin'].timestamp() - event_end = event_dict['event_end'].timestamp() - return not (event_start <= now <= event_end) - -if __name__ == "__main__": - password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file - cache_file = "/tmp/caldav_event_cache.json" # Path to cache file - url = "https://dav.${hyper.domain}/" - username = "nx2" - password = get_password(password_file) - now = datetime.now(timezone.utc).timestamp() - - event_dict = load_cache(cache_file) - - if (event_dict is None) or (is_expired(event_dict)): - event_dict = get_ongoing_or_next_event(url, username, password) - save_cache(cache_file, event_dict) - - if event_dict is None: # none were found - print("* zen *") - exit(0) - - event_start = event_dict['event_begin'].timestamp() - event_end = event_dict['event_end'].timestamp() - - if event_start <= now <= event_end: # is currently ongoing - action_string = "ends" - t = event_end - now # time_remaining - else: # is in the future - action_string = "starts" - t = event_start - now # time_remaining - - hours, rem = divmod(int(t), 3600) - minutes, _ = divmod(rem, 60) - hour_string = f"{hours} hour{'s ' if hours != 1 else ' '}" if hours > 0 else "" - minu_string = f"{minutes} minute{'s ' if minutes != 1 else ' '}" if minutes > 0 else "" - if hour_string == "" and minu_string == "": - time_string = "now" - elif hour_string == "" or minu_string == "": - time_string = "in " + hour_string + minu_string - else: - time_string = "in " + hour_string + "and " + minu_string - - print(f"{event_dict['event_name']} {action_string} {time_string}") -'') - ]; - - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = { - bar = { - # height = 20; - layer = "top"; - position = "bottom"; - margin-top = 0; - # margin-left = rice.gap-size; - # margin-bottom = rice.gap-size; - # margin-right = rice.gap-size; - margin-left = 0; - margin-bottom = 0; - margin-right = 0; - spacing = 10; - fixed-center = true; - modules-left = [ - # "cpu" - # "memory" - "wireplumber" - "backlight" - "battery" - "network" - "hyprland/window" - ]; - modules-center = [ - "hyprland/workspaces" - ]; - modules-right = [ - "custom/mode" - "custom/caldav_event" - "custom/cclock" - "tray" - ]; - "hyprland/workspaces" = { - on-click = "activate"; - format = "{name}"; - all-outputs = false; - active-only = false; - }; - "hyprland/window" = { - # format = "${sep}{}"; - format = "{}"; - separate-outputs = true; - }; - "custom/cclock" = { - exec = "cclock"; - restart-interval = 60; - }; - "custom/caldav_event" = { - format = "󰃰${sep}{}"; - exec = "caldav_event"; - restart-interval = 60; - max-width = 60; - }; - "custom/mode" = { - exec = "cat /tmp/waybar-mode"; - interval = "once"; - signal = 8; - }; - - cpu = { - interval = 1; - format = "󰍛${sep}{}%"; - max-length = 10; - }; - memory = { - interval = 5; - format = "${sep}{avail:.0f}G free"; - }; - battery = { - interval = 60; - tooltip = false; - format = "{icon}${sep}{capacity}%"; - states = { - warning = 15; - critical = 5; - }; - format-icons = [ - " " - " " - " " - " " - " " - ]; - format-charging = "{icon}${sep}+{capacity}%"; - format-plugged = "{icon}${sep}P{capacity}%"; - format-full = "{icon}${sep}F{capacity}%"; - }; - backlight = { - device = "eDP-1"; - format = "{icon}${sep}{percent}%"; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - "" - ]; - }; - network = { - format-wifi = "${sep}{essid}"; - format-ethernet = "󰈀${sep}Wired"; - format-disconnected = "󰌙${sep}Disconnected"; - }; - wireplumber = { - format = "󰕾${sep}{volume}%"; - format-muted = "󰝟${sep}--%"; - }; - }; - }; - style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in '' - * { - font-family: ${rice.font.code.name}; - font-size: 1em; - min-height: 0px; - margin: 0px; - padding: 0px; - } - - window#waybar { - background-color: rgba(${f background},${builtins.toString rice.transparency}); - transition-duration: 5s; - transition-property: background-color; - /* border: ${builtins.toString rice.border-width}px solid rgb(${f border}); */ - /* margin: ${builtins.toString rice.gap-size}px; */ - /* border-radius: ${builtins.toString rice.rounding}px; */ - } - - #clock, - #custom-cclock, - #custom-mode, - #custom-caldav-event, - #battery, - #cpu, - #tray, - #disk, - #backlight, - #network, - #wireplumber, - #memory, - #window, - #workspaces { - padding: 0px 3px; - margin-top: 0.3em; - border-radius: ${builtins.toString rice.rounding}px; - color: rgb(${f accent.bright}); - } - - #workspaces { - font-family: ${rice.font.code.name}; - } - - #workspaces button { - color: rgb(${f accent.base}); - padding-left: 15px; - padding-right: 15px; - border-radius: ${builtins.toString rice.rounding}px; - } - - #workspaces button.active { - color: rgb(${f background}); - background-color: rgb(${f accent.base}); - } - - #workspaces button:hover { - color: rgb(${f tertiary.bright}); - } - - #workspaces button.urgent { - background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); - } - - #custom-mode { - color: rgb(${f red.base}); - } - - #window, #custom-caldav_event { - font-family: ${rice.font.base.name}, ${rice.font.code.name}; - color: rgb(${f tertiary.bright}); - } - - #wireplumber.muted { - color: rgb(${f tertiary.bright}); - } - #wireplumber { - padding-left: 10px; - } - - #battery.warning:not(.charging) { - color: rgb(${f green.base});; - } - - #battery.charging { - color: rgb(${f green.base}); - } - - #battery.critical { - background: rgb(${f negative.base}); - color: rgb(${f foreground}); - } - ''; - - #battery.critical:not(.charging) { - }; -} diff --git a/home.nix b/home.nix index f602ee6..708878c 100644 --- a/home.nix +++ b/home.nix @@ -1,6 +1,7 @@ { pkgs, ... }@all: with all; { imports = [ ./home-modules/auto-mount.nix + ./home-modules/bar.nix ./home-modules/bash.nix ./home-modules/bitwarden.nix ./home-modules/calendar.nix @@ -59,7 +60,6 @@ ./home-modules/virt-manager.nix ./home-modules/vscode.nix ./home-modules/wallpaper-to-colors.nix - ./home-modules/waybar.nix ./home-modules/wlogout.nix ./home-modules/xdg.nix ./home-modules/yazi.nix diff --git a/sops-secrets.yaml b/sops-secrets.yaml index ea7232d..c170d09 100644 --- a/sops-secrets.yaml +++ b/sops-secrets.yaml @@ -20,7 +20,7 @@ syncthing: weechat: passphrase: ENC[AES256_GCM,data:3NVhMouf3wwMJTZCvIjbi5fjHJHxe25Q+wRo,iv:W8cShdM3iUyEiRCPNupMin3gfF+cqGxslD18CAvUW4c=,tag:DXBATGEhHjhXqy+J9BNVwg==,type:str] streamlink: - twitch-oauth: ENC[AES256_GCM,data:SvV0CBVL6MO0zqiRg2Ns00KNHLDfzgNObse5F69n,iv:h0DFbwIVKfJSoVowgO3voAOdHXIsw1D3O/aweFRVKcI=,tag:PW0gc+gzlfdOUvIoYIkywg==,type:str] + twitch-oauth: ENC[AES256_GCM,data:9ZPbqG+YwxGYcSwdXkcXLFxun2aTorz4OkNf8LSB,iv:Nm3+9Lah/DbV3wsMghDSmM5ewfLzbrZwlZixoNgPBHg=,tag:FMsoXNPjIGW8bxL5vyr39g==,type:str] nx2site: cloudflare: api-token-dns-edit: ENC[AES256_GCM,data:fR4fH6NqwtHI8aebEwjUn5JMoy3q3GXgu/dREe8JK7yRBIOhJ8BKuw==,iv:fQqLRYCN/7zhpHzYxMcn8q1aA7x4qd3qWGgrFWn2E/U=,tag:GJ1muJG755ch/84Sgcf2Vw==,type:str] @@ -86,8 +86,8 @@ sops: YkJWUEMySU50ZHVxUzVudjNnYURXak0KkMn/8sFrrviqb3s8DtS/BAbrdCwJ+jv/ A8rXQkKMjvTqG1f0fq5IlSmRAQy7XFBzkfbKdIUoefhey190WPEHaw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-06-16T08:57:57Z" - mac: ENC[AES256_GCM,data:Qwk39Cv+WhxnW8858qWtGPiCrYb4bje5nRGOkG4OrAC/dZ+wpbMd9DXF134PUM1NB/aI3ivnl4EeVAlcv/E32EjodZJOGkseKme5Hler69+nfL0DJT00XhBDR3aGVf3YMA5Po+XR9ikLKFF1wz4DhV4ylN6RxxMrpLJltba+0NI=,iv:QUulKPfnAujRUNWKBKUsIynOHsd4E09NO8TlaQwzFy0=,tag:N1LNlbvdjkXWarIAI9tkZg==,type:str] + lastmodified: "2025-07-30T16:13:52Z" + mac: ENC[AES256_GCM,data:ceUJtV0XgnP9U8Qf6mtw8Je4kXQjlCQs4KfBtlYZ0MEieDpsLPP0muQr4A4crx5CLJfIveKMRvqlJn3zCOTtyJndyxfW8T/574ithOXVmSFcMORvT79N+trRrhatgPcuD4vL4R/cSOTuSRFYFDkrO+XAr8n5dYdTErGH3UKtQLw=,iv:W5t3ZnsFelJHaJ7G7AMO4/aMmJfJZkqgHoxmj69+rUM=,tag:o9V3jScpextZ5HcpPISckw==,type:str] pgp: - created_at: "2025-06-08T12:35:30Z" enc: |- diff --git a/system-modules/hardware-configuration.nix b/system-modules/hardware-configuration.nix index 57a9a4a..3772a32 100644 --- a/system-modules/hardware-configuration.nix +++ b/system-modules/hardware-configuration.nix @@ -49,4 +49,6 @@ libvdpau-va-gl intel-media-driver ] else []; + + services.upower.enable = true; } diff --git a/system-modules/health_reminder.nix b/system-modules/health_reminder.nix index 68772f4..a91228f 100644 --- a/system-modules/health_reminder.nix +++ b/system-modules/health_reminder.nix @@ -5,8 +5,8 @@ lib.mkIf (hyper.host != "NxACE") enable = true; wantedBy = [ "timers.target" ]; timerConfig = { - OnBootSec = "5m"; - OnUnitActiveSec = "5m"; + OnBootSec = "30m"; + OnUnitActiveSec = "10m"; Unit = "health_reminder.service"; }; }; @@ -34,11 +34,11 @@ lib.mkIf (hyper.host != "NxACE") return action actions = [ - Action(action="look away for %o Seconds!", likelihood=300, options=["10", "15"]), - Action(action="Posture Check!", likelihood=300), + Action(action="look away for %o Seconds!", likelihood=30, options=["10", "15"]), + Action(action="Posture Check!", likelihood=200), Action(action="Strech your upper body!", likelihood=20), Action(action="Strech your core!", likelihood=10), - Action(action="Strech your legs!", likelihood=10), + Action(action="Strech your legs!", likelihood=20), Action(action="Strech your arms/hands!", likelihood=10), Action(action="Make Tea!", likelihood=5), Action(action="说现在中文的时间!", likelihood=2), From 871a270a2133225c052a92fdcce1e6790d516743 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:50:35 +0200 Subject: [PATCH 04/15] copyparty --- configuration.nix | 1 + flake.nix | 56 ++++++++++++++-------------- sops-secrets.yaml | 7 +++- system-modules/nx2site/copyparty.nix | 44 ++++++++++++++++++++++ system-modules/nx2site/proxy.nix | 43 ++++++++++++++++++++- 5 files changed, 120 insertions(+), 31 deletions(-) create mode 100644 system-modules/nx2site/copyparty.nix diff --git a/configuration.nix b/configuration.nix index 28e0e2f..427350e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -49,6 +49,7 @@ ./system-modules/postgres.nix ./system-modules/nx2site/proxy.nix ./system-modules/nx2site/audiobookshelf.nix + ./system-modules/nx2site/copyparty.nix ./system-modules/nx2site/gitea.nix ./system-modules/nx2site/open-web-calendar.nix ./system-modules/nx2site/radicale.nix diff --git a/flake.nix b/flake.nix index 37f839b..e539f4d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,28 +2,30 @@ description = "Multisystem NixOS Flake of Lennart J. Kurzweg"; inputs = { - nixpkgs = { url = "nixpkgs/nixos-25.05"; }; - nixpkgs-unstable = { url = "nixpkgs/nixos-unstable"; }; - nixpkgs-latest = { url = "github:nixos/nixpkgs?ref=master"; }; + nixpkgs = { url = "nixpkgs/nixos-25.05"; }; + nixpkgs-unstable = { url = "nixpkgs/nixos-unstable"; }; + nixpkgs-latest = { url = "github:nixos/nixpkgs?ref=master"; }; - home-manager = { url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + home-manager = { url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - nixos-wsl = { url = "github:nix-community/NixOS-WSL/main"; }; + nixos-wsl = { url = "github:nix-community/NixOS-WSL/main"; }; - sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - lanzaboote = { url = "github:nix-community/lanzaboote/v0.4.2"; }; + sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + lanzaboote = { url = "github:nix-community/lanzaboote/v0.4.2"; }; - hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; }; - hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; - hyprspace = { url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; }; + hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; }; + hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; + hyprspace = { url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; }; - yazi = { url = "github:sxyazi/yazi"; }; + yazi = { url = "github:sxyazi/yazi"; }; + copyparty = { url = "github:9001/copyparty"; }; }; outputs = { ... }@inputs: with inputs; let system = "x86_64-linux"; - config = { allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; }; + simple-pkgs = import nixpkgs { inherit system; }; + config = { allowUnfreePredicate = pkg: builtins.elem (simple-pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; }; hyper-base = rec { inherit system; @@ -34,31 +36,31 @@ pkgs-version = "25.05"; }; - pkgs = import nixpkgs { + my-pkgs = host: import nixpkgs { inherit system config; - overlays = [ - (final: prev: { - unstable = import nixpkgs-unstable { inherit system config; }; - latest = import nixpkgs-latest { inherit system config; }; - version = "25.05"; - }) - ]; + overlays = [(final: prev: { + unstable = import nixpkgs-unstable { inherit system config; }; + latest = import nixpkgs-latest { inherit system config; }; + version = "25.05"; + })] ++ (if host == "NxACE" then [ + copyparty.overlays.default + ] else []); }; nvidia-base = import ./flake-modules/nvidia.nix; secrets = import ./git-crypt/secrets.nix; - rice = import ./flake-modules/rice.nix pkgs; + rice = import ./flake-modules/rice.nix simple-pkgs; in { nixosConfigurations = let make-nixos-system = host: nvidia-settings: nixpkgs.lib.nixosSystem { - inherit pkgs; + pkgs = my-pkgs host; modules = [ ./configuration.nix ]; specialArgs = let hyper = hyper-base // { inherit host; nvidia = (nvidia-base // nvidia-settings); }; in { inherit inputs hyper rice secrets; }; }; make-nixos-wsl-system = host: nixpkgs.lib.nixosSystem { - inherit pkgs; + pkgs = my-pkgs host; modules = [ ./nixos-wsl.nix ]; specialArgs = let hyper = hyper-base // { inherit host; }; @@ -73,18 +75,18 @@ homeConfigurations = let make-home-configuration = host: user: nvidia-settings: home-manager.lib.homeManagerConfiguration { - inherit pkgs; + pkgs = my-pkgs host; modules = [ ./home.nix ]; extraSpecialArgs = let hyper = hyper-base // { inherit host; nvidia = nvidia-base // nvidia-settings; }; - in { inherit pkgs inputs hyper rice secrets; }; + in { inherit inputs hyper rice secrets; }; }; make-shell-configuration = host: user: home-manager.lib.homeManagerConfiguration { - inherit pkgs; + pkgs = my-pkgs host; modules = [ ./shell-only.nix ]; extraSpecialArgs = let hyper = hyper-base // { inherit host; }; - in { inherit pkgs inputs hyper rice secrets; }; + in { inherit inputs hyper rice secrets; }; }; in { "${hyper-base.user}@NxXPS" = make-home-configuration "NxXPS" hyper-base.user { enable = true; prime = true; }; diff --git a/sops-secrets.yaml b/sops-secrets.yaml index ea7232d..da36693 100644 --- a/sops-secrets.yaml +++ b/sops-secrets.yaml @@ -37,6 +37,9 @@ nx2site: nextcloud: admin-pass: ENC[AES256_GCM,data:u6k70HwxBKAom8kvUihNjwbYsOikOt4sG1U=,iv:K0XPh1NfaGhFJ0ZVOWqnihZee6uuWxr0Vu8aR0ykr30=,tag:YyxgoVUxk4YxFnDmXkBXpw==,type:str] db-pass: ENC[AES256_GCM,data:HHY1XolLvLngYQHkfFEYTEmcIR7BSpwQ,iv:hFeuULgGVq+QxzIO0dcBaSlTFP1E7B6tv7BM0EUcTQA=,tag:ZsZyKMSeRLCEB3mZUiBa6w==,type:str] + copyparty: + user-password: + nx2: ENC[AES256_GCM,data:55yxXcN1eKvfpjWySw54r2dM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dLijTcxAxLhTIPav2WC1mwyve+Jd0djTajSBgSzPzHW5ajUBaol+dVJeCD9HqiOrUMEmcMQFZZcA+RCJdIOvkKlt/sAnhQ4RuwPmzck2RMXCQfiYn0pqpJDXmF7xWgvGDBtQKP7xLE1Hj5No2q85KjLsWu8xK99Y+j2ixfBsgdc53CR4rNplnPsFzBHOucqd+Ve0/gqZgF81RbGFV1T9Wn1XFrE0e7+EkNejKj7deRmy31PnVLcBp2NwtIkhrJ06J8hmGquwUm,iv:NJkjWL5kMHET68oR5Xp22kvkThXIp7WxRVajmTfsB5M=,tag:NSXeRItMKlOQYP4QtzMKIg==,type:str] @@ -86,8 +89,8 @@ sops: YkJWUEMySU50ZHVxUzVudjNnYURXak0KkMn/8sFrrviqb3s8DtS/BAbrdCwJ+jv/ A8rXQkKMjvTqG1f0fq5IlSmRAQy7XFBzkfbKdIUoefhey190WPEHaw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-06-16T08:57:57Z" - mac: ENC[AES256_GCM,data:Qwk39Cv+WhxnW8858qWtGPiCrYb4bje5nRGOkG4OrAC/dZ+wpbMd9DXF134PUM1NB/aI3ivnl4EeVAlcv/E32EjodZJOGkseKme5Hler69+nfL0DJT00XhBDR3aGVf3YMA5Po+XR9ikLKFF1wz4DhV4ylN6RxxMrpLJltba+0NI=,iv:QUulKPfnAujRUNWKBKUsIynOHsd4E09NO8TlaQwzFy0=,tag:N1LNlbvdjkXWarIAI9tkZg==,type:str] + lastmodified: "2025-08-06T22:09:56Z" + mac: ENC[AES256_GCM,data:s3lBIa/Y0fjtFFTDggC+Oxd9T5A1al9ULh4VM78vS+A6nmCZWdezLkY1CwXPrCcrwYQtnKrj5N4Y1jQQmEkF1UIcgkvH7ZQsT7MOJyvWhZUx2/wIg1DwcdlHYJAiwFkIkZ1fEvE4m/uDCWA8xO4qWU4NJaxPzTyapPKKF4VwkNs=,iv:tqDVOQlwS+CMzX8MxrBRPjBVj1Svx91eQx2xamAsSiE=,tag:VJf1at+026fQJ5ML2D/PEg==,type:str] pgp: - created_at: "2025-06-08T12:35:30Z" enc: |- diff --git a/system-modules/nx2site/copyparty.nix b/system-modules/nx2site/copyparty.nix new file mode 100644 index 0000000..93d97ca --- /dev/null +++ b/system-modules/nx2site/copyparty.nix @@ -0,0 +1,44 @@ +{ config, pkgs, ... }@all: with all; { + imports = [ inputs.copyparty.nixosModules.default ]; + config = { + sops.secrets."nx2site/copyparty/user-password/${hyper.user}".owner = "copyparty"; + environment.systemPackages = with pkgs; [ copyparty ]; + services.copyparty = { + enable = true; + package = pkgs.copyparty; + openFilesLimit = 8192; + settings = { + i = [ "0.0.0.0" "unix:770:copyparty:/dev/shm/party.sock" ]; + p = [ 3210 3211 ]; + no-reload = true; + ignored-flag = false; + shr = "/shares"; + css-browser = "https://nx2.site/copyparty/extra-browser.css"; + theme = 6; + xff-hdr = "X-Forwarded-For"; # so that cpp knows the real client ip behind nginx. Must match with nginx config + rproxy = 1; + no-robots = true; + }; + accounts = { + "${hyper.user}" = { + passwordFile = config.sops.secrets."nx2site/copyparty/user-password/${hyper.user}".path; + }; + }; + volumes = { + "/" = { + path = "/srv/copyparty/root"; + access = { + "A" = "${hyper.user}"; + }; + flags = { + fk = 4; # url password length + scan = 60; # scan interval in seconds + e2d = true; # volflag "e2d" enables the uploads database + d2t = true; # "d2t" disables multimedia parsers (in case the uploads are malicious) + nohash = "\.iso$"; # skips hashing file contents if path matches *.iso + }; + }; + }; + }; + }; +} diff --git a/system-modules/nx2site/proxy.nix b/system-modules/nx2site/proxy.nix index 0b636b9..a8ab99a 100644 --- a/system-modules/nx2site/proxy.nix +++ b/system-modules/nx2site/proxy.nix @@ -19,7 +19,7 @@ }; }; users.users."nginx" = { - extraGroups = [ "nginx" "acme" ]; + extraGroups = [ "nginx" "acme" "copyparty" ]; useDefaultShell = false; linger = true; home = "/var/nginx/"; @@ -65,6 +65,14 @@ statusPage = false; streamConfig = ""; # udp config validateConfigFile = true; + upstreams = { + "partysock" = { + servers."unix:/dev/shm/party.sock".fail_timeout = "1s"; + extraConfig = /* nginx */ '' + keepalive 1; + ''; + }; + }; virtualHosts = let vh = { kTLS = true; @@ -186,10 +194,41 @@ # proxyWebsockets = true; # }; }; # }; + "file.${hyper.domain}" = { # copyparty + listen = dl; + forceSSL = true; + enableACME = true; + locations = { + "/" = { + proxyPass = "http://partysock"; + proxyWebsockets = true; + extraConfig = /* nginx */ '' + proxy_redirect off; + # disable buffering (next 4 lines) + # proxy_http_version 1.1; # this is set by nixos + client_max_body_size 0; + proxy_buffering off; + proxy_request_buffering off; + # improve download speed from 600 to 1500 MiB/s + proxy_buffers 32 8k; + proxy_buffer_size 16k; + proxy_busy_buffers_size 24k; + + proxy_set_header Connection "Keep-Alive"; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # NOTE: with cloudflare you want this X-Forwarded-For instead: + #proxy_set_header X-Forwarded-For $http_cf_connecting_ip; + ''; + }; + }; + }; "~^(.*).${hyper.domain}$" = { listen = dl; root = "/var/nginx/webroot"; - locations = { "~.*" = { return = "301 https://${hyper.domain}/502.html"; }; }; + locations."~.*".return = "502"; }; }; }; From 5d3491ececaf82e7efa5a5ba5b10beca4570bb21 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:51:39 +0200 Subject: [PATCH 05/15] attemts to fix missing fonts on NxACE --- home-modules/gpg.nix | 31 +++++++++--------------------- home-modules/pkgs-list/desktop.nix | 1 + home.nix | 1 - 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/home-modules/gpg.nix b/home-modules/gpg.nix index 36aed64..a47f72d 100644 --- a/home-modules/gpg.nix +++ b/home-modules/gpg.nix @@ -19,48 +19,35 @@ enableFishIntegration = true; defaultCacheTtlSsh = min2sec 60; defaultCacheTtl = min2sec 30; - # pinentryPackage = pkgs.pinentry-curses; + pinentry = { + package = pkgs.pinentry; + program = "pinentry"; + }; + extraConfig = '' + allow-loopback-pinentry + ''; }; home.file.".gnupg/gpg.conf".text = '' - # Use AES256, 192, or 128 as cipher personal-cipher-preferences AES256 AES192 AES - # Use SHA512, 384, or 256 as digest personal-digest-preferences SHA512 SHA384 SHA256 - # Use ZLIB, BZIP2, ZIP, or no compression personal-compress-preferences ZLIB BZIP2 ZIP Uncompressed - # Default preferences for new keys default-preference-list SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed - # SHA512 as digest to sign keys cert-digest-algo SHA512 - # SHA512 as digest for symmetric ops s2k-digest-algo SHA512 - # AES256 as cipher for symmetric ops s2k-cipher-algo AES256 - # UTF-8 support for compatibility charset utf-8 - # No comments in messages no-comments - # No version in output no-emit-version - # Disable banner no-greeting - # Long key id format keyid-format 0xlong - # Display UID validity list-options show-uid-validity verify-options show-uid-validity - # Display all keys and their fingerprints with-fingerprint - # Display key origins and updates - #with-key-origin - # Cross-certify subkeys are present and valid require-cross-certification - # Disable caching of passphrase for symmetrical ops no-symkey-cache - # Output ASCII instead of binary armor - # Enable smartcard - # use-agent + use-agent + pinentry-mode loopback ''; } diff --git a/home-modules/pkgs-list/desktop.nix b/home-modules/pkgs-list/desktop.nix index fcb4830..d718c52 100644 --- a/home-modules/pkgs-list/desktop.nix +++ b/home-modules/pkgs-list/desktop.nix @@ -3,6 +3,7 @@ brightnessctl blueman fontpreview + gtk3 gsettings-desktop-schemas imv pavucontrol diff --git a/home.nix b/home.nix index 4bd499d..aabcd9c 100644 --- a/home.nix +++ b/home.nix @@ -38,7 +38,6 @@ ./home-modules/pkgs-list/desktop.nix ./home-modules/pkgs-list/programs.nix ./home-modules/pkgs-list/shell.nix - ./home-modules/pkgs-list/fonts.nix ./home-modules/pnx.nix ./home-modules/programming/c.nix ./home-modules/programming/gleam.nix From edb394c95c16c08e4fc642a875cd860adba1a535 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:51:48 +0200 Subject: [PATCH 06/15] NxACE with OBS --- home-modules/obs.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/home-modules/obs.nix b/home-modules/obs.nix index 5c5861a..e129c3f 100644 --- a/home-modules/obs.nix +++ b/home-modules/obs.nix @@ -1,5 +1,4 @@ { pkgs, ... }@all: with all; -lib.mkIf (hyper.host != "NxACE") { # home.packages = with pkgs; [ # obs-studio From bfc57081b86685bd199b1a682d56a09bc0368f5a Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:51:56 +0200 Subject: [PATCH 07/15] fix helix typo --- home-modules/helix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-modules/helix.nix b/home-modules/helix.nix index 6c97687..7fe001a 100644 --- a/home-modules/helix.nix +++ b/home-modules/helix.nix @@ -181,7 +181,7 @@ }; smart-tab = { enable = false; - supersend-menu = false; + supersede-menu = false; }; inline-diagnostics = { cursor-line = "hint"; From 8be6a841d0faa6a63df93a478a59c3937483edf9 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:52:12 +0200 Subject: [PATCH 08/15] fix fix_campuszeit --- home-modules/calendar-campuszeit-fix.nix | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/home-modules/calendar-campuszeit-fix.nix b/home-modules/calendar-campuszeit-fix.nix index fd7cd55..cd9da30 100644 --- a/home-modules/calendar-campuszeit-fix.nix +++ b/home-modules/calendar-campuszeit-fix.nix @@ -20,22 +20,21 @@ def replace_campus_timezone(directory): 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'):] + 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"') + # Replace all TZID references + content = content.replace('TZID:CampusNetZeit', 'TZID:Europe/Berlin') + content = content.replace('TZID=CampusNetZeit', 'TZID=Europe/Berlin') + content = content.replace('TZID:"CampusNetZeit"', 'TZID:"Europe/Berlin"') + content = content.replace('TZID="CampusNetZeit"', 'TZID="Europe/Berlin"') - with open(filepath, 'w', encoding='utf-8') as f: - f.write(content) + with open(filepath, 'w', encoding='utf-8') as f: + f.write(content) - print(f"Updated time zone in: {filename}") + print(f"Updated time zone in: {filename}") if __name__ == "__main__": if len(sys.argv) != 2: From 87ec047d20c394d1ba06faaab2a7e8dbb24898bb Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:52:24 +0200 Subject: [PATCH 09/15] LR or TBD --- system-modules/calendar/lr.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system-modules/calendar/lr.nix b/system-modules/calendar/lr.nix index f81f5ab..1644817 100644 --- a/system-modules/calendar/lr.nix +++ b/system-modules/calendar/lr.nix @@ -23,7 +23,8 @@ from ics import Calendar import requests def filter_events(events): - return [event for event in events if ("LR" in event.name) or ("TBD" in event.name)] + return [event for event in events if ("LR" in event.name)] + # return [event for event in events if ("LR" in event.name) or ("TBD" in event.name)] def fetch_and_save_ical_events(ical_urls, save_path): """ From 8982916aeec9501a112e4715d5081a585161ded6 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:52:47 +0200 Subject: [PATCH 10/15] flake bump --- flake.lock | 224 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 137 insertions(+), 87 deletions(-) diff --git a/flake.lock b/flake.lock index afde90a..0ca57bb 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1750372185, - "narHash": "sha256-lVBKxd9dsZOH1fA6kSE5WNnt8e+09fN+NL/Q3BjTWHY=", + "lastModified": 1753216019, + "narHash": "sha256-zik7WISrR1ks2l6T1MZqZHb/OqroHdJnSnAehkE0kCk=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "7cef49d261cbbe537e8cb662485e76d29ac4cbca", + "rev": "be166e11d86ba4186db93e10c54a141058bdce49", "type": "github" }, "original": { @@ -33,6 +33,25 @@ "type": "github" } }, + "copyparty": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1755732626, + "narHash": "sha256-qLAElW0E2QmcrKAbLPjFdueAOpjp3HmlxaOQf4R4jas=", + "owner": "9001", + "repo": "copyparty", + "rev": "cd8771fa522d1cf645c3c7e0193f07b53d81559c", + "type": "github" + }, + "original": { + "owner": "9001", + "repo": "copyparty", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1731098351, @@ -51,11 +70,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -118,6 +137,21 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems_3" }, @@ -186,11 +220,11 @@ ] }, "locked": { - "lastModified": 1749154018, - "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", + "lastModified": 1755776884, + "narHash": "sha256-CPM7zm6csUx7vSfKvzMDIjepEJv1u/usmaT7zydzbuI=", "owner": "nix-community", "repo": "home-manager", - "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", + "rev": "4fb695d10890e9fc6a19deadf85ff79ffb78da86", "type": "github" }, "original": { @@ -216,11 +250,11 @@ ] }, "locked": { - "lastModified": 1749155331, - "narHash": "sha256-XR9fsI0zwLiFWfqi/pdS/VD+YNorKb3XIykgTg4l1nA=", + "lastModified": 1753964049, + "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "45fcc10b4c282746d93ec406a740c43b48b4ef80", + "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", "type": "github" }, "original": { @@ -245,11 +279,11 @@ ] }, "locked": { - "lastModified": 1750371717, - "narHash": "sha256-cNP+bVq8m5x2Rl6MTjwfQLCdwbVmKvTH7yqVc1SpiJM=", + "lastModified": 1754305013, + "narHash": "sha256-u+M2f0Xf1lVHzIPQ7DsNCDkM1NYxykOSsRr4t3TbSM4=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "15c6f8f3a567fec9a0f732cd310a7ff456deef88", + "rev": "4c1d63a0f22135db123fc789f174b89544c6ec2d", "type": "github" }, "original": { @@ -268,17 +302,17 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems", "xdph": "xdph" }, "locked": { - "lastModified": 1750589353, - "narHash": "sha256-ESfhPjQ6E/JUdFknr+HTHqZU5ZcwlTODemMTxApg1D0=", + "lastModified": 1755781160, + "narHash": "sha256-8pOPsz8kMppCZa9HdvjxH/kB6DIdlpXXBcuNGLMZfSM=", "ref": "refs/heads/main", - "rev": "dd33128c2f127f39c30cca72addb1970b8936d07", - "revCount": 6213, + "rev": "50a242f16abfc49efc6f89ea9cd14a3544888a25", + "revCount": 6384, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -306,11 +340,11 @@ ] }, "locked": { - "lastModified": 1750503578, - "narHash": "sha256-/qnR7/GvGP1cGtOOm4OGJRtkVejn75/jsvJpiqE1ZDk=", + "lastModified": 1755183521, + "narHash": "sha256-wrP8TM2lb2x0+PyTc7Uc3yfVBeIlYW7+hFeG14N9Cr8=", "owner": "hyprwm", "repo": "hyprland-plugins", - "rev": "8b4405ab46cafc471d5b09ff7258676dc9aaca59", + "rev": "c1ddebb423acc7c88653c04de5ddafee64dac89a", "type": "github" }, "original": { @@ -399,11 +433,11 @@ ] }, "locked": { - "lastModified": 1750371812, - "narHash": "sha256-D868K1dVEACw17elVxRgXC6hOxY+54wIEjURztDWLk8=", + "lastModified": 1753819801, + "narHash": "sha256-tHe6XeNeVeKapkNM3tcjW4RuD+tB2iwwoogWJOtsqTI=", "owner": "hyprwm", "repo": "hyprland-qtutils", - "rev": "b13c7481e37856f322177010bdf75fccacd1adc8", + "rev": "b308a818b9dcaa7ab8ccab891c1b84ebde2152bc", "type": "github" }, "original": { @@ -428,11 +462,11 @@ ] }, "locked": { - "lastModified": 1750371198, - "narHash": "sha256-/iuJ1paQOBoSLqHflRNNGyroqfF/yvPNurxzcCT0cAE=", + "lastModified": 1753622892, + "narHash": "sha256-0K+A+gmOI8IklSg5It1nyRNv0kCNL51duwnhUO/B8JA=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "cee01452bca58d6cadb3224e21e370de8bc20f0b", + "rev": "23f0debd2003f17bd65f851cd3f930cff8a8c809", "type": "github" }, "original": { @@ -449,11 +483,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1747531250, - "narHash": "sha256-uDhXNURTJgQSpiaCgzqAizbblpcEWEB1WGWEqtCnLLM=", + "lastModified": 1754887838, + "narHash": "sha256-npC+H+Wl60EdrV75sjqm+bbbLbKgCCGn4ALSM0B2OWA=", "owner": "KZDKM", "repo": "Hyprspace", - "rev": "511d399120bdcafb43e57ca5ff35167c2bba6db8", + "rev": "2b61fd2115262243b03aa9afe8dfd8a78e71636c", "type": "github" }, "original": { @@ -474,11 +508,11 @@ ] }, "locked": { - "lastModified": 1750371096, - "narHash": "sha256-JB1IeJ41y7kWc/dPGV6RMcCUM0Xj2NEK26A2Ap7EM9c=", + "lastModified": 1754481650, + "narHash": "sha256-6u6HdEFJh5gY6VfyMQbhP7zDdVcqOrCDTkbiHJmAtMI=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "38f3a211657ce82a1123bf19402199b67a410f08", + "rev": "df6b8820c4a0835d83d0c7c7be86fbc555f1f7fd", "type": "github" }, "original": { @@ -499,11 +533,11 @@ ] }, "locked": { - "lastModified": 1750371869, - "narHash": "sha256-lGk4gLjgZQ/rndUkzmPYcgbHr8gKU5u71vyrjnwfpB4=", + "lastModified": 1751897909, + "narHash": "sha256-FnhBENxihITZldThvbO7883PdXC/2dzW4eiNvtoV5Ao=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "aa38edd6e3e277ae6a97ea83a69261a5c3aab9fd", + "rev": "fcca0c61f988a9d092cbb33e906775014c61579d", "type": "github" }, "original": { @@ -517,7 +551,7 @@ "crane": "crane", "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "rust-overlay": "rust-overlay" }, @@ -539,14 +573,14 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_3", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1749574455, - "narHash": "sha256-fm2/8KPOYvvIAnNVtjDlTt/My00lIbZQ+LMrfQIWVzs=", + "lastModified": 1755261305, + "narHash": "sha256-EOqCupB5X5WoGVHVcfOZcqy0SbKWNuY3kq+lj1wHdu8=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "917af390377c573932d84b5e31dd9f2c1b5c0f09", + "rev": "203a7b463f307c60026136dd1191d9001c43457f", "type": "github" }, "original": { @@ -558,27 +592,26 @@ }, "nixpkgs": { "locked": { - "lastModified": 1750365781, - "narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=", + "lastModified": 1748162331, + "narHash": "sha256-rqc2RKYTxP3tbjA+PB3VMRQNnjesrT0pEofXQTrMsS8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54", + "rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "ref": "nixos-25.05", + "type": "indirect" } }, "nixpkgs-latest": { "locked": { - "lastModified": 1750591067, - "narHash": "sha256-E1cW8nG5JceZnbgd8mVAvIEa/PQpAEN7/FknHNUQBn0=", + "lastModified": 1755792360, + "narHash": "sha256-Bp9mBVrO0c6EDGBXH4jWE+IlEf+FW+jJDSoFuf+ncg8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "38e5187aeea047f16faa4f03a110c69e353b8396", + "rev": "dac37fbcd385fbb0ea1e6d153673f62b5f4e0079", "type": "github" }, "original": { @@ -606,11 +639,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1750365781, - "narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=", + "lastModified": 1755615617, + "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54", + "rev": "20075955deac2583bb12f07151c2df830ef346b4", "type": "github" }, "original": { @@ -620,6 +653,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1754725699, + "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1731919951, "narHash": "sha256-vOM6ETpl1yu9KLi/icTmLJIPbbdJCdAVYUXZceO/Ce4=", @@ -635,29 +684,29 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { - "lastModified": 1749173751, - "narHash": "sha256-ENY3y3v6S9ZmLDDLI3LUT8MXmfXg/fSt2eA4GCnMVCE=", + "lastModified": 1754725699, + "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ed29f002b6d6e5e7e32590deb065c34a31dc3e91", + "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { - "lastModified": 1750400657, - "narHash": "sha256-3vkjFnxCOP6vm5Pm13wC/Zy6/VYgei/I/2DWgW4RFeA=", + "lastModified": 1755704039, + "narHash": "sha256-gKlP0LbyJ3qX0KObfIWcp5nbuHSb5EHwIvU6UcNBg2A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b2485d56967598da068b5a6946dadda8bfcbcd37", + "rev": "9cb344e96d5b6918e94e1bca2d9f3ea1e9615545", "type": "github" }, "original": { @@ -666,13 +715,13 @@ "type": "indirect" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { - "lastModified": 1747312588, - "narHash": "sha256-MmJvj6mlWzeRwKGLcwmZpKaOPZ5nJb/6al5CXqJsgjo=", + "lastModified": 1752596105, + "narHash": "sha256-lFNVsu/mHLq3q11MuGkMhUUoSXEdQjCHvpReaGP1S2k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b1bebd0fe266bbd1820019612ead889e96a8fa2d", + "rev": "dab3a6e781554f965bde3def0aa2fda4eb8f1708", "type": "github" }, "original": { @@ -692,11 +741,11 @@ ] }, "locked": { - "lastModified": 1749636823, - "narHash": "sha256-WUaIlOlPLyPgz9be7fqWJA5iG6rHcGRtLERSCfUDne4=", + "lastModified": 1754416808, + "narHash": "sha256-c6yg0EQ9xVESx6HGDOCMcyRSjaTpNJP10ef+6fRcofA=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "623c56286de5a3193aa38891a6991b28f9bab056", + "rev": "9c52372878df6911f9afc1e2a1391f55e4dfc864", "type": "github" }, "original": { @@ -734,13 +783,14 @@ }, "root": { "inputs": { + "copyparty": "copyparty", "home-manager": "home-manager", "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", "hyprspace": "hyprspace", "lanzaboote": "lanzaboote", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-latest": "nixpkgs-latest", "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix", @@ -776,11 +826,11 @@ ] }, "locked": { - "lastModified": 1747363019, - "narHash": "sha256-N4dwkRBmpOosa4gfFkFf/LTD8oOcNkAyvZ07JvRDEf0=", + "lastModified": 1752633862, + "narHash": "sha256-Bj7ozT1+5P7NmvDcuAXJvj56txcXuAhk3Vd9FdWFQzk=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "0e624f2b1972a34be1a9b35290ed18ea4b419b6f", + "rev": "8668ca94858206ac3db0860a9dec471de0d995f8", "type": "github" }, "original": { @@ -796,11 +846,11 @@ ] }, "locked": { - "lastModified": 1750119275, - "narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=", + "lastModified": 1754988908, + "narHash": "sha256-t+voe2961vCgrzPFtZxha0/kmFSHFobzF00sT8p9h0U=", "owner": "Mic92", "repo": "sops-nix", - "rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2", + "rev": "3223c7a92724b5d804e9988c6b447a0d09017d48", "type": "github" }, "original": { @@ -882,11 +932,11 @@ ] }, "locked": { - "lastModified": 1750372504, - "narHash": "sha256-VBeZb1oqZM1cqCAZnFz/WyYhO8aF/ImagI7WWg/Z3Og=", + "lastModified": 1753633878, + "narHash": "sha256-js2sLRtsOUA/aT10OCDaTjO80yplqwOIaLUqEe0nMx0=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "400308fc4f9d12e0a93e483c2e7a649e12af1a92", + "rev": "371b96bd11ad2006ed4f21229dbd1be69bed3e8a", "type": "github" }, "original": { @@ -897,16 +947,16 @@ }, "yazi": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_5", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_6", "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1750515839, - "narHash": "sha256-I3FdBExb2eaLVD76Vkl9TFy/snKrE+od0x6vtTMcqXc=", + "lastModified": 1755740452, + "narHash": "sha256-4C6tuLUdt2ohMPthPMT2Ma+vbn/y7Qz5qfZXVXcb+08=", "owner": "sxyazi", "repo": "yazi", - "rev": "3a9591a3d9d8f4c9fb990274e967bdef89177d14", + "rev": "0054cf0b878bae84d1bf0c063801dc9c42aa6978", "type": "github" }, "original": { From eba7f91576ff26d51e693b916b4fc9b8109a1e88 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:55:59 +0200 Subject: [PATCH 11/15] cleaner bar --- home-modules/bar.nix | 373 ++++++++++++++++++++++--------------------- 1 file changed, 187 insertions(+), 186 deletions(-) diff --git a/home-modules/bar.nix b/home-modules/bar.nix index f8632bd..fd70074 100644 --- a/home-modules/bar.nix +++ b/home-modules/bar.nix @@ -5,39 +5,39 @@ in { "nx2site/radicale/password" = { }; }; home.packages = [ - (pkgs.writeShellApplication { name = "submap_indicator"; text = /*bash*/ '' - print_help() { - echo "Usage: submap_indicator {set |unset}" - } - if [ $# -lt 1 ]; then - print_help; exit 1; - fi - case "$1" in - set) - # Check if there is a second argument for the 'set' operation - if [ $# -eq 2 ]; then - echo "$2" > /tmp/submap-indictor - pkill -RTMIN+8 waybar - pkill -RTMIN+8 hyprpanel - else - echo "Error: 'set' operation requires exactly one string argument." - print_help - exit 1 - fi - ;; - unset) - echo "" > /tmp/submap-indictor - pkill -RTMIN+8 waybar - pkill -RTMIN+8 hyprpanel - ;; - *) - echo "Error: Unknown command '$1'" - print_help - exit 1 - ;; - esac - exit 0 - '';}) +# (pkgs.writeShellApplication { name = "submap_indicator"; text = /*bash*/ '' +# print_help() { +# echo "Usage: submap_indicator {set |unset}" +# } +# if [ $# -lt 1 ]; then +# print_help; exit 1; +# fi +# case "$1" in +# set) +# # Check if there is a second argument for the 'set' operation +# if [ $# -eq 2 ]; then +# echo "$2" > /tmp/submap-indictor +# pkill -RTMIN+8 waybar +# pkill -RTMIN+8 hyprpanel +# else +# echo "Error: 'set' operation requires exactly one string argument." +# print_help +# exit 1 +# fi +# ;; +# unset) +# echo "" > /tmp/submap-indictor +# pkill -RTMIN+8 waybar +# pkill -RTMIN+8 hyprpanel +# ;; +# *) +# echo "Error: Unknown command '$1'" +# print_help +# exit 1 +# ;; +# esac +# exit 0 +# '';}) (pkgs.writeShellApplication { name = "cclock"; text = /*bash*/ '' ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}') if [ $# -eq 0 ]; then @@ -168,167 +168,167 @@ if __name__ == "__main__": '') ]; programs = { - waybar = { - enable = false; - package = pkgs.waybar; - settings = { - bar = { - # height = 20; - layer = "top"; - position = "bottom"; - margin-top = 0; - # margin-left = rice.gap-size; - # margin-bottom = rice.gap-size; - # margin-right = rice.gap-size; - margin-left = 0; - margin-bottom = 0; - margin-right = 0; - spacing = 10; - fixed-center = true; - modules-left = [ - # "cpu" - # "memory" - "wireplumber" - "backlight" - "battery" - "network" - "hyprland/window" - ]; - modules-center = [ - "hyprland/workspaces" - ]; - modules-right = [ - "custom/mode" - "custom/caldav_event" - "custom/cclock" - "tray" - ]; - "hyprland/workspaces" = { - on-click = "activate"; - format = "{name}"; - all-outputs = false; - active-only = false; - }; - "hyprland/window" = { - # format = "${sep}{}"; - format = "{}"; - separate-outputs = true; - }; - "custom/cclock" = { - exec = "cclock"; - restart-interval = 60; - }; - "custom/caldav_event" = { - format = "󰃰${sep}{}"; - exec = "caldav_event"; - restart-interval = 60; - max-width = 60; - }; - "custom/mode" = { - exec = "cat /tmp/submap-indictor"; - interval = "once"; - signal = 8; - }; +# waybar = { +# enable = false; +# package = pkgs.waybar; +# settings = { +# bar = { +# # height = 20; +# layer = "top"; +# position = "bottom"; +# margin-top = 0; +# # margin-left = rice.gap-size; +# # margin-bottom = rice.gap-size; +# # margin-right = rice.gap-size; +# margin-left = 0; +# margin-bottom = 0; +# margin-right = 0; +# spacing = 10; +# fixed-center = true; +# modules-left = [ +# # "cpu" +# # "memory" +# "wireplumber" +# "backlight" +# "battery" +# "network" +# "hyprland/window" +# ]; +# modules-center = [ +# "hyprland/workspaces" +# ]; +# modules-right = [ +# "custom/mode" +# "custom/caldav_event" +# "custom/cclock" +# "tray" +# ]; +# "hyprland/workspaces" = { +# on-click = "activate"; +# format = "{name}"; +# all-outputs = false; +# active-only = false; +# }; +# "hyprland/window" = { +# # format = "${sep}{}"; +# format = "{}"; +# separate-outputs = true; +# }; +# "custom/cclock" = { +# exec = "cclock"; +# restart-interval = 60; +# }; +# "custom/caldav_event" = { +# format = "󰃰${sep}{}"; +# exec = "caldav_event"; +# restart-interval = 60; +# max-width = 60; +# }; +# "custom/mode" = { +# exec = "cat /tmp/submap-indictor"; +# interval = "once"; +# signal = 8; +# }; - cpu = { - interval = 1; - format = "󰍛${sep}{}%"; - max-length = 10; - }; - memory = { - interval = 5; - format = "${sep}{avail:.0f}G free"; - }; - battery = { - interval = 60; - tooltip = false; - format = "{icon}${sep}{capacity}%"; - states = { - warning = 15; - critical = 5; - }; - format-icons = [ " " " " " " " " " " ]; - format-charging = "{icon}${sep}+{capacity}%"; - format-plugged = "{icon}${sep}P{capacity}%"; - format-full = "{icon}${sep}F{capacity}%"; - }; - backlight = { - device = "eDP-1"; - format = "{icon}${sep}{percent}%"; - format-icons = [ "" "" "" "" "" "" "" "" "" ]; - }; - network = { - format-wifi = "${sep}{essid}"; - format-ethernet = "󰈀${sep}Wired"; - format-disconnected = "󰌙${sep}Disconnected"; - }; - wireplumber = { - format = "󰕾${sep}{volume}%"; - format-muted = "󰝟${sep}--%"; - }; - }; - }; - style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ '' - * { - font-family: ${rice.font.code.name}; - font-size: 1em; - min-height: 0px; - margin: 0px; - padding: 0px; - } +# cpu = { +# interval = 1; +# format = "󰍛${sep}{}%"; +# max-length = 10; +# }; +# memory = { +# interval = 5; +# format = "${sep}{avail:.0f}G free"; +# }; +# battery = { +# interval = 60; +# tooltip = false; +# format = "{icon}${sep}{capacity}%"; +# states = { +# warning = 15; +# critical = 5; +# }; +# format-icons = [ " " " " " " " " " " ]; +# format-charging = "{icon}${sep}+{capacity}%"; +# format-plugged = "{icon}${sep}P{capacity}%"; +# format-full = "{icon}${sep}F{capacity}%"; +# }; +# backlight = { +# device = "eDP-1"; +# format = "{icon}${sep}{percent}%"; +# format-icons = [ "" "" "" "" "" "" "" "" "" ]; +# }; +# network = { +# format-wifi = "${sep}{essid}"; +# format-ethernet = "󰈀${sep}Wired"; +# format-disconnected = "󰌙${sep}Disconnected"; +# }; +# wireplumber = { +# format = "󰕾${sep}{volume}%"; +# format-muted = "󰝟${sep}--%"; +# }; +# }; +# }; +# style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ '' +# * { +# font-family: ${rice.font.code.name}; +# font-size: 1em; +# min-height: 0px; +# margin: 0px; +# padding: 0px; +# } - window#waybar { - background: rgba(${f background},${builtins.toString rice.transparency}); - } +# window#waybar { +# background: rgba(${f background},${builtins.toString rice.transparency}); +# } - #clock, - #custom-cclock, - #custom-mode, - #custom-caldav-event, - #battery, - #cpu, - #tray, - #disk, - #backlight, - #network, - #wireplumber, - #memory, - #window, - #workspaces { - padding: 0px 3px; - margin-top: 0.3em; - border-radius: ${builtins.toString rice.rounding}px; - color: rgb(${f accent.bright}); - } +# #clock, +# #custom-cclock, +# #custom-mode, +# #custom-caldav-event, +# #battery, +# #cpu, +# #tray, +# #disk, +# #backlight, +# #network, +# #wireplumber, +# #memory, +# #window, +# #workspaces { +# padding: 0px 3px; +# margin-top: 0.3em; +# border-radius: ${builtins.toString rice.rounding}px; +# color: rgb(${f accent.bright}); +# } - #workspaces button { - color: rgb(${f accent.base}); - padding-left: 15px; - padding-right: 15px; - border-radius: ${builtins.toString rice.rounding}px; - } - #workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); } - #workspaces button:hover { color: rgb(${f tertiary.bright}); } - #workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); } +# #workspaces button { +# color: rgb(${f accent.base}); +# padding-left: 15px; +# padding-right: 15px; +# border-radius: ${builtins.toString rice.rounding}px; +# } +# #workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); } +# #workspaces button:hover { color: rgb(${f tertiary.bright}); } +# #workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); } - #window, #custom-caldav_event { - font-family: ${rice.font.base.name}, ${rice.font.code.name}; - color: rgb(${f tertiary.bright}); - } +# #window, #custom-caldav_event { +# font-family: ${rice.font.base.name}, ${rice.font.code.name}; +# color: rgb(${f tertiary.bright}); +# } - #wireplumber.muted { color: rgb(${f tertiary.bright}); } - #wireplumber { padding-left: 10px; } +# #wireplumber.muted { color: rgb(${f tertiary.bright}); } +# #wireplumber { padding-left: 10px; } - #battery.warning:not(.charging) { color: rgb(${f green.base});; } - #battery.charging { color: rgb(${f green.base}); } - #battery.critical { - background: rgb(${f negative.base}); - color: rgb(${f foreground}); - } +# #battery.warning:not(.charging) { color: rgb(${f green.base});; } +# #battery.charging { color: rgb(${f green.base}); } +# #battery.critical { +# background: rgb(${f negative.base}); +# color: rgb(${f foreground}); +# } - #custom-mode { color: rgb(${f red.base}); } - ''; - }; +# #custom-mode { color: rgb(${f red.base}); } +# ''; +# }; hyprpanel = { enable = true; package = pkgs.unstable.hyprpanel; @@ -368,6 +368,7 @@ if __name__ == "__main__": "bar.customModules.submap.icon" = true; "bar.customModules.submap.disabledIcon" = ""; + "bar.workspaces.applicationIconEmptyWorkspace" = ""; "bar.workspaces.applicationIconOncePerWorkspace" = false; "bar.workspaces.numbered_active_indicator" = "underline"; "bar.workspaces.scroll_speed" = 1; From 151f61d31e56937bbcf6f28751aa4c00496c461c Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Sun, 24 Aug 2025 14:56:10 +0200 Subject: [PATCH 12/15] rclone --- home-modules/rclone.nix | 31 +++++++++++++++++++++++++++++++ home.nix | 1 + 2 files changed, 32 insertions(+) create mode 100644 home-modules/rclone.nix diff --git a/home-modules/rclone.nix b/home-modules/rclone.nix new file mode 100644 index 0000000..04dd205 --- /dev/null +++ b/home-modules/rclone.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }@all: with all; { + home.packages = with pkgs; [ rclone ]; + sops.secrets."copyparty/user-password/${hyper.user}".path = "%r/secrets/copyparty/user-password/${hyper.user}"; + programs.rclone = { + enable = true; + package = pkgs.rclone; + remotes = { + "file.${hyper.domain}" = { + config = { + type = "webdav"; + vendor = "owncloud"; # copyparty + url = "https://file.${hyper.domain}/"; + user = hyper.user; + }; + mounts = { + "" = { + enable = true; + mountPoints = "${hyper.home}/file.nx2.site/"; + options = { + vfs-cache-mode = "full"; + }; + }; + }; + secrets = { + pass = "/run/usr/1000/secrets/copyparty/user-password/${hyper.user}"; + }; + }; + }; + }; +} + diff --git a/home.nix b/home.nix index 708878c..68f96c1 100644 --- a/home.nix +++ b/home.nix @@ -48,6 +48,7 @@ ./home-modules/programming/js.nix ./home-modules/programming/python.nix ./home-modules/qt.nix + ./home-modules/rclone.nix ./home-modules/rofi.nix ./home-modules/scanning.nix ./home-modules/sent.nix From 880b3abd60d0ade25572b87084e3d0c19aef5c39 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 25 Aug 2025 13:34:32 +0200 Subject: [PATCH 13/15] bar --- home-modules/bar.nix | 813 +------------------------- home-modules/bar/caldav-event.nix | 126 ++++ home-modules/bar/cclock.nix | 14 + home-modules/bar/hyprpanel.nix | 512 ++++++++++++++++ home-modules/bar/submap-indicator.nix | 37 ++ home-modules/bar/waybar.nix | 165 ++++++ 6 files changed, 861 insertions(+), 806 deletions(-) create mode 100644 home-modules/bar/caldav-event.nix create mode 100644 home-modules/bar/cclock.nix create mode 100644 home-modules/bar/hyprpanel.nix create mode 100644 home-modules/bar/submap-indicator.nix create mode 100644 home-modules/bar/waybar.nix diff --git a/home-modules/bar.nix b/home-modules/bar.nix index fd70074..06cd61e 100644 --- a/home-modules/bar.nix +++ b/home-modules/bar.nix @@ -1,808 +1,9 @@ -{ pkgs, hyper, ... }@all: with all; let - sep = " "; -in { - sops.secrets = { - "nx2site/radicale/password" = { }; - }; - home.packages = [ -# (pkgs.writeShellApplication { name = "submap_indicator"; text = /*bash*/ '' -# print_help() { -# echo "Usage: submap_indicator {set |unset}" -# } -# if [ $# -lt 1 ]; then -# print_help; exit 1; -# fi -# case "$1" in -# set) -# # Check if there is a second argument for the 'set' operation -# if [ $# -eq 2 ]; then -# echo "$2" > /tmp/submap-indictor -# pkill -RTMIN+8 waybar -# pkill -RTMIN+8 hyprpanel -# else -# echo "Error: 'set' operation requires exactly one string argument." -# print_help -# exit 1 -# fi -# ;; -# unset) -# echo "" > /tmp/submap-indictor -# pkill -RTMIN+8 waybar -# pkill -RTMIN+8 hyprpanel -# ;; -# *) -# echo "Error: Unknown command '$1'" -# print_help -# exit 1 -# ;; -# esac -# exit 0 -# '';}) - (pkgs.writeShellApplication { name = "cclock"; text = /*bash*/ '' - ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}') - if [ $# -eq 0 ]; then - echo "󰃮${sep}$(date +'%A the')" "$ord" "of" "$(date +'%B')" " ${sep}$(date +'%R')" - elif [ "$1" = "--no-icons" ]; then - echo "$(date +'%A the')" "$ord" "of" "$(date +'%B')" "$(date +'%R')" - fi - '';}) - - (pkgs.writers.writePython3Bin "caldav_event" { - libraries = with pkgs.python3Packages; [ caldav ics pytz ]; - flakeIgnore = [ "E302" "E305" "E501" "E261" ]; - } /* python */ '' -import os -import json -from caldav import DAVClient -from datetime import datetime, timezone -from ics import Calendar -from pytz import UTC - -def get_password(password_file): - with open(password_file, "r") as file: - return file.read().strip() - -def datetime_converter(obj): - if isinstance(obj, datetime): - return obj.isoformat() - return obj - -def datetime_parser(dct): - for key, value in dct.items(): - if isinstance(value, str): - try: - dct[key] = datetime.fromisoformat(value) - except ValueError: - pass - return dct - -def load_cache(cache_file): - if os.path.exists(cache_file): - with open(cache_file, "r") as file: - return json.load(file, object_hook=datetime_parser) - return None - -def save_cache(cache_file, data): - with open(cache_file, "w") as file: - json.dump(data, file, default=datetime_converter, indent=4) - - -def get_ongoing_or_next_event(url, username, password): - now = datetime.now(timezone.utc) - - try: - client = DAVClient(url, username=username, password=password) - principal = client.principal() - calendars = principal.calendars() - - next_event_dict = { - 'event_name': "fake", - 'event_begin': datetime(9000, 1, 1, tzinfo=UTC), # in the year 9000 - 'event_end': datetime(9000, 1, 1, 8, tzinfo=UTC), - } - - for calendar in calendars: - for event in calendar.search(start=now): - calendar_parsed = Calendar(event.data) - for ics_event in calendar_parsed.events: - event_dict = {} - event_dict['event_name'] = ics_event.name or "(No Title)" - event_dict['event_begin'] = ics_event.begin.astimezone(timezone.utc) - event_dict['event_end'] = ics_event.end.astimezone(timezone.utc) - - if event_dict['event_begin'] <= now and now <= event_dict['event_end']: - return event_dict - elif event_dict['event_begin'] >= now and next_event_dict['event_begin'] > event_dict['event_begin']: - next_event_dict = event_dict - return next_event_dict - - except Exception as e: - print(f"Error accessing {url}: {e}") - return None - -def is_expired(event_dict: dict): - now = datetime.now(timezone.utc).timestamp() - event_end = event_dict['event_end'].timestamp() - return not (now <= event_end) - -if __name__ == "__main__": - password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file - cache_file = "/tmp/caldav_event_cache.json" # Path to cache file - url = "https://dav.${hyper.domain}/" - username = "nx2" - password = get_password(password_file) - now = datetime.now(timezone.utc).timestamp() - - event_dict = load_cache(cache_file) - - if (event_dict is None) or (is_expired(event_dict)): - event_dict = get_ongoing_or_next_event(url, username, password) - save_cache(cache_file, event_dict) - - if event_dict is None: # none were found - print("* zen *") - exit(0) - - event_start = event_dict['event_begin'].timestamp() - event_end = event_dict['event_end'].timestamp() - - if event_start <= now <= event_end: # is currently ongoing - action_string = "ends" - t = event_end - now # time_remaining - else: # is in the future - action_string = "starts" - t = event_start - now # time_remaining - - hours, rem = divmod(int(t), 3600) - minutes, _ = divmod(rem, 60) - hour_string = f"{hours} hour{'s ' if hours != 1 else ' '}" if hours > 0 else "" - minu_string = f"{minutes} minute{'s ' if minutes != 1 else ' '}" if minutes > 0 else "" - if hour_string == "" and minu_string == "": - time_string = "now" - elif hour_string == "" or minu_string == "": - time_string = "in " + hour_string + minu_string - else: - time_string = "in " + hour_string + "and " + minu_string - - print(f"{event_dict['event_name']} {action_string} {time_string}") -'') +{ ... }: { + imports = [ + # ./bar/submap-indicator.nix + ./bar/cclock.nix + ./bar/caldav-event.nix + # ./bar/waybar.nix + ./bar/hyprpanel.nix ]; - programs = { -# waybar = { -# enable = false; -# package = pkgs.waybar; -# settings = { -# bar = { -# # height = 20; -# layer = "top"; -# position = "bottom"; -# margin-top = 0; -# # margin-left = rice.gap-size; -# # margin-bottom = rice.gap-size; -# # margin-right = rice.gap-size; -# margin-left = 0; -# margin-bottom = 0; -# margin-right = 0; -# spacing = 10; -# fixed-center = true; -# modules-left = [ -# # "cpu" -# # "memory" -# "wireplumber" -# "backlight" -# "battery" -# "network" -# "hyprland/window" -# ]; -# modules-center = [ -# "hyprland/workspaces" -# ]; -# modules-right = [ -# "custom/mode" -# "custom/caldav_event" -# "custom/cclock" -# "tray" -# ]; -# "hyprland/workspaces" = { -# on-click = "activate"; -# format = "{name}"; -# all-outputs = false; -# active-only = false; -# }; -# "hyprland/window" = { -# # format = "${sep}{}"; -# format = "{}"; -# separate-outputs = true; -# }; -# "custom/cclock" = { -# exec = "cclock"; -# restart-interval = 60; -# }; -# "custom/caldav_event" = { -# format = "󰃰${sep}{}"; -# exec = "caldav_event"; -# restart-interval = 60; -# max-width = 60; -# }; -# "custom/mode" = { -# exec = "cat /tmp/submap-indictor"; -# interval = "once"; -# signal = 8; -# }; - -# cpu = { -# interval = 1; -# format = "󰍛${sep}{}%"; -# max-length = 10; -# }; -# memory = { -# interval = 5; -# format = "${sep}{avail:.0f}G free"; -# }; -# battery = { -# interval = 60; -# tooltip = false; -# format = "{icon}${sep}{capacity}%"; -# states = { -# warning = 15; -# critical = 5; -# }; -# format-icons = [ " " " " " " " " " " ]; -# format-charging = "{icon}${sep}+{capacity}%"; -# format-plugged = "{icon}${sep}P{capacity}%"; -# format-full = "{icon}${sep}F{capacity}%"; -# }; -# backlight = { -# device = "eDP-1"; -# format = "{icon}${sep}{percent}%"; -# format-icons = [ "" "" "" "" "" "" "" "" "" ]; -# }; -# network = { -# format-wifi = "${sep}{essid}"; -# format-ethernet = "󰈀${sep}Wired"; -# format-disconnected = "󰌙${sep}Disconnected"; -# }; -# wireplumber = { -# format = "󰕾${sep}{volume}%"; -# format-muted = "󰝟${sep}--%"; -# }; -# }; -# }; -# style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ '' -# * { -# font-family: ${rice.font.code.name}; -# font-size: 1em; -# min-height: 0px; -# margin: 0px; -# padding: 0px; -# } - -# window#waybar { -# background: rgba(${f background},${builtins.toString rice.transparency}); -# } - -# #clock, -# #custom-cclock, -# #custom-mode, -# #custom-caldav-event, -# #battery, -# #cpu, -# #tray, -# #disk, -# #backlight, -# #network, -# #wireplumber, -# #memory, -# #window, -# #workspaces { -# padding: 0px 3px; -# margin-top: 0.3em; -# border-radius: ${builtins.toString rice.rounding}px; -# color: rgb(${f accent.bright}); -# } - -# #workspaces button { -# color: rgb(${f accent.base}); -# padding-left: 15px; -# padding-right: 15px; -# border-radius: ${builtins.toString rice.rounding}px; -# } -# #workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); } -# #workspaces button:hover { color: rgb(${f tertiary.bright}); } -# #workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); } - -# #window, #custom-caldav_event { -# font-family: ${rice.font.base.name}, ${rice.font.code.name}; -# color: rgb(${f tertiary.bright}); -# } - -# #wireplumber.muted { color: rgb(${f tertiary.bright}); } -# #wireplumber { padding-left: 10px; } - -# #battery.warning:not(.charging) { color: rgb(${f green.base});; } -# #battery.charging { color: rgb(${f green.base}); } -# #battery.critical { -# background: rgb(${f negative.base}); -# color: rgb(${f foreground}); -# } - -# #custom-mode { color: rgb(${f red.base}); } -# ''; -# }; - hyprpanel = { - enable = true; - package = pkgs.unstable.hyprpanel; - settings = with rice.color; let - t = builtins.toString (builtins.ceil (rice.transparency * 100)); - in { - "bar.layouts" = { - "*" = { - "left" = [ - "volume" - # "microphone" - # "cpu" - # "cputemp" - # "ram" - "battery" - # "bluetooth" - "network" - "windowtitle" - ]; - "middle" = [ "workspaces" ]; - "right" = [ - "submap" - "custom/caldav_event" - "media" - "custom/cclock" - "notifications" - "systray" - ]; - }; - }; - - "bar.bluetooth.label" = true; - - "bar.customModules.submap.enabledIcon" = "[󰧹]"; - "bar.customModules.submap.showSubmapName" = false; - "bar.customModules.submap.label" = false; - "bar.customModules.submap.icon" = true; - "bar.customModules.submap.disabledIcon" = ""; - - "bar.workspaces.applicationIconEmptyWorkspace" = ""; - "bar.workspaces.applicationIconOncePerWorkspace" = false; - "bar.workspaces.numbered_active_indicator" = "underline"; - "bar.workspaces.scroll_speed" = 1; - "bar.workspaces.showAllActive" = false; - "bar.workspaces.showApplicationIcons" = true; - "bar.workspaces.show_icons" = false; - "bar.workspaces.show_numbered" = false; - "bar.workspaces.showWsIcons" = true; - "bar.workspaces.spacing" = 1; - "bar.workspaces.workspaceMask" = true; - "bar.workspaces.workspaces" = 5; - - "theme.bar.background" = background; - "theme.bar.border.color" = accent.base; - "theme.bar.border_radius" = "0.2em"; - - "theme.bar.buttons.background" = background; - "theme.bar.buttons.background_opacity" = 0; - "theme.bar.buttons.spacing" = "0em"; - "theme.bar.buttons.padding_x" = "0.5rem"; - - "theme.bar.buttons.battery.background" = background; - "theme.bar.buttons.battery.border" = accent.base; - "theme.bar.buttons.battery.icon_background" = background; - "theme.bar.buttons.battery.icon" = accent.base; - "theme.bar.buttons.battery.text" = accent.base; - - "theme.bar.buttons.bluetooth.background" = background; - "theme.bar.buttons.bluetooth.border" = accent.base; - "theme.bar.buttons.bluetooth.icon_background" = background; - "theme.bar.buttons.bluetooth.icon" = accent.base; - "theme.bar.buttons.bluetooth.text" = accent.base; - - "theme.bar.buttons.borderColor" = accent.base; - - "theme.bar.buttons.clock.background" = background; - "theme.bar.buttons.clock.border" = accent.base; - "theme.bar.buttons.clock.icon_background" = background; - "theme.bar.buttons.clock.icon" = accent.base; - "theme.bar.buttons.clock.text" = accent.base; - - "theme.bar.buttons.dashboard.background" = background; - "theme.bar.buttons.dashboard.border" = accent.base; - "theme.bar.buttons.dashboard.icon" = accent.base; - "theme.bar.buttons.icon_background" = background; - - "theme.bar.buttons.icon" = accent.base; - - "theme.bar.buttons.media.background" = background; - "theme.bar.buttons.media.border" = accent.base; - "theme.bar.buttons.media.icon_background" = background; - "theme.bar.buttons.media.icon" = accent.base; - "theme.bar.buttons.media.text" = accent.base; - - "theme.bar.buttons.modules.cava.background" = background; - "theme.bar.buttons.modules.cava.border" = accent.base; - "theme.bar.buttons.modules.cava.icon_background" = background; - "theme.bar.buttons.modules.cava.icon" = accent.base; - "theme.bar.buttons.modules.cava.text" = accent.base; - - "theme.bar.buttons.modules.cpu.background" = background; - "theme.bar.buttons.modules.cpu.border" = accent.base; - "theme.bar.buttons.modules.cpu.icon_background" = background; - "theme.bar.buttons.modules.cpu.icon" = accent.base; - "theme.bar.buttons.modules.cpu.text" = accent.base; - - "theme.bar.buttons.modules.cpuTemp.background" = background; - "theme.bar.buttons.modules.cpuTemp.border" = accent.base; - "theme.bar.buttons.modules.cpuTemp.icon_background" = background; - "theme.bar.buttons.modules.cpuTemp.icon" = accent.base; - "theme.bar.buttons.modules.cpuTemp.text" = accent.base; - - "theme.bar.buttons.modules.hypridle.background" = background; - "theme.bar.buttons.modules.hypridle.border" = accent.base; - "theme.bar.buttons.modules.hypridle.icon_background" = background; - "theme.bar.buttons.modules.hypridle.icon" = accent.base; - "theme.bar.buttons.modules.hypridle.text" = accent.base; - - "theme.bar.buttons.modules.hyprsunset.background" = background; - "theme.bar.buttons.modules.hyprsunset.border" = accent.base; - "theme.bar.buttons.modules.hyprsunset.icon_background" = background; - "theme.bar.buttons.modules.hyprsunset.icon" = accent.base; - "theme.bar.buttons.modules.hyprsunset.text" = accent.base; - - "theme.bar.buttons.modules.kbLayout.background" = background; - "theme.bar.buttons.modules.kbLayout.border" = accent.base; - "theme.bar.buttons.modules.kbLayout.icon_background" = background; - "theme.bar.buttons.modules.kbLayout.icon" = accent.base; - "theme.bar.buttons.modules.kbLayout.text" = accent.base; - - "theme.bar.buttons.modules.microphone.background" = background; - "theme.bar.buttons.modules.microphone.border" = accent.base; - "theme.bar.buttons.modules.microphone.icon_background" = background; - "theme.bar.buttons.modules.microphone.icon" = accent.base; - "theme.bar.buttons.modules.microphone.text" = accent.base; - - "theme.bar.buttons.modules.netstat.background" = background; - "theme.bar.buttons.modules.netstat.border" = accent.base; - "theme.bar.buttons.modules.netstat.icon_background" = background; - "theme.bar.buttons.modules.netstat.icon" = accent.base; - "theme.bar.buttons.modules.netstat.text" = accent.base; - - "theme.bar.buttons.modules.power.background" = background; - "theme.bar.buttons.modules.power.border" = accent.base; - "theme.bar.buttons.modules.power.icon_background" = background; - "theme.bar.buttons.modules.power.icon" = accent.base; - - "theme.bar.buttons.modules.ram.background" = background; - "theme.bar.buttons.modules.ram.border" = accent.base; - "theme.bar.buttons.modules.ram.icon_background" = background; - "theme.bar.buttons.modules.ram.icon" = accent.base; - "theme.bar.buttons.modules.ram.text" = accent.base; - - "theme.bar.buttons.modules.storage.background" = background; - "theme.bar.buttons.modules.storage.border" = accent.base; - "theme.bar.buttons.modules.storage.icon_background" = background; - "theme.bar.buttons.modules.storage.icon" = accent.base; - "theme.bar.buttons.modules.storage.text" = accent.base; - - "theme.bar.buttons.modules.submap.background" = background; - "theme.bar.buttons.modules.submap.border" = accent.base; - "theme.bar.buttons.modules.submap.icon_background" = background; - "theme.bar.buttons.modules.submap.icon" = accent.base; - "theme.bar.buttons.modules.submap.text" = special.base; - - "theme.bar.buttons.modules.updates.background" = background; - "theme.bar.buttons.modules.updates.border" = accent.base; - "theme.bar.buttons.modules.updates.icon_background" = background; - "theme.bar.buttons.modules.updates.icon" = accent.base; - "theme.bar.buttons.modules.updates.text" = accent.base; - - "theme.bar.buttons.modules.weather.background" = background; - "theme.bar.buttons.modules.weather.border" = accent.base; - "theme.bar.buttons.modules.weather.icon_background" = background; - "theme.bar.buttons.modules.weather.icon" = accent.base; - "theme.bar.buttons.modules.weather.text" = accent.base; - - "theme.bar.buttons.modules.worldclock.background" = background; - "theme.bar.buttons.modules.worldclock.border" = accent.base; - "theme.bar.buttons.modules.worldclock.icon_background" = background; - "theme.bar.buttons.modules.worldclock.icon" = accent.base; - "theme.bar.buttons.modules.worldclock.text" = accent.base; - "theme.bar.buttons.monochrome" = false; - - "theme.bar.buttons.network.background" = background; - "theme.bar.buttons.network.border" = accent.base; - "theme.bar.buttons.network.icon_background" = background; - "theme.bar.buttons.network.icon" = accent.base; - "theme.bar.buttons.network.text" = accent.base; - - "theme.bar.buttons.notifications.background" = background; - "theme.bar.buttons.notifications.border" = accent.base; - "theme.bar.buttons.notifications.icon_background" = background; - "theme.bar.buttons.notifications.icon" = accent.base; - "theme.bar.buttons.notifications.total" = accent.base; - - "theme.bar.buttons.opacity" = t; - - "theme.bar.buttons.separator.color" = accent.base; - - "theme.bar.buttons.style" = "default"; - - "theme.bar.buttons.systray.background" = background; - "theme.bar.buttons.systray.border" = accent.base; - "theme.bar.buttons.systray.customIcon" = accent.base; - - "theme.bar.buttons.text" = accent.base; - - "theme.bar.buttons.volume.background" = background; - "theme.bar.buttons.volume.border" = accent.base; - "theme.bar.buttons.volume.icon_background" = background; - "theme.bar.buttons.volume.icon" = accent.base; - "theme.bar.buttons.volume.text" = accent.base; - - "theme.bar.buttons.windowtitle.background" = background; - "theme.bar.buttons.windowtitle.border" = secondary.base; - "theme.bar.buttons.windowtitle.icon_background" = background; - "theme.bar.buttons.windowtitle.icon" = secondary.base; - "theme.bar.buttons.windowtitle.text" = secondary.base; - - "theme.bar.buttons.workspaces.active" = accent.bright; - "theme.bar.buttons.workspaces.available" = accent.base; - "theme.bar.buttons.workspaces.background" = background; - "theme.bar.buttons.workspaces.border" = accent.base; - "theme.bar.buttons.workspaces.hover" = foreground; - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color" = accent.base; - "theme.bar.buttons.workspaces.numbered_active_highlight_padding" = "0.2em"; - "theme.bar.buttons.workspaces.numbered_active_underline_color" = accent.bright; - "theme.bar.buttons.workspaces.numbered_inactive_padding" = "0.2em"; - "theme.bar.buttons.workspaces.occupied" = secondary.base; - "theme.bar.buttons.workspaces.pill.width" = "4em"; - "theme.bar.buttons.workspaces.smartHighlight" = true; - "theme.bar.buttons.y_margins" = "0em"; - - "theme.bar.location" = "bottom"; - - "theme.bar.menus.menu.battery.background.color" = background; - "theme.bar.menus.menu.battery.border.color" = accent.base; - "theme.bar.menus.menu.battery.card.color" = accent.dark; - "theme.bar.menus.menu.battery.icons.active" = accent.base; - "theme.bar.menus.menu.battery.icons.passive" = accent.base; - "theme.bar.menus.menu.battery.label.color" = accent.base; - "theme.bar.menus.menu.battery.listitems.active" = accent.base; - "theme.bar.menus.menu.battery.listitems.passive" = accent.base; - "theme.bar.menus.menu.battery.slider.background" = background; - "theme.bar.menus.menu.battery.slider.backgroundhover" = background; - "theme.bar.menus.menu.battery.slider.primary" = accent.base; - "theme.bar.menus.menu.battery.slider.puck" = accent.base; - "theme.bar.menus.menu.battery.text" = foreground; - - "theme.bar.menus.menu.bluetooth.background.color" = background; - "theme.bar.menus.menu.bluetooth.border.color" = accent.base; - "theme.bar.menus.menu.bluetooth.card.color" = accent.dark; - "theme.bar.menus.menu.bluetooth.iconbutton.active" = accent.base; - "theme.bar.menus.menu.bluetooth.iconbutton.passive" = accent.base; - "theme.bar.menus.menu.bluetooth.icons.active" = accent.base; - "theme.bar.menus.menu.bluetooth.icons.passive" = accent.base; - "theme.bar.menus.menu.bluetooth.label.color" = accent.base; - "theme.bar.menus.menu.bluetooth.listitems.active" = accent.base; - "theme.bar.menus.menu.bluetooth.listitems.passive" = accent.base; - "theme.bar.menus.menu.bluetooth.scroller.color" = accent.base; - "theme.bar.menus.menu.bluetooth.status" = accent.base; - "theme.bar.menus.menu.bluetooth.switch.disabled" = accent.base; - "theme.bar.menus.menu.bluetooth.switch_divider" = accent.base; - "theme.bar.menus.menu.bluetooth.switch.enabled" = accent.base; - "theme.bar.menus.menu.bluetooth.switch.puck" = accent.base; - "theme.bar.menus.menu.bluetooth.text" = foreground; - - "theme.bar.menus.menu.clock.background.color" = background; - "theme.bar.menus.menu.clock.border.color" = accent.base; - "theme.bar.menus.menu.clock.calendar.contextdays" = foreground; - "theme.bar.menus.menu.clock.calendar.currentday" = accent.base; - "theme.bar.menus.menu.clock.calendar.days" = accent.base; - "theme.bar.menus.menu.clock.calendar.paginator" = accent.base; - "theme.bar.menus.menu.clock.calendar.weekdays" = accent.base; - "theme.bar.menus.menu.clock.calendar.yearmonth" = accent.base; - "theme.bar.menus.menu.clock.card.color" = accent.dark; - "theme.bar.menus.menu.clock.text" = foreground; - "theme.bar.menus.menu.clock.time.time" = accent.base; - "theme.bar.menus.menu.clock.time.timeperiod" = accent.base; - "theme.bar.menus.menu.clock.weather.hourly.icon" = accent.base; - "theme.bar.menus.menu.clock.weather.hourly.temperature" = accent.base; - "theme.bar.menus.menu.clock.weather.hourly.time" = accent.base; - "theme.bar.menus.menu.clock.weather.icon" = accent.base; - "theme.bar.menus.menu.clock.weather.stats" = accent.base; - "theme.bar.menus.menu.clock.weather.status" = accent.base; - "theme.bar.menus.menu.clock.weather.temperature" = accent.base; - "theme.bar.menus.menu.clock.weather.thermometer.cold" = accent.base; - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold" = accent.base; - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot" = accent.base; - "theme.bar.menus.menu.clock.weather.thermometer.hot" = accent.base; - "theme.bar.menus.menu.clock.weather.thermometer.moderate" = accent.base; - - "theme.bar.menus.menu.dashboard.background.color" = background; - "theme.bar.menus.menu.dashboard.border.color" = accent.base; - "theme.bar.menus.menu.dashboard.card.color" = accent.dark; - - "theme.bar.menus.menu.dashboard.controls.bluetooth.background" = background; - "theme.bar.menus.menu.dashboard.controls.bluetooth.text" = foreground; - "theme.bar.menus.menu.dashboard.controls.disabled" = accent.base; - "theme.bar.menus.menu.dashboard.controls.input.background" = background; - "theme.bar.menus.menu.dashboard.controls.input.text" = foreground; - "theme.bar.menus.menu.dashboard.controls.notifications.background" = background; - "theme.bar.menus.menu.dashboard.controls.notifications.text" = foreground; - "theme.bar.menus.menu.dashboard.controls.volume.background" = background; - "theme.bar.menus.menu.dashboard.controls.volume.text" = foreground; - "theme.bar.menus.menu.dashboard.controls.wifi.background" = background; - "theme.bar.menus.menu.dashboard.controls.wifi.text" = foreground; - - "theme.bar.menus.menu.dashboard.directories.left.bottom.color" = accent.base; - "theme.bar.menus.menu.dashboard.directories.left.middle.color" = accent.base; - "theme.bar.menus.menu.dashboard.directories.left.top.color" = accent.base; - "theme.bar.menus.menu.dashboard.directories.right.bottom.color" = accent.base; - "theme.bar.menus.menu.dashboard.directories.right.middle.color" = accent.base; - "theme.bar.menus.menu.dashboard.directories.right.top.color" = accent.base; - - "theme.bar.menus.menu.dashboard.monitors.bar_background" = background; - "theme.bar.menus.menu.dashboard.monitors.cpu.bar" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.cpu.icon" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.cpu.label" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.disk.bar" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.disk.icon" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.disk.label" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.gpu.bar" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.gpu.icon" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.gpu.label" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.ram.bar" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.ram.icon" = accent.base; - "theme.bar.menus.menu.dashboard.monitors.ram.label" = accent.base; - - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background" = background; - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text" = foreground; - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card" = accent.dark; - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.logout" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.restart" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.shutdown" = accent.base; - "theme.bar.menus.menu.dashboard.powermenu.sleep" = accent.base; - "theme.bar.menus.menu.dashboard.profile.name" = accent.base; - "theme.bar.menus.menu.dashboard.shortcuts.background" = background; - "theme.bar.menus.menu.dashboard.shortcuts.recording" = accent.base; - "theme.bar.menus.menu.dashboard.shortcuts.text" = foreground; - - "theme.bar.menus.menu.media.album" = accent.base; - "theme.bar.menus.menu.media.artist" = accent.base; - "theme.bar.menus.menu.media.background.color" = "#000000"; - "theme.bar.menus.menu.media.border.color" = accent.base; - "theme.bar.menus.menu.media.buttons.background" = background; - "theme.bar.menus.menu.media.buttons.enabled" = accent.base; - "theme.bar.menus.menu.media.buttons.inactive" = accent.base; - "theme.bar.menus.menu.media.buttons.text" = foreground; - "theme.bar.menus.menu.media.card.color" = accent.dark; - "theme.bar.menus.menu.media.card.tint" = accent.dark; - "theme.bar.menus.menu.media.slider.background" = accent.dark; - "theme.bar.menus.menu.media.slider.backgroundhover" = secondary.dark; - "theme.bar.menus.menu.media.slider.primary" = accent.base; - "theme.bar.menus.menu.media.slider.puck" = accent.bright; - "theme.bar.menus.menu.media.song" = accent.base; - "theme.bar.menus.menu.media.timestamp" = accent.base; - - "theme.bar.menus.menu.network.background.color" = background; - "theme.bar.menus.menu.network.border.color" = accent.base; - "theme.bar.menus.menu.network.card.color" = accent.dark; - "theme.bar.menus.menu.network.iconbuttons.active" = accent.base; - "theme.bar.menus.menu.network.iconbuttons.passive" = accent.base; - "theme.bar.menus.menu.network.icons.active" = accent.base; - "theme.bar.menus.menu.network.icons.passive" = accent.base; - "theme.bar.menus.menu.network.label.color" = accent.base; - "theme.bar.menus.menu.network.listitems.active" = accent.base; - "theme.bar.menus.menu.network.listitems.passive" = accent.base; - "theme.bar.menus.menu.network.scroller.color" = accent.base; - "theme.bar.menus.menu.network.status.color" = accent.base; - "theme.bar.menus.menu.network.switch.disabled" = accent.base; - "theme.bar.menus.menu.network.switch.enabled" = accent.base; - "theme.bar.menus.menu.network.switch.puck" = accent.base; - "theme.bar.menus.menu.network.text" = foreground; - - "theme.bar.menus.menu.notifications.background" = background; - "theme.bar.menus.menu.notifications.border" = accent.base; - "theme.bar.menus.menu.notifications.card" = accent.dark; - "theme.bar.menus.menu.notifications.clear" = accent.base; - "theme.bar.menus.menu.notifications.label" = accent.base; - "theme.bar.menus.menu.notifications.no_notifications_label" = accent.base; - "theme.bar.menus.menu.notifications.pager.background" = background; - "theme.bar.menus.menu.notifications.pager.button" = accent.dark; - "theme.bar.menus.menu.notifications.pager.label" = accent.base; - "theme.bar.menus.menu.notifications.scrollbar.color" = accent.base; - "theme.bar.menus.menu.notifications.switch.disabled" = accent.base; - "theme.bar.menus.menu.notifications.switch_divider" = accent.base; - "theme.bar.menus.menu.notifications.switch.enabled" = accent.base; - "theme.bar.menus.menu.notifications.switch.puck" = accent.base; - - - "theme.bar.menus.menu.power.background.color" = background; - "theme.bar.menus.menu.power.border.color" = accent.base; - - "theme.bar.menus.menu.power.buttons.logout.background" = background; - "theme.bar.menus.menu.power.buttons.logout.icon_background" = background; - "theme.bar.menus.menu.power.buttons.logout.icon" = accent.base; - "theme.bar.menus.menu.power.buttons.logout.text" = foreground; - - "theme.bar.menus.menu.power.buttons.restart.background" = background; - "theme.bar.menus.menu.power.buttons.restart.icon_background" = background; - "theme.bar.menus.menu.power.buttons.restart.icon" = accent.base; - "theme.bar.menus.menu.power.buttons.restart.text" = foreground; - - "theme.bar.menus.menu.power.buttons.shutdown.background" = background; - "theme.bar.menus.menu.power.buttons.shutdown.icon_background" = background; - "theme.bar.menus.menu.power.buttons.shutdown.icon" = accent.base; - "theme.bar.menus.menu.power.buttons.shutdown.text" = foreground; - - "theme.bar.menus.menu.power.buttons.sleep.background" = background; - "theme.bar.menus.menu.power.buttons.sleep.icon_background" = background; - "theme.bar.menus.menu.power.buttons.sleep.icon" = accent.base; - "theme.bar.menus.menu.power.buttons.sleep.text" = foreground; - - - "theme.bar.menus.menu.systray.dropdownmenu.background" = background; - "theme.bar.menus.menu.systray.dropdownmenu.divider" = accent.base; - "theme.bar.menus.menu.systray.dropdownmenu.text" = foreground; - - "theme.bar.menus.menu.volume.audio_slider.background" = background; - "theme.bar.menus.menu.volume.audio_slider.backgroundhover" = background; - "theme.bar.menus.menu.volume.audio_slider.primary" = accent.base; - "theme.bar.menus.menu.volume.audio_slider.puck" = accent.base; - "theme.bar.menus.menu.volume.background.color" = background; - "theme.bar.menus.menu.volume.border.color" = accent.base; - "theme.bar.menus.menu.volume.card.color" = accent.dark; - "theme.bar.menus.menu.volume.iconbutton.active" = accent.base; - "theme.bar.menus.menu.volume.iconbutton.passive" = accent.base; - "theme.bar.menus.menu.volume.input_slider.background" = background; - "theme.bar.menus.menu.volume.input_slider.backgroundhover" = background; - "theme.bar.menus.menu.volume.input_slider.primary" = accent.base; - "theme.bar.menus.menu.volume.input_slider.puck" = accent.base; - "theme.bar.menus.menu.volume.label.color" = accent.base; - "theme.bar.menus.menu.volume.listitems.active" = accent.base; - "theme.bar.menus.menu.volume.listitems.passive" = accent.base; - "theme.bar.menus.menu.volume.text" = foreground; - - "theme.bar.menus.monochrome" = false; - - "theme.bar.opacity" = t; - "theme.bar.outer_spacing" = "0em"; - "theme.bar.transparent" = false; - - "theme.font.name" = rice.font.code.name; - "theme.font.size" = "12px"; - - "theme.notification.actions.background" = background; - "theme.notification.actions.text" = foreground; - "theme.notification.background" = background; - "theme.notification.border" = accent.base; - "theme.notification.close_button.background" = accent.dark; - "theme.notification.close_button.label" = accent.base; - "theme.notification.label" = accent.base; - "theme.notification.labelicon" = accent.base; - "theme.notification.opacity" = 1.0; - "theme.notification.text" = foreground; - "theme.notification.time" = accent.base; - - "theme.osd.bar_color" = accent.base; - "theme.osd.bar_container" = accent.dark; - "theme.osd.bar_empty_color" = accent.dark; - "theme.osd.bar_overflow_color" = accent.base; - "theme.osd.border.color" = border; - "theme.osd.icon_container" = secondary.dark; - "theme.osd.icon" = secondary.bright; - "theme.osd.label" = accent.bright; - "theme.osd.opacity" = t; - }; - }; - }; } diff --git a/home-modules/bar/caldav-event.nix b/home-modules/bar/caldav-event.nix new file mode 100644 index 0000000..f8cefbc --- /dev/null +++ b/home-modules/bar/caldav-event.nix @@ -0,0 +1,126 @@ +{ pkgs, ... }@all: with all; { + sops.secrets = { + "nx2site/radicale/password" = { }; + }; + home.packages = [ + (pkgs.writers.writePython3Bin "caldav_event" { + libraries = with pkgs.python3Packages; [ caldav ics pytz ]; + flakeIgnore = [ "E302" "E305" "E501" "E261" ]; + } /* python */ '' +import os +import json +from caldav import DAVClient +from datetime import datetime, timezone +from ics import Calendar +from pytz import UTC + +def get_password(password_file): + with open(password_file, "r") as file: + return file.read().strip() + +def datetime_converter(obj): + if isinstance(obj, datetime): + return obj.isoformat() + return obj + +def datetime_parser(dct): + for key, value in dct.items(): + if isinstance(value, str): + try: + dct[key] = datetime.fromisoformat(value) + except ValueError: + pass + return dct + +def load_cache(cache_file): + if os.path.exists(cache_file): + with open(cache_file, "r") as file: + return json.load(file, object_hook=datetime_parser) + return None + +def save_cache(cache_file, data): + with open(cache_file, "w") as file: + json.dump(data, file, default=datetime_converter, indent=4) + + +def get_ongoing_or_next_event(url, username, password): + now = datetime.now(timezone.utc) + + try: + client = DAVClient(url, username=username, password=password) + principal = client.principal() + calendars = principal.calendars() + + next_event_dict = { + 'event_name': "fake", + 'event_begin': datetime(9000, 1, 1, tzinfo=UTC), # in the year 9000 + 'event_end': datetime(9000, 1, 1, 8, tzinfo=UTC), + } + + for calendar in calendars: + for event in calendar.search(start=now): + calendar_parsed = Calendar(event.data) + for ics_event in calendar_parsed.events: + event_dict = {} + event_dict['event_name'] = ics_event.name or "(No Title)" + event_dict['event_begin'] = ics_event.begin.astimezone(timezone.utc) + event_dict['event_end'] = ics_event.end.astimezone(timezone.utc) + + if event_dict['event_begin'] <= now and now <= event_dict['event_end']: + return event_dict + elif event_dict['event_begin'] >= now and next_event_dict['event_begin'] > event_dict['event_begin']: + next_event_dict = event_dict + return next_event_dict + + except Exception as e: + print(f"Error accessing {url}: {e}") + return None + +def is_expired(event_dict: dict): + now = datetime.now(timezone.utc).timestamp() + event_end = event_dict['event_end'].timestamp() + return not (now <= event_end) + +if __name__ == "__main__": + password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file + cache_file = "/tmp/caldav_event_cache.json" # Path to cache file + url = "https://dav.${hyper.domain}/" + username = "nx2" + password = get_password(password_file) + now = datetime.now(timezone.utc).timestamp() + + event_dict = load_cache(cache_file) + + if (event_dict is None) or (is_expired(event_dict)): + event_dict = get_ongoing_or_next_event(url, username, password) + save_cache(cache_file, event_dict) + + if event_dict is None: # none were found + print("* zen *") + exit(0) + + event_start = event_dict['event_begin'].timestamp() + event_end = event_dict['event_end'].timestamp() + + if event_start <= now <= event_end: # is currently ongoing + action_string = "ends" + t = event_end - now # time_remaining + else: # is in the future + action_string = "starts" + t = event_start - now # time_remaining + + hours, rem = divmod(int(t), 3600) + minutes, _ = divmod(rem, 60) + hour_string = f"{hours} hour{'s ' if hours != 1 else ' '}" if hours > 0 else "" + minu_string = f"{minutes} minute{'s ' if minutes != 1 else ' '}" if minutes > 0 else "" + if hour_string == "" and minu_string == "": + time_string = "now" + elif hour_string == "" or minu_string == "": + time_string = "in " + hour_string + minu_string + else: + time_string = "in " + hour_string + "and " + minu_string + + print(f"{event_dict['event_name']} {action_string} {time_string}") +'') + ]; +} diff --git a/home-modules/bar/cclock.nix b/home-modules/bar/cclock.nix new file mode 100644 index 0000000..ce2ab53 --- /dev/null +++ b/home-modules/bar/cclock.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: let + sep = " "; +in { + home.packages = [ + (pkgs.writeShellApplication { name = "cclock"; text = /* bash */ '' + ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}') + if [ $# -eq 0 ]; then + echo "󰃮${sep}$(date +'%A the')" "$ord" "of" "$(date +'%B')" " ${sep}$(date +'%R')" + elif [ "$1" = "--no-icons" ]; then + echo "$(date +'%A the')" "$ord" "of" "$(date +'%B')" "$(date +'%R')" + fi + '';}) + ]; +} diff --git a/home-modules/bar/hyprpanel.nix b/home-modules/bar/hyprpanel.nix new file mode 100644 index 0000000..809af55 --- /dev/null +++ b/home-modules/bar/hyprpanel.nix @@ -0,0 +1,512 @@ +{ pkgs, ... }@all: with all; { + xdg.configFile = { + "hyprpanel/modules.scss".text = with rice.color; /* scss */ '' + @include styleModule('cmodule-cclock', ( + 'text-color': ${accent.base}, + /* 'icon-color': , */ + /* 'icon-background': , */ + /* 'label-background': #242438, */ + /* 'inner-spacing': 0.5em, */ + /* 'border-enabled': false, */ + /* 'border-color': #cba6f7, */ + /* 'icon-size': 1.2em */ + )); + @include styleModule('cmodule-caldav_event', ( + 'text-color': ${accent.base}, + )); + ''; + "hyprpanel/modules.json".text = builtins.toJSON { + "custom/cclock" = { + execute = "cclock"; + executeOnAction = ""; + label = "{}"; + interval = 60000; + hideOnEmpty = true; + actions.onLeftClick = "menu:calendar"; + }; + "custom/caldav_evnet" = { + execute = "caldav_event"; + executeOnAction = ""; + label = "{}"; + interval = 60000; + hideOnEmpty = true; + actions = {}; + }; + }; + }; + programs.hyprpanel = { + enable = true; + package = pkgs.unstable.hyprpanel; + settings = with rice.color; let + t = builtins.toString (builtins.ceil (rice.transparency * 100)); + in { + "bar.layouts" = { + "*" = { + "left" = [ + "volume" + # "microphone" + # "cpu" + # "cputemp" + # "ram" + "battery" + # "bluetooth" + "network" + "windowtitle" + ]; + "middle" = [ "workspaces" ]; + "right" = [ + "submap" + "custom/caldav_event" + "media" + "custom/cclock" + "notifications" + "systray" + ]; + }; + }; + + "bar.bluetooth.label" = true; + + "bar.customModules.submap.enabledIcon" = "[󰧹]"; + "bar.customModules.submap.showSubmapName" = false; + "bar.customModules.submap.label" = false; + "bar.customModules.submap.icon" = true; + "bar.customModules.submap.disabledIcon" = ""; + + "bar.workspaces.applicationIconEmptyWorkspace" = ""; + "bar.workspaces.applicationIconOncePerWorkspace" = false; + "bar.workspaces.numbered_active_indicator" = "underline"; + "bar.workspaces.scroll_speed" = 1; + "bar.workspaces.showAllActive" = false; + "bar.workspaces.showApplicationIcons" = true; + "bar.workspaces.show_icons" = false; + "bar.workspaces.show_numbered" = false; + "bar.workspaces.showWsIcons" = true; + "bar.workspaces.spacing" = 1; + "bar.workspaces.workspaceMask" = true; + "bar.workspaces.workspaces" = 5; + + "theme.bar.background" = background; + "theme.bar.border.color" = accent.base; + "theme.bar.border_radius" = "0.2em"; + + "theme.bar.buttons.background" = background; + "theme.bar.buttons.background_opacity" = 0; + "theme.bar.buttons.spacing" = "0em"; + "theme.bar.buttons.padding_x" = "0.5rem"; + + "theme.bar.buttons.battery.background" = background; + "theme.bar.buttons.battery.border" = accent.base; + "theme.bar.buttons.battery.icon_background" = background; + "theme.bar.buttons.battery.icon" = accent.base; + "theme.bar.buttons.battery.text" = accent.base; + + "theme.bar.buttons.bluetooth.background" = background; + "theme.bar.buttons.bluetooth.border" = accent.base; + "theme.bar.buttons.bluetooth.icon_background" = background; + "theme.bar.buttons.bluetooth.icon" = accent.base; + "theme.bar.buttons.bluetooth.text" = accent.base; + + "theme.bar.buttons.borderColor" = accent.base; + + "theme.bar.buttons.clock.background" = background; + "theme.bar.buttons.clock.border" = accent.base; + "theme.bar.buttons.clock.icon_background" = background; + "theme.bar.buttons.clock.icon" = accent.base; + "theme.bar.buttons.clock.text" = accent.base; + + "theme.bar.buttons.dashboard.background" = background; + "theme.bar.buttons.dashboard.border" = accent.base; + "theme.bar.buttons.dashboard.icon" = accent.base; + "theme.bar.buttons.icon_background" = background; + + "theme.bar.buttons.icon" = accent.base; + + "theme.bar.buttons.media.background" = background; + "theme.bar.buttons.media.border" = accent.base; + "theme.bar.buttons.media.icon_background" = background; + "theme.bar.buttons.media.icon" = accent.base; + "theme.bar.buttons.media.text" = accent.base; + + "theme.bar.buttons.modules.cava.background" = background; + "theme.bar.buttons.modules.cava.border" = accent.base; + "theme.bar.buttons.modules.cava.icon_background" = background; + "theme.bar.buttons.modules.cava.icon" = accent.base; + "theme.bar.buttons.modules.cava.text" = accent.base; + + "theme.bar.buttons.modules.cpu.background" = background; + "theme.bar.buttons.modules.cpu.border" = accent.base; + "theme.bar.buttons.modules.cpu.icon_background" = background; + "theme.bar.buttons.modules.cpu.icon" = accent.base; + "theme.bar.buttons.modules.cpu.text" = accent.base; + + "theme.bar.buttons.modules.cpuTemp.background" = background; + "theme.bar.buttons.modules.cpuTemp.border" = accent.base; + "theme.bar.buttons.modules.cpuTemp.icon_background" = background; + "theme.bar.buttons.modules.cpuTemp.icon" = accent.base; + "theme.bar.buttons.modules.cpuTemp.text" = accent.base; + + "theme.bar.buttons.modules.hypridle.background" = background; + "theme.bar.buttons.modules.hypridle.border" = accent.base; + "theme.bar.buttons.modules.hypridle.icon_background" = background; + "theme.bar.buttons.modules.hypridle.icon" = accent.base; + "theme.bar.buttons.modules.hypridle.text" = accent.base; + + "theme.bar.buttons.modules.hyprsunset.background" = background; + "theme.bar.buttons.modules.hyprsunset.border" = accent.base; + "theme.bar.buttons.modules.hyprsunset.icon_background" = background; + "theme.bar.buttons.modules.hyprsunset.icon" = accent.base; + "theme.bar.buttons.modules.hyprsunset.text" = accent.base; + + "theme.bar.buttons.modules.kbLayout.background" = background; + "theme.bar.buttons.modules.kbLayout.border" = accent.base; + "theme.bar.buttons.modules.kbLayout.icon_background" = background; + "theme.bar.buttons.modules.kbLayout.icon" = accent.base; + "theme.bar.buttons.modules.kbLayout.text" = accent.base; + + "theme.bar.buttons.modules.microphone.background" = background; + "theme.bar.buttons.modules.microphone.border" = accent.base; + "theme.bar.buttons.modules.microphone.icon_background" = background; + "theme.bar.buttons.modules.microphone.icon" = accent.base; + "theme.bar.buttons.modules.microphone.text" = accent.base; + + "theme.bar.buttons.modules.netstat.background" = background; + "theme.bar.buttons.modules.netstat.border" = accent.base; + "theme.bar.buttons.modules.netstat.icon_background" = background; + "theme.bar.buttons.modules.netstat.icon" = accent.base; + "theme.bar.buttons.modules.netstat.text" = accent.base; + + "theme.bar.buttons.modules.power.background" = background; + "theme.bar.buttons.modules.power.border" = accent.base; + "theme.bar.buttons.modules.power.icon_background" = background; + "theme.bar.buttons.modules.power.icon" = accent.base; + + "theme.bar.buttons.modules.ram.background" = background; + "theme.bar.buttons.modules.ram.border" = accent.base; + "theme.bar.buttons.modules.ram.icon_background" = background; + "theme.bar.buttons.modules.ram.icon" = accent.base; + "theme.bar.buttons.modules.ram.text" = accent.base; + + "theme.bar.buttons.modules.storage.background" = background; + "theme.bar.buttons.modules.storage.border" = accent.base; + "theme.bar.buttons.modules.storage.icon_background" = background; + "theme.bar.buttons.modules.storage.icon" = accent.base; + "theme.bar.buttons.modules.storage.text" = accent.base; + + "theme.bar.buttons.modules.submap.background" = background; + "theme.bar.buttons.modules.submap.border" = accent.base; + "theme.bar.buttons.modules.submap.icon_background" = background; + "theme.bar.buttons.modules.submap.icon" = accent.base; + "theme.bar.buttons.modules.submap.text" = special.base; + + "theme.bar.buttons.modules.updates.background" = background; + "theme.bar.buttons.modules.updates.border" = accent.base; + "theme.bar.buttons.modules.updates.icon_background" = background; + "theme.bar.buttons.modules.updates.icon" = accent.base; + "theme.bar.buttons.modules.updates.text" = accent.base; + + "theme.bar.buttons.modules.weather.background" = background; + "theme.bar.buttons.modules.weather.border" = accent.base; + "theme.bar.buttons.modules.weather.icon_background" = background; + "theme.bar.buttons.modules.weather.icon" = accent.base; + "theme.bar.buttons.modules.weather.text" = accent.base; + + "theme.bar.buttons.modules.worldclock.background" = background; + "theme.bar.buttons.modules.worldclock.border" = accent.base; + "theme.bar.buttons.modules.worldclock.icon_background" = background; + "theme.bar.buttons.modules.worldclock.icon" = accent.base; + "theme.bar.buttons.modules.worldclock.text" = accent.base; + "theme.bar.buttons.monochrome" = false; + + "theme.bar.buttons.network.background" = background; + "theme.bar.buttons.network.border" = accent.base; + "theme.bar.buttons.network.icon_background" = background; + "theme.bar.buttons.network.icon" = accent.base; + "theme.bar.buttons.network.text" = accent.base; + + "theme.bar.buttons.notifications.background" = background; + "theme.bar.buttons.notifications.border" = accent.base; + "theme.bar.buttons.notifications.icon_background" = background; + "theme.bar.buttons.notifications.icon" = accent.base; + "theme.bar.buttons.notifications.total" = accent.base; + + "theme.bar.buttons.opacity" = t; + + "theme.bar.buttons.separator.color" = accent.base; + + "theme.bar.buttons.style" = "default"; + + "theme.bar.buttons.systray.background" = background; + "theme.bar.buttons.systray.border" = accent.base; + "theme.bar.buttons.systray.customIcon" = accent.base; + + "theme.bar.buttons.text" = accent.base; + + "theme.bar.buttons.volume.background" = background; + "theme.bar.buttons.volume.border" = accent.base; + "theme.bar.buttons.volume.icon_background" = background; + "theme.bar.buttons.volume.icon" = accent.base; + "theme.bar.buttons.volume.text" = accent.base; + + "theme.bar.buttons.windowtitle.background" = background; + "theme.bar.buttons.windowtitle.border" = secondary.base; + "theme.bar.buttons.windowtitle.icon_background" = background; + "theme.bar.buttons.windowtitle.icon" = secondary.base; + "theme.bar.buttons.windowtitle.text" = secondary.base; + + "theme.bar.buttons.workspaces.active" = accent.bright; + "theme.bar.buttons.workspaces.available" = accent.base; + "theme.bar.buttons.workspaces.background" = background; + "theme.bar.buttons.workspaces.border" = accent.base; + "theme.bar.buttons.workspaces.hover" = foreground; + "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color" = accent.base; + "theme.bar.buttons.workspaces.numbered_active_highlight_padding" = "0.2em"; + "theme.bar.buttons.workspaces.numbered_active_underline_color" = accent.bright; + "theme.bar.buttons.workspaces.numbered_inactive_padding" = "0.2em"; + "theme.bar.buttons.workspaces.occupied" = secondary.base; + "theme.bar.buttons.workspaces.pill.width" = "4em"; + "theme.bar.buttons.workspaces.smartHighlight" = true; + "theme.bar.buttons.y_margins" = "0em"; + + "theme.bar.location" = "bottom"; + + "theme.bar.menus.menu.battery.background.color" = background; + "theme.bar.menus.menu.battery.border.color" = accent.base; + "theme.bar.menus.menu.battery.card.color" = accent.dark; + "theme.bar.menus.menu.battery.icons.active" = accent.base; + "theme.bar.menus.menu.battery.icons.passive" = accent.base; + "theme.bar.menus.menu.battery.label.color" = accent.base; + "theme.bar.menus.menu.battery.listitems.active" = accent.base; + "theme.bar.menus.menu.battery.listitems.passive" = accent.base; + "theme.bar.menus.menu.battery.slider.background" = background; + "theme.bar.menus.menu.battery.slider.backgroundhover" = background; + "theme.bar.menus.menu.battery.slider.primary" = accent.base; + "theme.bar.menus.menu.battery.slider.puck" = accent.base; + "theme.bar.menus.menu.battery.text" = foreground; + + "theme.bar.menus.menu.bluetooth.background.color" = background; + "theme.bar.menus.menu.bluetooth.border.color" = accent.base; + "theme.bar.menus.menu.bluetooth.card.color" = accent.dark; + "theme.bar.menus.menu.bluetooth.iconbutton.active" = accent.base; + "theme.bar.menus.menu.bluetooth.iconbutton.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.icons.active" = accent.base; + "theme.bar.menus.menu.bluetooth.icons.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.label.color" = accent.base; + "theme.bar.menus.menu.bluetooth.listitems.active" = accent.base; + "theme.bar.menus.menu.bluetooth.listitems.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.scroller.color" = accent.base; + "theme.bar.menus.menu.bluetooth.status" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.disabled" = accent.base; + "theme.bar.menus.menu.bluetooth.switch_divider" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.enabled" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.puck" = accent.base; + "theme.bar.menus.menu.bluetooth.text" = foreground; + + "theme.bar.menus.menu.clock.background.color" = background; + "theme.bar.menus.menu.clock.border.color" = accent.base; + "theme.bar.menus.menu.clock.calendar.contextdays" = foreground; + "theme.bar.menus.menu.clock.calendar.currentday" = accent.base; + "theme.bar.menus.menu.clock.calendar.days" = accent.base; + "theme.bar.menus.menu.clock.calendar.paginator" = accent.base; + "theme.bar.menus.menu.clock.calendar.weekdays" = accent.base; + "theme.bar.menus.menu.clock.calendar.yearmonth" = accent.base; + "theme.bar.menus.menu.clock.card.color" = accent.dark; + "theme.bar.menus.menu.clock.text" = foreground; + "theme.bar.menus.menu.clock.time.time" = accent.base; + "theme.bar.menus.menu.clock.time.timeperiod" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.icon" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.temperature" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.time" = accent.base; + "theme.bar.menus.menu.clock.weather.icon" = accent.base; + "theme.bar.menus.menu.clock.weather.stats" = accent.base; + "theme.bar.menus.menu.clock.weather.status" = accent.base; + "theme.bar.menus.menu.clock.weather.temperature" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.cold" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.extremelycold" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.hot" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.moderate" = accent.base; + + "theme.bar.menus.menu.dashboard.background.color" = background; + "theme.bar.menus.menu.dashboard.border.color" = accent.base; + "theme.bar.menus.menu.dashboard.card.color" = accent.dark; + + "theme.bar.menus.menu.dashboard.controls.bluetooth.background" = background; + "theme.bar.menus.menu.dashboard.controls.bluetooth.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.disabled" = accent.base; + "theme.bar.menus.menu.dashboard.controls.input.background" = background; + "theme.bar.menus.menu.dashboard.controls.input.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.notifications.background" = background; + "theme.bar.menus.menu.dashboard.controls.notifications.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.volume.background" = background; + "theme.bar.menus.menu.dashboard.controls.volume.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.wifi.background" = background; + "theme.bar.menus.menu.dashboard.controls.wifi.text" = foreground; + + "theme.bar.menus.menu.dashboard.directories.left.bottom.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.left.middle.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.left.top.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.bottom.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.middle.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.top.color" = accent.base; + + "theme.bar.menus.menu.dashboard.monitors.bar_background" = background; + "theme.bar.menus.menu.dashboard.monitors.cpu.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.cpu.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.cpu.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.label" = accent.base; + + "theme.bar.menus.menu.dashboard.powermenu.confirmation.background" = background; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.body" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.border" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text" = foreground; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.card" = accent.dark; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.label" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.logout" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.restart" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.shutdown" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.sleep" = accent.base; + "theme.bar.menus.menu.dashboard.profile.name" = accent.base; + "theme.bar.menus.menu.dashboard.shortcuts.background" = background; + "theme.bar.menus.menu.dashboard.shortcuts.recording" = accent.base; + "theme.bar.menus.menu.dashboard.shortcuts.text" = foreground; + + "theme.bar.menus.menu.media.album" = accent.base; + "theme.bar.menus.menu.media.artist" = accent.base; + "theme.bar.menus.menu.media.background.color" = "#000000"; + "theme.bar.menus.menu.media.border.color" = accent.base; + "theme.bar.menus.menu.media.buttons.background" = background; + "theme.bar.menus.menu.media.buttons.enabled" = accent.base; + "theme.bar.menus.menu.media.buttons.inactive" = accent.base; + "theme.bar.menus.menu.media.buttons.text" = foreground; + "theme.bar.menus.menu.media.card.color" = accent.dark; + "theme.bar.menus.menu.media.card.tint" = accent.dark; + "theme.bar.menus.menu.media.slider.background" = accent.dark; + "theme.bar.menus.menu.media.slider.backgroundhover" = secondary.dark; + "theme.bar.menus.menu.media.slider.primary" = accent.base; + "theme.bar.menus.menu.media.slider.puck" = accent.bright; + "theme.bar.menus.menu.media.song" = accent.base; + "theme.bar.menus.menu.media.timestamp" = accent.base; + + "theme.bar.menus.menu.network.background.color" = background; + "theme.bar.menus.menu.network.border.color" = accent.base; + "theme.bar.menus.menu.network.card.color" = accent.dark; + "theme.bar.menus.menu.network.iconbuttons.active" = accent.base; + "theme.bar.menus.menu.network.iconbuttons.passive" = accent.base; + "theme.bar.menus.menu.network.icons.active" = accent.base; + "theme.bar.menus.menu.network.icons.passive" = accent.base; + "theme.bar.menus.menu.network.label.color" = accent.base; + "theme.bar.menus.menu.network.listitems.active" = accent.base; + "theme.bar.menus.menu.network.listitems.passive" = accent.base; + "theme.bar.menus.menu.network.scroller.color" = accent.base; + "theme.bar.menus.menu.network.status.color" = accent.base; + "theme.bar.menus.menu.network.switch.disabled" = accent.base; + "theme.bar.menus.menu.network.switch.enabled" = accent.base; + "theme.bar.menus.menu.network.switch.puck" = accent.base; + "theme.bar.menus.menu.network.text" = foreground; + + "theme.bar.menus.menu.notifications.background" = background; + "theme.bar.menus.menu.notifications.border" = accent.base; + "theme.bar.menus.menu.notifications.card" = accent.dark; + "theme.bar.menus.menu.notifications.clear" = accent.base; + "theme.bar.menus.menu.notifications.label" = accent.base; + "theme.bar.menus.menu.notifications.no_notifications_label" = accent.base; + "theme.bar.menus.menu.notifications.pager.background" = background; + "theme.bar.menus.menu.notifications.pager.button" = accent.dark; + "theme.bar.menus.menu.notifications.pager.label" = accent.base; + "theme.bar.menus.menu.notifications.scrollbar.color" = accent.base; + "theme.bar.menus.menu.notifications.switch.disabled" = accent.base; + "theme.bar.menus.menu.notifications.switch_divider" = accent.base; + "theme.bar.menus.menu.notifications.switch.enabled" = accent.base; + "theme.bar.menus.menu.notifications.switch.puck" = accent.base; + + + "theme.bar.menus.menu.power.background.color" = background; + "theme.bar.menus.menu.power.border.color" = accent.base; + + "theme.bar.menus.menu.power.buttons.logout.background" = background; + "theme.bar.menus.menu.power.buttons.logout.icon_background" = background; + "theme.bar.menus.menu.power.buttons.logout.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.logout.text" = foreground; + + "theme.bar.menus.menu.power.buttons.restart.background" = background; + "theme.bar.menus.menu.power.buttons.restart.icon_background" = background; + "theme.bar.menus.menu.power.buttons.restart.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.restart.text" = foreground; + + "theme.bar.menus.menu.power.buttons.shutdown.background" = background; + "theme.bar.menus.menu.power.buttons.shutdown.icon_background" = background; + "theme.bar.menus.menu.power.buttons.shutdown.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.shutdown.text" = foreground; + + "theme.bar.menus.menu.power.buttons.sleep.background" = background; + "theme.bar.menus.menu.power.buttons.sleep.icon_background" = background; + "theme.bar.menus.menu.power.buttons.sleep.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.sleep.text" = foreground; + + + "theme.bar.menus.menu.systray.dropdownmenu.background" = background; + "theme.bar.menus.menu.systray.dropdownmenu.divider" = accent.base; + "theme.bar.menus.menu.systray.dropdownmenu.text" = foreground; + + "theme.bar.menus.menu.volume.audio_slider.background" = background; + "theme.bar.menus.menu.volume.audio_slider.backgroundhover" = background; + "theme.bar.menus.menu.volume.audio_slider.primary" = accent.base; + "theme.bar.menus.menu.volume.audio_slider.puck" = accent.base; + "theme.bar.menus.menu.volume.background.color" = background; + "theme.bar.menus.menu.volume.border.color" = accent.base; + "theme.bar.menus.menu.volume.card.color" = accent.dark; + "theme.bar.menus.menu.volume.iconbutton.active" = accent.base; + "theme.bar.menus.menu.volume.iconbutton.passive" = accent.base; + "theme.bar.menus.menu.volume.input_slider.background" = background; + "theme.bar.menus.menu.volume.input_slider.backgroundhover" = background; + "theme.bar.menus.menu.volume.input_slider.primary" = accent.base; + "theme.bar.menus.menu.volume.input_slider.puck" = accent.base; + "theme.bar.menus.menu.volume.label.color" = accent.base; + "theme.bar.menus.menu.volume.listitems.active" = accent.base; + "theme.bar.menus.menu.volume.listitems.passive" = accent.base; + "theme.bar.menus.menu.volume.text" = foreground; + + "theme.bar.menus.monochrome" = false; + + "theme.bar.opacity" = t; + "theme.bar.outer_spacing" = "0em"; + "theme.bar.transparent" = false; + + "theme.font.name" = rice.font.code.name; + "theme.font.size" = "12px"; + + "theme.notification.actions.background" = background; + "theme.notification.actions.text" = foreground; + "theme.notification.background" = background; + "theme.notification.border" = accent.base; + "theme.notification.close_button.background" = accent.dark; + "theme.notification.close_button.label" = accent.base; + "theme.notification.label" = accent.base; + "theme.notification.labelicon" = accent.base; + "theme.notification.opacity" = 1.0; + "theme.notification.text" = foreground; + "theme.notification.time" = accent.base; + + "theme.osd.bar_color" = accent.base; + "theme.osd.bar_container" = accent.dark; + "theme.osd.bar_empty_color" = accent.dark; + "theme.osd.bar_overflow_color" = accent.base; + "theme.osd.border.color" = border; + "theme.osd.icon_container" = secondary.dark; + "theme.osd.icon" = secondary.bright; + "theme.osd.label" = accent.bright; + "theme.osd.opacity" = t; + }; + }; +} diff --git a/home-modules/bar/submap-indicator.nix b/home-modules/bar/submap-indicator.nix new file mode 100644 index 0000000..d79b2b3 --- /dev/null +++ b/home-modules/bar/submap-indicator.nix @@ -0,0 +1,37 @@ +{ pkgs, ... }: { + home.packages = [ + (pkgs.writeShellApplication { name = "submap_indicator"; text = /*bash*/ '' + print_help() { + echo "Usage: submap_indicator {set |unset}" + } + if [ $# -lt 1 ]; then + print_help; exit 1; + fi + case "$1" in + set) + # Check if there is a second argument for the 'set' operation + if [ $# -eq 2 ]; then + echo "$2" > /tmp/submap-indictor + pkill -RTMIN+8 waybar + pkill -RTMIN+8 hyprpanel + else + echo "Error: 'set' operation requires exactly one string argument." + print_help + exit 1 + fi + ;; + unset) + echo "" > /tmp/submap-indictor + pkill -RTMIN+8 waybar + pkill -RTMIN+8 hyprpanel + ;; + *) + echo "Error: Unknown command '$1'" + print_help + exit 1 + ;; + esac + exit 0 + '';}) + ]; +} diff --git a/home-modules/bar/waybar.nix b/home-modules/bar/waybar.nix new file mode 100644 index 0000000..52b91c9 --- /dev/null +++ b/home-modules/bar/waybar.nix @@ -0,0 +1,165 @@ +{ pkgs, ... }@all: with all; let + sep = " "; +in { + programs.waybar = { + enable = false; + package = pkgs.waybar; + settings = { + bar = { + # height = 20; + layer = "top"; + position = "bottom"; + margin-top = 0; + # margin-left = rice.gap-size; + # margin-bottom = rice.gap-size; + # margin-right = rice.gap-size; + margin-left = 0; + margin-bottom = 0; + margin-right = 0; + spacing = 10; + fixed-center = true; + modules-left = [ + # "cpu" + # "memory" + "wireplumber" + "backlight" + "battery" + "network" + "hyprland/window" + ]; + modules-center = [ + "hyprland/workspaces" + ]; + modules-right = [ + "custom/mode" + "custom/caldav_event" + "custom/cclock" + "tray" + ]; + "hyprland/workspaces" = { + on-click = "activate"; + format = "{name}"; + all-outputs = false; + active-only = false; + }; + "hyprland/window" = { + # format = "${sep}{}"; + format = "{}"; + separate-outputs = true; + }; + "custom/cclock" = { + exec = "cclock"; + restart-interval = 60; + }; + "custom/caldav_event" = { + format = "󰃰${sep}{}"; + exec = "caldav_event"; + restart-interval = 60; + max-width = 60; + }; + "custom/mode" = { + exec = "cat /tmp/submap-indictor"; + interval = "once"; + signal = 8; + }; + + cpu = { + interval = 1; + format = "󰍛${sep}{}%"; + max-length = 10; + }; + memory = { + interval = 5; + format = "${sep}{avail:.0f}G free"; + }; + battery = { + interval = 60; + tooltip = false; + format = "{icon}${sep}{capacity}%"; + states = { + warning = 15; + critical = 5; + }; + format-icons = [ " " " " " " " " " " ]; + format-charging = "{icon}${sep}+{capacity}%"; + format-plugged = "{icon}${sep}P{capacity}%"; + format-full = "{icon}${sep}F{capacity}%"; + }; + backlight = { + device = "eDP-1"; + format = "{icon}${sep}{percent}%"; + format-icons = [ "" "" "" "" "" "" "" "" "" ]; + }; + network = { + format-wifi = "${sep}{essid}"; + format-ethernet = "󰈀${sep}Wired"; + format-disconnected = "󰌙${sep}Disconnected"; + }; + wireplumber = { + format = "󰕾${sep}{volume}%"; + format-muted = "󰝟${sep}--%"; + }; + }; + }; + style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ '' + * { + font-family: ${rice.font.code.name}; + font-size: 1em; + min-height: 0px; + margin: 0px; + padding: 0px; + } + + window#waybar { + background: rgba(${f background},${builtins.toString rice.transparency}); + } + + #clock, + #custom-cclock, + #custom-mode, + #custom-caldav-event, + #battery, + #cpu, + #tray, + #disk, + #backlight, + #network, + #wireplumber, + #memory, + #window, + #workspaces { + padding: 0px 3px; + margin-top: 0.3em; + border-radius: ${builtins.toString rice.rounding}px; + color: rgb(${f accent.bright}); + } + + #workspaces button { + color: rgb(${f accent.base}); + padding-left: 15px; + padding-right: 15px; + border-radius: ${builtins.toString rice.rounding}px; + } + #workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); } + #workspaces button:hover { color: rgb(${f tertiary.bright}); } + #workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); } + + #window, #custom-caldav_event { + font-family: ${rice.font.base.name}, ${rice.font.code.name}; + color: rgb(${f tertiary.bright}); + } + + #wireplumber.muted { color: rgb(${f tertiary.bright}); } + #wireplumber { padding-left: 10px; } + + #battery.warning:not(.charging) { color: rgb(${f green.base});; } + #battery.charging { color: rgb(${f green.base}); } + #battery.critical { + background: rgb(${f negative.base}); + color: rgb(${f foreground}); + } + + #custom-mode { color: rgb(${f red.base}); } + ''; + }; +} From 1191019cf813675b4b28b20a72d3e0159ba21f85 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 25 Aug 2025 13:34:38 +0200 Subject: [PATCH 14/15] rclone --- home-modules/rclone.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/home-modules/rclone.nix b/home-modules/rclone.nix index 04dd205..fee8dfc 100644 --- a/home-modules/rclone.nix +++ b/home-modules/rclone.nix @@ -1,6 +1,6 @@ { pkgs, ... }@all: with all; { home.packages = with pkgs; [ rclone ]; - sops.secrets."copyparty/user-password/${hyper.user}".path = "%r/secrets/copyparty/user-password/${hyper.user}"; + sops.secrets."nx2site/copyparty/user-password/${hyper.user}".path = "%r/secrets/copyparty/user-password/${hyper.user}"; programs.rclone = { enable = true; package = pkgs.rclone; @@ -11,18 +11,20 @@ vendor = "owncloud"; # copyparty url = "https://file.${hyper.domain}/"; user = hyper.user; + pacer_min_sleep = "0.01ms"; }; mounts = { "" = { enable = true; - mountPoints = "${hyper.home}/file.nx2.site/"; + mountPoint = "${hyper.home}/file.nx2.site/"; options = { - vfs-cache-mode = "full"; + vfs-cache-mode = "writes"; + dir-cache-time = "5s"; }; }; }; secrets = { - pass = "/run/usr/1000/secrets/copyparty/user-password/${hyper.user}"; + pass = "/run/user/1000/secrets/copyparty/user-password/${hyper.user}"; }; }; }; From 0162b27d7992b5cecac3657390fbde1a3562c447 Mon Sep 17 00:00:00 2001 From: "Lennart J. Kurzweg (Nx2)" Date: Mon, 25 Aug 2025 13:34:43 +0200 Subject: [PATCH 15/15] flake bump --- flake.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index 0ca57bb..e8ed36a 100644 --- a/flake.lock +++ b/flake.lock @@ -39,11 +39,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1755732626, - "narHash": "sha256-qLAElW0E2QmcrKAbLPjFdueAOpjp3HmlxaOQf4R4jas=", + "lastModified": 1755988415, + "narHash": "sha256-QveKdwB5ACKS1+qNqYsaZrai3nasidjsiKslnk0F6os=", "owner": "9001", "repo": "copyparty", - "rev": "cd8771fa522d1cf645c3c7e0193f07b53d81559c", + "rev": "68503444c7d6f6f7fc6f5a41258cabf50568a9ab", "type": "github" }, "original": { @@ -220,11 +220,11 @@ ] }, "locked": { - "lastModified": 1755776884, - "narHash": "sha256-CPM7zm6csUx7vSfKvzMDIjepEJv1u/usmaT7zydzbuI=", + "lastModified": 1755928099, + "narHash": "sha256-OILVkfhRCm8u18IZ2DKR8gz8CVZM2ZcJmQBXmjFLIfk=", "owner": "nix-community", "repo": "home-manager", - "rev": "4fb695d10890e9fc6a19deadf85ff79ffb78da86", + "rev": "4a44fb9f7555da362af9d499817084f4288a957f", "type": "github" }, "original": { @@ -308,11 +308,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1755781160, - "narHash": "sha256-8pOPsz8kMppCZa9HdvjxH/kB6DIdlpXXBcuNGLMZfSM=", + "lastModified": 1756022257, + "narHash": "sha256-2ABxsC0wvS6aYQz97CBvrmxUOEXWFvKQfs4e05Rvt5o=", "ref": "refs/heads/main", - "rev": "50a242f16abfc49efc6f89ea9cd14a3544888a25", - "revCount": 6384, + "rev": "ced38b1b0f46f9fbdf9d37644d27bdbd2a29af1d", + "revCount": 6391, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -607,11 +607,11 @@ }, "nixpkgs-latest": { "locked": { - "lastModified": 1755792360, - "narHash": "sha256-Bp9mBVrO0c6EDGBXH4jWE+IlEf+FW+jJDSoFuf+ncg8=", + "lastModified": 1756040103, + "narHash": "sha256-tyRpc3rv2YEWfDrE/Pq3ujpGERfs7JCwcwuAWH50gXk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "dac37fbcd385fbb0ea1e6d153673f62b5f4e0079", + "rev": "09340442016bf3b9688e659d598ac8077a08eb42", "type": "github" }, "original": { @@ -702,11 +702,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1755704039, - "narHash": "sha256-gKlP0LbyJ3qX0KObfIWcp5nbuHSb5EHwIvU6UcNBg2A=", + "lastModified": 1755922037, + "narHash": "sha256-wY1+2JPH0ZZC4BQefoZw/k+3+DowFyfOxv17CN/idKs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9cb344e96d5b6918e94e1bca2d9f3ea1e9615545", + "rev": "b1b3291469652d5a2edb0becc4ef0246fff97a7c", "type": "github" }, "original": { @@ -952,11 +952,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1755740452, - "narHash": "sha256-4C6tuLUdt2ohMPthPMT2Ma+vbn/y7Qz5qfZXVXcb+08=", + "lastModified": 1755961571, + "narHash": "sha256-PZ/5FT98cHeUBt7k3nnNmiYbuO6kf7vB1DA8ieAmYpw=", "owner": "sxyazi", "repo": "yazi", - "rev": "0054cf0b878bae84d1bf0c063801dc9c42aa6978", + "rev": "c27ef58116794de7f559bca74e60e6e13ae92051", "type": "github" }, "original": {