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:
parent
2f2bdf658d
commit
1d98da837f
3 changed files with 24 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
./system/launchd.nix
|
||||
./system/patches.nix
|
||||
./system/shells.nix
|
||||
./system/sudo.nix
|
||||
./system/version.nix
|
||||
./time
|
||||
./networking
|
||||
|
|
8
modules/system/etc-pam.d-sudo.patch
Normal file
8
modules/system/etc-pam.d-sudo.patch
Normal 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
15
modules/system/sudo.nix
Normal 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 ]; };
|
||||
}
|
Loading…
Reference in a new issue