mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 13:28:16 +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/launchd.nix
|
||||||
./system/patches.nix
|
./system/patches.nix
|
||||||
./system/shells.nix
|
./system/shells.nix
|
||||||
|
./system/sudo.nix
|
||||||
./system/version.nix
|
./system/version.nix
|
||||||
./time
|
./time
|
||||||
./networking
|
./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…
Add table
Reference in a new issue