1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Add option to enable sudo authentication with TouchID

This commit is contained in:
Malo Bourgon 2020-09-11 12:14:44 -07:00
parent 2f2bdf658d
commit 1d98da837f
3 changed files with 24 additions and 0 deletions

View file

@ -29,6 +29,7 @@
./system/launchd.nix
./system/patches.nix
./system/shells.nix
./system/sudo.nix
./system/version.nix
./time
./networking

View file

@ -0,0 +1,8 @@
--- /etc/pam.d/sudo
+++ /etc/pam.d/sudo
@@ -1,4 +1,5 @@
# sudo: auth account password session
+auth sufficient pam_tid.so
auth sufficient pam_smartcard.so
auth required pam_opendirectory.so
account required pam_permit.so

15
modules/system/sudo.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.system.sudo;
in
{
options = {
system.sudo.touchid.enable = mkEnableOption "Enable sudo authentication with Touch ID";
};
config = mkIf cfg.touchid.enable { system.patches = [ ./etc-pam.d-sudo.patch ]; };
}