Compare commits
1
Commits
main
..
ea2ddcd7d5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea2ddcd7d5 |
No files matched your search
@@ -12,7 +12,6 @@
|
|||||||
./modules/thinkpad.nix
|
./modules/thinkpad.nix
|
||||||
./modules/fingerprint.nix
|
./modules/fingerprint.nix
|
||||||
./secrets/secrets.nix
|
./secrets/secrets.nix
|
||||||
./modules/bottles.nix
|
|
||||||
|
|
||||||
(import ../modules/common.nix {
|
(import ../modules/common.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
@@ -34,6 +33,7 @@
|
|||||||
|
|
||||||
host.laptop = true;
|
host.laptop = true;
|
||||||
|
|
||||||
|
programs.gamemode.enable = true;
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
}
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{pkgs-stable, ...}: {
|
|
||||||
environment.systemPackages = with pkgs-stable; [
|
|
||||||
bottles
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -162,23 +162,15 @@
|
|||||||
# open-fprintd, so a successful ListEnrolledFingers call means the sensor is
|
# open-fprintd, so a successful ListEnrolledFingers call means the sensor is
|
||||||
# usable. This is used as ExecStartPost and by greetd ordering.
|
# usable. This is used as ExecStartPost and by greetd ordering.
|
||||||
waitForFprint = pkgs.writeShellScript "wait-for-fprint" ''
|
waitForFprint = pkgs.writeShellScript "wait-for-fprint" ''
|
||||||
for ((i = 0; i < 120; i++)); do
|
for ((i = 0; i < 20; i++)); do
|
||||||
|
if ${timeout} 0.5 ${fprintdList} root >/dev/null 2>&1; then
|
||||||
devices="$(${timeout} 1 ${busctl} --system call \
|
|
||||||
net.reactivated.Fprint \
|
|
||||||
/net/reactivated/Fprint/Manager \
|
|
||||||
net.reactivated.Fprint.Manager GetDevices 2>/dev/null || true)"
|
|
||||||
|
|
||||||
if [[ "$devices" =~ ^ao\ [1-9] ]]; then
|
|
||||||
echo "wait-for-fprint: sensor initialized: $devices"
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
${sleep} 0.1
|
||||||
${sleep} 0.5
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "wait-for-fprint: sensor initialization timeout" >&2
|
echo "wait-for-fprint: fingerprint backend did not become ready" >&2
|
||||||
exit 1
|
exit 0
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# The xHCI controller is reset during resume, which invalidates
|
# The xHCI controller is reset during resume, which invalidates
|
||||||
@@ -278,7 +270,7 @@ in {
|
|||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
ExecStart = "${python-validity}/bin/python-validity-service";
|
ExecStart = "${python-validity}/bin/python-validity-service";
|
||||||
ExecStartPost = "-${waitForFprint}";
|
ExecStartPost = "${waitForFprint}";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 2;
|
RestartSec = 2;
|
||||||
RuntimeDirectory = "python-validity";
|
RuntimeDirectory = "python-validity";
|
||||||
|
|||||||
@@ -6,22 +6,8 @@ let
|
|||||||
hyprctl = lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl";
|
hyprctl = lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl";
|
||||||
loginctl = lib.getExe' pkgs.systemd "loginctl";
|
loginctl = lib.getExe' pkgs.systemd "loginctl";
|
||||||
pidof = lib.getExe' pkgs.procps "pidof";
|
pidof = lib.getExe' pkgs.procps "pidof";
|
||||||
fprintdList = lib.getExe' pkgs.fprintd "fprintd-list";
|
|
||||||
timeout = lib.getExe' pkgs.coreutils "timeout";
|
|
||||||
sleepCmd = lib.getExe' pkgs.coreutils "sleep";
|
|
||||||
sh = lib.getExe pkgs.bash;
|
|
||||||
|
|
||||||
hyprlockWait = pkgs.writeShellScript "hyprlock-wait-fprint" ''
|
|
||||||
for i in $(seq 1 60); do
|
|
||||||
if ${timeout} 1 ${fprintdList} kirill >/dev/null 2>&1; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
${sleepCmd} 1
|
|
||||||
done
|
|
||||||
exec ${hyprlock}
|
|
||||||
'';
|
|
||||||
in {
|
in {
|
||||||
wayland.windowManager.hyprland.settings.on = [ (hyprLua.onStart [ "${hyprlockWait}" ]) ];
|
wayland.windowManager.hyprland.settings.on = [ (hyprLua.onStart [ "hyprlock" ]) ];
|
||||||
|
|
||||||
# Hypridle listens to logind's PrepareForSleep signal: it locks the session
|
# Hypridle listens to logind's PrepareForSleep signal: it locks the session
|
||||||
# before suspend and makes sure hyprlock is running (and the display is on)
|
# before suspend and makes sure hyprlock is running (and the display is on)
|
||||||
@@ -30,9 +16,9 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
general = {
|
general = {
|
||||||
lock_cmd = "${pidof} hyprlock >/dev/null || ${hyprlockWait}";
|
lock_cmd = "${pidof} hyprlock >/dev/null || ${hyprlock}";
|
||||||
before_sleep_cmd = "${loginctl} lock-session";
|
before_sleep_cmd = "${loginctl} lock-session";
|
||||||
after_sleep_cmd = "${pidof} hyprlock >/dev/null || ${hyprlockWait} & ${hyprctl} dispatch 'hl.dsp.dpms({action = \"on\"})'";
|
after_sleep_cmd = "${pidof} hyprlock >/dev/null || ${hyprlock} & ${hyprctl} dispatch 'hl.dsp.dpms({action = \"on\"})'";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Hypridle requires at least one listener, so keep a no-op timer that
|
# Hypridle requires at least one listener, so keep a no-op timer that
|
||||||
|
|||||||
Reference in new issue
Block a user