From 260e59786036495b2034838ad6864f8af584cd3a Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Sat, 28 Jun 2025 13:00:19 -0400 Subject: [PATCH] switching to swaylock/idle adding qmk --- flake.lock | 380 ++---------------- flake.nix | 10 - homes/emenel/default.nix | 3 + .../dotfiles/dot_local/bin/session-lock | 2 +- hosts/eddie/configuration.nix | 2 +- hosts/eddie/hardware.nix | 1 + modules/home/desktop.nix | 3 +- modules/home/niri.nix | 2 +- modules/home/sway-idle-lock.nix | 69 ++++ modules/home/swayidle.nix | 53 --- modules/home/yazi.nix | 2 + 11 files changed, 122 insertions(+), 405 deletions(-) create mode 100644 modules/home/sway-idle-lock.nix delete mode 100644 modules/home/swayidle.nix diff --git a/flake.lock b/flake.lock index 8d2ac47..1521d5d 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1750991368, - "narHash": "sha256-qun2GQjVWgkUZndX+jrf4JbiorC8Akx8ZKr+a814Epk=", + "lastModified": 1751127789, + "narHash": "sha256-Z0s5KRmigd6doImx6Kh4GRP/hlY8jMtT8KC1mqcPHv4=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "3c987c332e45cd23b2873f9c875b00bc17e29543", + "rev": "c5cc6bc833e686b5477e1a7054c5a0ee3039d413", "type": "github" }, "original": { @@ -220,7 +220,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_3" + "systems": "systems" }, "locked": { "lastModified": 1710146030, @@ -238,7 +238,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_6" + "systems": "systems_4" }, "locked": { "lastModified": 1731533236, @@ -256,7 +256,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_7" + "systems": "systems_5" }, "locked": { "lastModified": 1731533236, @@ -274,7 +274,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_8" + "systems": "systems_6" }, "locked": { "lastModified": 1731533236, @@ -449,268 +449,6 @@ "type": "github" } }, - "hyprgraphics": { - "inputs": { - "hyprutils": [ - "hyprlock", - "hyprutils" - ], - "nixpkgs": [ - "hyprlock", - "nixpkgs" - ], - "systems": [ - "hyprlock", - "systems" - ] - }, - "locked": { - "lastModified": 1749145600, - "narHash": "sha256-v2kY5RDk9oyo1x9m8u83GdklC96xlJ7ka1rrvZoYL78=", - "owner": "hyprwm", - "repo": "hyprgraphics", - "rev": "80b754e38e836777ad3a9d5d1ffc3491b0332471", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprgraphics", - "type": "github" - } - }, - "hypridle": { - "inputs": { - "hyprland-protocols": "hyprland-protocols", - "hyprlang": "hyprlang", - "hyprutils": "hyprutils", - "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems" - }, - "locked": { - "lastModified": 1750503503, - "narHash": "sha256-UWxbL6a81GWBg990pcct1dzm4HuWIEd1Q6mpV7bHrnM=", - "owner": "hyprwm", - "repo": "hypridle", - "rev": "25578b71370d1ba7bf08127ca4b0959452df4d04", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hypridle", - "type": "github" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "hypridle", - "nixpkgs" - ], - "systems": [ - "hypridle", - "systems" - ] - }, - "locked": { - "lastModified": 1749046714, - "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "hyprlang": { - "inputs": { - "hyprutils": [ - "hypridle", - "hyprutils" - ], - "nixpkgs": [ - "hypridle", - "nixpkgs" - ], - "systems": [ - "hypridle", - "systems" - ] - }, - "locked": { - "lastModified": 1749145882, - "narHash": "sha256-qr0KXeczF8Sma3Ae7+dR2NHhvG7YeLBJv19W4oMu6ZE=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "1bfb84f54d50c7ae6558c794d3cfd5f6a7e6e676", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprlang_2": { - "inputs": { - "hyprutils": [ - "hyprlock", - "hyprutils" - ], - "nixpkgs": [ - "hyprlock", - "nixpkgs" - ], - "systems": [ - "hyprlock", - "systems" - ] - }, - "locked": { - "lastModified": 1749145882, - "narHash": "sha256-qr0KXeczF8Sma3Ae7+dR2NHhvG7YeLBJv19W4oMu6ZE=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "1bfb84f54d50c7ae6558c794d3cfd5f6a7e6e676", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprlock": { - "inputs": { - "hyprgraphics": "hyprgraphics", - "hyprlang": "hyprlang_2", - "hyprutils": "hyprutils_2", - "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_2" - }, - "locked": { - "lastModified": 1750923325, - "narHash": "sha256-bIQTzgT0JD/jVEDZJCyWayOAnkCeUQ83CvOU26/2Y/8=", - "owner": "hyprwm", - "repo": "hyprlock", - "rev": "7999f448d71f673dc83c372f338ae7db8e290d7a", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlock", - "type": "github" - } - }, - "hyprutils": { - "inputs": { - "nixpkgs": [ - "hypridle", - "nixpkgs" - ], - "systems": [ - "hypridle", - "systems" - ] - }, - "locked": { - "lastModified": 1749135356, - "narHash": "sha256-Q8mAKMDsFbCEuq7zoSlcTuxgbIBVhfIYpX0RjE32PS0=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "e36db00dfb3a3d3fdcc4069cb292ff60d2699ccb", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprutils_2": { - "inputs": { - "nixpkgs": [ - "hyprlock", - "nixpkgs" - ], - "systems": [ - "hyprlock", - "systems" - ] - }, - "locked": { - "lastModified": 1749135356, - "narHash": "sha256-Q8mAKMDsFbCEuq7zoSlcTuxgbIBVhfIYpX0RjE32PS0=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "e36db00dfb3a3d3fdcc4069cb292ff60d2699ccb", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprwayland-scanner": { - "inputs": { - "nixpkgs": [ - "hypridle", - "nixpkgs" - ], - "systems": [ - "hypridle", - "systems" - ] - }, - "locked": { - "lastModified": 1749145760, - "narHash": "sha256-IHaGWpGrv7seFWdw/1A+wHtTsPlOGIKMrk1TUIYJEFI=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "817918315ea016cc2d94004bfb3223b5fd9dfcc6", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "type": "github" - } - }, - "hyprwayland-scanner_2": { - "inputs": { - "nixpkgs": [ - "hyprlock", - "nixpkgs" - ], - "systems": [ - "hyprlock", - "systems" - ] - }, - "locked": { - "lastModified": 1749145760, - "narHash": "sha256-IHaGWpGrv7seFWdw/1A+wHtTsPlOGIKMrk1TUIYJEFI=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "817918315ea016cc2d94004bfb3223b5fd9dfcc6", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "type": "github" - } - }, "isd": { "inputs": { "nix-appimage": "nix-appimage", @@ -721,7 +459,7 @@ "pyproject-build-systems": "pyproject-build-systems", "pyproject-nix": "pyproject-nix", "systemd-nix": "systemd-nix", - "systems": "systems_4", + "systems": "systems_2", "uv2nix": "uv2nix" }, "locked": { @@ -798,11 +536,11 @@ ] }, "locked": { - "lastModified": 1750610317, - "narHash": "sha256-tArf9ek4DoR+5lcDlshGS/CjMjX8vMNfpZ1Ys98UrZM=", + "lastModified": 1751031069, + "narHash": "sha256-5TnciluG7MGHoH5abAuC8UwRVrdEu7gKcpkz/bKb9N4=", "owner": "nix-community", "repo": "nh", - "rev": "e5dbcf9d48257f4a116bc4746e0c59c78e08e161", + "rev": "992aa30f55d35395b129376f16809319a9b23b16", "type": "github" }, "original": { @@ -823,11 +561,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1750920099, - "narHash": "sha256-Nt906asgI25vQ+/FFHpZ2VeS8N3EMxRBlt9o7F2+Ib8=", + "lastModified": 1751106385, + "narHash": "sha256-lP/ZZk9doHFD/GR7sKh+PadDijURRDki6S8adVMt7v8=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "151cff5b067b51384cf88d5bd5a4ec74b5984c7c", + "rev": "d6be81f7553b90cd0e9528ddd7df665705b536e3", "type": "github" }, "original": { @@ -928,7 +666,7 @@ "nixpkgs" ], "nixpkgs-lib": "nixpkgs-lib_3", - "systems": "systems_5" + "systems": "systems_3" }, "locked": { "lastModified": 1748538518, @@ -1060,11 +798,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1750838302, - "narHash": "sha256-aVkL3/yu50oQzi2YuKo0ceiCypVZpZXYd2P2p1FMJM4=", + "lastModified": 1750969886, + "narHash": "sha256-zW/OFnotiz/ndPFdebpo3X0CrbVNf22n4DjN2vxlb58=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7284e2decc982b81a296ab35aa46e804baaa1cfe", + "rev": "a676066377a2fe7457369dd37c31fd2263b662f4", "type": "github" }, "original": { @@ -1076,11 +814,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1750838302, - "narHash": "sha256-aVkL3/yu50oQzi2YuKo0ceiCypVZpZXYd2P2p1FMJM4=", + "lastModified": 1750969886, + "narHash": "sha256-zW/OFnotiz/ndPFdebpo3X0CrbVNf22n4DjN2vxlb58=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7284e2decc982b81a296ab35aa46e804baaa1cfe", + "rev": "a676066377a2fe7457369dd37c31fd2263b662f4", "type": "github" }, "original": { @@ -1156,11 +894,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1750776420, - "narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=", + "lastModified": 1751011381, + "narHash": "sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf", + "rev": "30e2e2857ba47844aa71991daa6ed1fc678bcbb7", "type": "github" }, "original": { @@ -1259,8 +997,6 @@ "emacs-lsp-booster": "emacs-lsp-booster", "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", - "hypridle": "hypridle", - "hyprlock": "hyprlock", "isd": "isd", "musnix": "musnix", "nh": "nh", @@ -1385,16 +1121,16 @@ }, "systems": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -1430,16 +1166,16 @@ }, "systems_4": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -1473,36 +1209,6 @@ "type": "github" } }, - "systems_7": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_8": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": "nixpkgs_3" @@ -1567,11 +1273,11 @@ "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1750966545, - "narHash": "sha256-iRSg4Nd8RUTTxzsRQBTO67VQlUQ7HrPaSz/JxlIhADY=", + "lastModified": 1751044827, + "narHash": "sha256-hoaujl57LLq8YxIDUKF4HNKp9I6rkqhy8DfC8OOE2js=", "owner": "Alexays", "repo": "Waybar", - "rev": "c336bc5466c858ac41dc9afd84f04a5ffec9e292", + "rev": "8516d457ad63880e359cb650581deb52d9fc3559", "type": "github" }, "original": { @@ -1692,11 +1398,11 @@ "rust-overlay": "rust-overlay_3" }, "locked": { - "lastModified": 1750939974, - "narHash": "sha256-diMUiScHLYtrTbk4Ae37+saJ4Bhn0DOWHDeIi/owpSg=", + "lastModified": 1751126369, + "narHash": "sha256-Pf4hBcGfVeBxCTJBwCXMlsGjlrmBE6XocXzAtN0e26U=", "owner": "sxyazi", "repo": "yazi", - "rev": "2d1cf621db25591161c38b46fee3d9bb25c075ae", + "rev": "8657e6b6f55d2db3157fed50a8305f500310aba7", "type": "github" }, "original": { @@ -1713,11 +1419,11 @@ ] }, "locked": { - "lastModified": 1750979960, - "narHash": "sha256-ODzTyHMk+ZWotuk+FQCSDMIxoY/l7aLHyXoEg+HqYCI=", + "lastModified": 1751127508, + "narHash": "sha256-fU2FQKNxO5gkADRFMS2S54M/LKsTewMpGRm+KJRLdFo=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "ba65621f10400885d94604a3fd9af378000bfb35", + "rev": "5962b5db7babbb1607dcd2d1d6db9ab540cc108d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 85e1585..74b1853 100644 --- a/flake.nix +++ b/flake.nix @@ -59,16 +59,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - hyprlock = { - url = "github:hyprwm/hyprlock"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - hypridle = { - url = "github:hyprwm/hypridle"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - musnix = { url = "github:musnix/musnix"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/homes/emenel/default.nix b/homes/emenel/default.nix index bc91516..9c2c622 100644 --- a/homes/emenel/default.nix +++ b/homes/emenel/default.nix @@ -38,6 +38,9 @@ in bazecor faircamp sqlite + qmk + qmk-udev-rules + qmk_hid ]) ]; diff --git a/homes/emenel/dotfiles/dot_local/bin/session-lock b/homes/emenel/dotfiles/dot_local/bin/session-lock index c8a6588..aa14ed5 100755 --- a/homes/emenel/dotfiles/dot_local/bin/session-lock +++ b/homes/emenel/dotfiles/dot_local/bin/session-lock @@ -1,2 +1,2 @@ #!/bin/sh -pidof hyprlock || hyprlock +pidof swaylock || swaylock diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index 5630491..87f36fb 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -198,10 +198,10 @@ pam = { services = { - hyprlock = { enableGnomeKeyring = true; }; greetd.enableGnomeKeyring = true; greetd-password.enableGnomeKeyring = true; niri.enableGnomeKeyring = true; + swaylock.enableGnomeKeyring = true; }; }; }; diff --git a/hosts/eddie/hardware.nix b/hosts/eddie/hardware.nix index 6f4beec..0887563 100644 --- a/hosts/eddie/hardware.nix +++ b/hosts/eddie/hardware.nix @@ -76,5 +76,6 @@ }; }; }; + keyboard.qmk.enable = true; }; } diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index be68ef1..075317b 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -7,8 +7,7 @@ waybar swaync mpv - hyprlock - hypridle + sway-idle-lock sway-launcher-desktop browsers ]; diff --git a/modules/home/niri.nix b/modules/home/niri.nix index 7405497..03e92e5 100644 --- a/modules/home/niri.nix +++ b/modules/home/niri.nix @@ -354,7 +354,7 @@ in "Mod+Shift+A" = { hotkey-overlay.title = "Lock Session"; - action = spawn "hyprlock"; + action = spawn "/home/emenel/.local/bin/session-lock"; allow-when-locked = true; }; diff --git a/modules/home/sway-idle-lock.nix b/modules/home/sway-idle-lock.nix new file mode 100644 index 0000000..ea5c7b6 --- /dev/null +++ b/modules/home/sway-idle-lock.nix @@ -0,0 +1,69 @@ + +{ + services.swayidle = { + enable = true; + + events = [ + { + event = "lock"; + command = "/home/emenel/.local/bin/session-lock"; + } + + { + event = "after-resume"; + command = "/home/emenel/.local/bin/on-unlock"; + } + ]; + + timeouts = [ + { + timeout = 60; + command = "/home/emenel/.local/bin/dim-all-monitors"; + } + + # battery timers + { + timeout = 90; + command = "systemd-ac-power || loginctl lock-session"; + } + { + timeout = 120; + command = "systemd-ac-power || /home/emenel/.local/bin/lock-power-off-monitors"; + } + { + timeout = 180; + command = "systemd-ac-power || /home/emenel/.local/bin/lock-suspend"; + } + + # ac power timers + { + timeout = 180; + command = "systemd-ac-power && loginctl lock-session"; + } + + { + timeout = 240; + command = "systemd-ac-power || /home/emenel/.local/bin/lock-power-off-monitors"; + } + + { + timeout = 600; + command = "systemd-ac-power && /home/emenel/.local/bin/lock-suspend"; + } + ]; + + }; + + + programs.swaylock = { + enable = true; + settings = { + color = "808080"; + font-size = 24; + indicator-idle-visible = true; + indicator-radius = 100; + line-color = "ffffff"; + show-failed-attempts = true; + }; + }; +} diff --git a/modules/home/swayidle.nix b/modules/home/swayidle.nix deleted file mode 100644 index 1f2a13f..0000000 --- a/modules/home/swayidle.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ inputs, ... }: -{ - services.swayidle = { - enable = true; - - events = [ - { - event = "lock"; - command = "pidof hyprlock || hyprlock"; - } - - { - event = "after-resume"; - command = "shikanectl reload && brillo -e -u 150000 -I"; - } - ]; - - timeouts = [ - { - timeout = 60; - command = "dim-all-monitors"; - } - - # battery timers - { - timeout = 120; - command = "systemd-ac-power || lock-power-off-monitors"; - } - { - timeout = 180; - command = "systemd-ac-power || lock-suspend"; - } - - # ac power timers - { - timeout = 180; - command = "systemd-ac-power && loginctl lock-session"; - } - - { - timeout = 240; - command = "systemd-ac-power && lock-power-off-monitors"; - } - - { - timeout = 600; - command = "systemd-ac-power && lock-suspend"; - } - ]; - - }; - -} diff --git a/modules/home/yazi.nix b/modules/home/yazi.nix index 66c6dd8..9096bbb 100644 --- a/modules/home/yazi.nix +++ b/modules/home/yazi.nix @@ -90,6 +90,8 @@ { on = ""; run ="close"; } { on = ""; run ="tab_switch 1 --relative"; } { on = ""; run ="tab_switch -1 --relative"; } + { on = ""; run ="tab_switch 1 --relative"; } + { on = ""; run ="tab_switch -1 --relative"; } { on = ""; run ="tab_switch 0"; } { on = ""; run ="tab_switch 1"; } { on = ""; run ="tab_switch 2"; }