Skip to content

Commit

Permalink
feat(nix): fix swayidle module
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Feb 8, 2024
1 parent a2fff28 commit 8fabc1f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
26 changes: 11 additions & 15 deletions nix/modules/nixos/desktop/addons/swayidle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
];
};
Expand Down
1 change: 0 additions & 1 deletion nix/modules/nixos/desktop/hyprland/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion nix/systems/x86_64-linux/nz/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
Expand All @@ -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.<interface>.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;
Expand Down

0 comments on commit 8fabc1f

Please sign in to comment.