diff --git a/apps/hypridle/home.nix b/apps/hypridle/home.nix new file mode 100644 index 0000000..f464f5b --- /dev/null +++ b/apps/hypridle/home.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: +{ + services.hypridle = { + enable = true; + settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + before_sleep_cmd = "loginctl lock-session"; # lock before suspend + }; + + listener = [ + { + timeout = 300; # 5min + on-timeout = "loginctl lock-session"; # lock screen when timeout has passed + } + { + timeout = 330; # 5.5min + on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has passed + } + { + timeout = 1800; # 30min + on-timeout = "systemctl suspend"; # suspend pc + } + ]; + }; + }; +} diff --git a/apps/hyprland/hypr/exec.nix b/apps/hyprland/hypr/exec.nix index 5b994c2..929c079 100644 --- a/apps/hyprland/hypr/exec.nix +++ b/apps/hyprland/hypr/exec.nix @@ -22,7 +22,7 @@ "sh -c 'sleep 3; hakase-workspace-switch-force 1'" # FIXME: seems like a band-aid - "[workspace 1] uwsm app -- xdg-terminal-exec" + "[workspace 1] ghostty -e bash -c 'fastfetch; exec $SHELL'" "[workspace special:steam silent] uwsm app -- steam" ]; }; diff --git a/apps/hyprlock/home.nix b/apps/hyprlock/home.nix new file mode 100644 index 0000000..a6ee03d --- /dev/null +++ b/apps/hyprlock/home.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + programs.hyprlock = { + enable = true; + }; +} diff --git a/apps/stylix/home.nix b/apps/stylix/home.nix index 430694b..616a026 100644 --- a/apps/stylix/home.nix +++ b/apps/stylix/home.nix @@ -19,6 +19,7 @@ ]; }; hyprpaper.enable = true; + hyprlock.enable = true; gtk.enable = true; }; enable = true; diff --git a/modules/home/hyprland.nix b/modules/home/hyprland.nix index 33292ff..7eb17ce 100644 --- a/modules/home/hyprland.nix +++ b/modules/home/hyprland.nix @@ -2,6 +2,8 @@ imports = [ ../../apps/tte/hakase-screensaver.nix ../../apps/hyprland/home.nix + ../../apps/hypridle/home.nix + ../../apps/hyprlock/home.nix ../../apps/walker/home.nix # ../../apps/fsel/home.nix ../../apps/hyprpaper/home.nix diff --git a/system/hardware.nix b/system/hardware.nix index 40f25d0..1ae3d3d 100644 --- a/system/hardware.nix +++ b/system/hardware.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + pkgs, + myConfig, + ... +}: { hardware = { bluetooth = { enable = true; @@ -6,6 +10,7 @@ }; }; networking = { + hostName = myConfig.nixos.hostname; networkmanager.enable = true; networkmanager.wifi.backend = "iwd"; wireless.iwd.enable = true;