diff --git a/nix/modules/nixos/desktop/addons/swayidle/default.nix b/nix/modules/nixos/desktop/addons/swayidle/default.nix index 14172d9..62b4b06 100644 --- a/nix/modules/nixos/desktop/addons/swayidle/default.nix +++ b/nix/modules/nixos/desktop/addons/swayidle/default.nix @@ -18,33 +18,29 @@ in { enable = true; events = [ - { - event = "before-sleep"; - command = "${pkgs.swaylock}/bin/swaylock -defF"; - } - { - # TODO: Make dynamic for window manager - event = "after-resume"; - command = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; - } { event = "lock"; - command = "${pkgs.swaylock}/bin/swaylock -defF"; + command = "${pkgs.swaylock-effects}/bin/swaylock -efF"; } { event = "before-sleep"; - command = "${pkgs.libnotify}/bin/notify-send 'Going to sleep in 30 sec' -t 30000"; + command = "${pkgs.swaylock-effects}/bin/swaylock -efF"; } ]; + # 5 min lock, 10min turn the screen off, 20 min suspend timeouts = [ { - timeout = 900; - command = "${pkgs.swaylock}/bin/swaylock -defF"; + timeout = 300; + command = "${pkgs.swaylock-effects}/bin/swaylock -efF -C ~/.config/swaylock/config"; } { - # TODO: Make dynamic for window manager - timeout = 1200; + timeout = 600; command = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off"; + resumeCommand = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; + } + { + timeout = 1200; + command = "${pkgs.systemd}/bin/systemctl suspend"; } ]; }; diff --git a/nix/modules/nixos/desktop/hyprland/hyprland.conf b/nix/modules/nixos/desktop/hyprland/hyprland.conf index 4e02622..fd25f65 100644 --- a/nix/modules/nixos/desktop/hyprland/hyprland.conf +++ b/nix/modules/nixos/desktop/hyprland/hyprland.conf @@ -12,7 +12,6 @@ monitor=HDMI-A-1, 1920x1080, 0x0, 1 exec-once = mako exec-once = waybar exec-once = wl-paste --watch cliphist store -# exec-once = swayidle -w timeout 500 'swaylock' timeout 900 'systemctl suspend' before-sleep 'swaylock' exec-once = hyprpaper exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec = nm-applet --indicator diff --git a/nix/systems/x86_64-linux/nz/hardware-configuration.nix b/nix/systems/x86_64-linux/nz/hardware-configuration.nix index 319e329..dc20ebd 100644 --- a/nix/systems/x86_64-linux/nz/hardware-configuration.nix +++ b/nix/systems/x86_64-linux/nz/hardware-configuration.nix @@ -28,7 +28,7 @@ }; fileSystems."/mnt/tank" = { - device = "truenas.sbulav.gq:/mnt/tank"; + device = "truenas.sbulav.ru:/mnt/tank"; options = ["x-systemd.automount" "x-systemd.idle-timeout=600" "noauto"]; fsType = "nfs"; }; @@ -42,6 +42,9 @@ # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; + networking.hosts = { + "192.168.89.200" = ["truenas.sbulav.ru"]; + }; # networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true; # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;