diff --git a/config/bun/bunfig.toml b/config/bun/bunfig.toml new file mode 100644 index 000000000..e3f1258b8 --- /dev/null +++ b/config/bun/bunfig.toml @@ -0,0 +1,5 @@ +[install] +minimumReleaseAge = 604800 +exact = true +ignoreScripts = true +optional = false diff --git a/config/bun/default.nix b/config/bun/default.nix new file mode 100644 index 000000000..6afc195f5 --- /dev/null +++ b/config/bun/default.nix @@ -0,0 +1,6 @@ +_: { + home.file.".bunfig.toml" = { + source = ./bunfig.toml; + force = true; + }; +} diff --git a/config/default.nix b/config/default.nix index 85e9f0172..4ec2dbf5c 100644 --- a/config/default.nix +++ b/config/default.nix @@ -5,6 +5,7 @@ in [ ./aichat ./amp + ./bun ./ccs ./cliproxyapi ./codex @@ -25,12 +26,14 @@ in ./karabiner ./llm ./mempalace + ./npm ./obsidian ./omp ./openclaw ./opencode ./paperclip ./pi + ./pnpm ./serena ./starship ./tmuxinator diff --git a/config/noctalia/ac-idle-inhibit.sh b/config/noctalia/ac-idle-inhibit.sh index c2eceefd9..38de5f97e 100644 --- a/config/noctalia/ac-idle-inhibit.sh +++ b/config/noctalia/ac-idle-inhibit.sh @@ -1,14 +1,31 @@ #!/usr/bin/env bash -# Inhibit idle when on AC power so noctalia's idle timeouts only fire on battery. -# Polls every 2s so AC state changes take effect well within the 5-min idle window. +# On battery: run swayidle for screen-off (5 min) and suspend (10 min). +# On AC: stop swayidle so only noctalia's lock fires. set -euo pipefail AC=/sys/class/power_supply/ACAD/online +SWAYIDLE_PID="" + +cleanup() { [ -n "$SWAYIDLE_PID" ] && kill "$SWAYIDLE_PID" 2>/dev/null; } +trap cleanup EXIT while true; do - if [ "$(cat "$AC" 2>/dev/null)" = "1" ]; then - systemd-inhibit --what=idle --why="On AC power" --mode=block sleep 2 + ON_AC="$(cat "$AC" 2>/dev/null)" + + if [ "$ON_AC" = "1" ]; then + if [ -n "$SWAYIDLE_PID" ] && kill -0 "$SWAYIDLE_PID" 2>/dev/null; then + kill "$SWAYIDLE_PID" 2>/dev/null + SWAYIDLE_PID="" + hyprctl dispatch dpms on + fi else - sleep 2 + if [ -z "$SWAYIDLE_PID" ] || ! kill -0 "$SWAYIDLE_PID" 2>/dev/null; then + swayidle -w \ + timeout 300 'hyprctl dispatch dpms off' \ + resume 'hyprctl dispatch dpms on' \ + timeout 600 'systemctl suspend' & + SWAYIDLE_PID=$! + fi fi + sleep 2 done diff --git a/config/noctalia/default.nix b/config/noctalia/default.nix index c7f265a13..39c73a2a8 100644 --- a/config/noctalia/default.nix +++ b/config/noctalia/default.nix @@ -16,15 +16,24 @@ in force = true; }; - # Inhibit idle when plugged into AC; noctalia's idle timeouts apply on battery only. + # Screen-off and suspend on battery only; noctalia handles lock on both AC and battery. systemd.user.services.ac-idle-inhibit = { Unit = { - Description = "Inhibit idle when on AC power"; + Description = "Screen-off and suspend on battery via swayidle"; After = [ "graphical-session.target" ]; PartOf = [ "graphical-session.target" ]; }; Service = { Type = "simple"; + PassEnvironment = "WAYLAND_DISPLAY"; + Environment = "PATH=${ + pkgs.lib.makeBinPath [ + pkgs.swayidle + pkgs.hyprland + pkgs.coreutils + pkgs.systemd + ] + }"; ExecStart = "${pkgs.bash}/bin/bash ${./ac-idle-inhibit.sh}"; Restart = "on-failure"; }; @@ -148,9 +157,9 @@ in wallpaper.enabled = false; idle = { enabled = true; - screenOffTimeout = 300; # 5 min on battery + screenOffTimeout = 0; lockTimeout = 300; - suspendTimeout = 600; # 10 min on battery + suspendTimeout = 0; }; systemMonitor.enableDgpuMonitoring = true; colorSchemes.schedulingMode = "location"; diff --git a/config/npm/default.nix b/config/npm/default.nix new file mode 100644 index 000000000..ed36b56d0 --- /dev/null +++ b/config/npm/default.nix @@ -0,0 +1,6 @@ +_: { + home.file.".npmrc" = { + source = ./npmrc; + force = true; + }; +} diff --git a/config/npm/npmrc b/config/npm/npmrc new file mode 100644 index 000000000..44299db09 --- /dev/null +++ b/config/npm/npmrc @@ -0,0 +1,5 @@ +minimum-release-age=10080 +ignore-scripts=true +save-exact=true +omit=optional +engine-strict=true diff --git a/config/pnpm/default.nix b/config/pnpm/default.nix new file mode 100644 index 000000000..d7ffbc862 --- /dev/null +++ b/config/pnpm/default.nix @@ -0,0 +1,6 @@ +_: { + xdg.configFile."pnpm/rc" = { + source = ./rc; + force = true; + }; +} diff --git a/config/pnpm/rc b/config/pnpm/rc new file mode 100644 index 000000000..44299db09 --- /dev/null +++ b/config/pnpm/rc @@ -0,0 +1,5 @@ +minimum-release-age=10080 +ignore-scripts=true +save-exact=true +omit=optional +engine-strict=true