From ac542840a0ecba7c61e11b2c199c5baf15136a28 Mon Sep 17 00:00:00 2001 From: Satria Date: Thu, 19 Mar 2026 21:19:46 +0700 Subject: [PATCH 1/4] fix broken dest --- modules/system/homelab/proxy.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/proxy.nix b/modules/system/homelab/proxy.nix index 0eb1e49..de38a69 100644 --- a/modules/system/homelab/proxy.nix +++ b/modules/system/homelab/proxy.nix @@ -74,7 +74,7 @@ in { } // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair "${subdomain}.${base}" { useACMEHost = base; forceSSL = true; - locations."/".return = "301 ${base}"; + locations."/".return = "301 ${cfg.dest}"; }) redirects // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair (if subdomain == "@" then base else "${subdomain}.${base}") { useACMEHost = base; forceSSL = true; From 1b40da95a7ffedc4225c912d3f37e8fe2e5a16fc Mon Sep 17 00:00:00 2001 From: Satria Date: Thu, 19 Mar 2026 21:20:09 +0700 Subject: [PATCH 2/4] disable forgejo internal sign in --- modules/system/homelab/git.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/git.nix b/modules/system/homelab/git.nix index 39f2961..3d436ca 100644 --- a/modules/system/homelab/git.nix +++ b/modules/system/homelab/git.nix @@ -25,7 +25,7 @@ DISABLE_REGISTRATION = true; ENABLE_OPENID_SIGNIN = false; ENABLE_OPENID_SIGNUP = false; - ENABLE_INTERNAL_SIGNIN = true; + ENABLE_INTERNAL_SIGNIN = false; SHOW_REGISTRATION_BUTTON = false; ALLOW_ONLY_EXTERNAL_REGISTRATION = true; ALLOW_ONLY_INTERNAL_REGISTRATION = false; From 2890b8b5030ec472956d9fc248639ba5b067da51 Mon Sep 17 00:00:00 2001 From: Satria Date: Thu, 19 Mar 2026 21:46:11 +0700 Subject: [PATCH 3/4] preinstall extensions --- modules/home/core/zed.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/home/core/zed.nix b/modules/home/core/zed.nix index 9060a36..b3d3dc2 100644 --- a/modules/home/core/zed.nix +++ b/modules/home/core/zed.nix @@ -2,7 +2,14 @@ programs.zed-editor = { enable = true; package = pkgs.zed-editor; - extensions = [ "nix" ]; + extensions = [ + "html" "html-snippets" + "svelte" "svelte-snippets" + "wakatime" "discord-presence" + "catppuccin" "catppuccin-icons" + "git-firefly" + "nix" + ]; userSettings = { format_on_save = "off"; vim_mode = true; From 028a3702996273b4983c94fb24985d43c53ab3f6 Mon Sep 17 00:00:00 2001 From: Satria Date: Fri, 20 Mar 2026 06:49:51 +0700 Subject: [PATCH 4/4] battery notifier --- modules/hardware/misc/battery-power.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/hardware/misc/battery-power.nix b/modules/hardware/misc/battery-power.nix index bd8ee20..a8dbc96 100644 --- a/modules/hardware/misc/battery-power.nix +++ b/modules/hardware/misc/battery-power.nix @@ -1,4 +1,4 @@ -{ pkgs, resume-dev, ... }: { +{ pkgs, username, resume-dev, ... }: { powerManagement.powertop.enable = true; services = { @@ -10,6 +10,18 @@ echo 85 > /sys/class/power_supply/BAT*/charge_control_end_threshold || true ''}" ''; + cron = { + enable = true; + systemCronJobs = [ + "* * * * * ${username} bash -x ${pkgs.writeShellScript "low-battery-notifier" '' + BAT_PCT=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '[0-9]+(?=%)'` + BAT_STA=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '\w+(?=,)'` + echo "`date` battery status:$BAT_STA percentage:$BAT_PCT" + test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send -c device -u normal "Low Battery" "\$\{BAT_PCT}% remaining." + test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send -c device -u critical "Low Battery" "Shutdown at 10%." + ''} > /tmp/cron.batt.log 2>&1" + ]; + }; upower = { enable = true; percentageCritical = 15;