Files
nixos-config/modules/wm/niri/home.nix

50 lines
1.3 KiB
Nix

#
# Sway NixOS & Home manager configuration
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ └─ home.nix
# └─ ./modules
# └─ ./desktop
# └─ ./sway
# └─ home.nix *
#
{ config, lib, pkgs, ... }:
{
programs = {
swaylock = {
enable = true;
settings = {
color = "000000";
image = "$HOME/.config/lockwall";
indicator-caps-lock = true;
show-keyboard-layout = true;
};
};
};
services = {
swayidle = {
enable = true;
events = [
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }
{ event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
# { event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; }
# { event = "unlock"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; }
];
timeouts = [
{ timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
{ timeout = 600; command = "${pkgs.niri}/bin/niri 'msg action power-off-monitors'"; resumeCommand = "${pkgs.niri}/bin/niri 'msg action power-on-monitors'"; }
];
};
};
xdg.configFile = {
"niri/config.kdl".source = ./config.kdl;
};
}