Files
.github
.hydra
.vscode
docs
keys
modules
systems
users
alice
home
systems
artemision
kernel-patches
audio.nix
configuration.nix
default.nix
desktop.nix
fingerprint.nix
fonts.nix
graphics.nix
hardware.nix
non-server.nix
polkit.nix
programs.nix
secrets.yaml
steam.nix
wifi.nix
zerotier.nix
configuration.nix
non-server.nix
programs.nix
default.nix
home.nix
secrets.yaml
richie
default.nix
.envrc
.gitignore
.sops.yaml
flake.lock
flake.nix
treefmt.toml
nix-dotfiles/users/alice/systems/artemision/fingerprint.nix
ahuston-0 2ed6053231 nix fmt
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
2024-04-13 13:22:13 -04:00

33 lines
906 B
Nix

{
config,
lib,
pkgs,
...
}:
{
# custom module from modules/pam-fingerprint-swap.nix
# swaps password and fingerprint in pam ordering
security.pam.fprintd-order = {
enable = false;
order = 11501;
};
# to auto-flip to password when the laptop lid is closed (ie. docked)
services.acpid = {
enable = true;
lidEventCommands = ''
export PATH=$PATH:/run/current-system/sw/bin
if grep -Fq closed /proc/acpi/button/lid/LID0/state; then
${pkgs.systemd}/bin/systemctl stop fprintd.service
${pkgs.coreutils}/bin/ln -s /dev/null /run/systemd/transient/fprintd.service
${pkgs.systemd}/bin/systemctl daemon-reload
else
${pkgs.coreutils}/bin/rm -f /run/systemd/transient/fprintd.service
${pkgs.systemd}/bin/systemctl daemon-reload
${pkgs.systemd}/bin/systemctlstart fprintd.service
fi
'';
};
}