Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use sudo_local instead of sudo when changing sudo settings #1116

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions modules/security/pam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let
# should be deleted when the option is disabled.
mkSudoTouchIdAuthScript = isEnabled:
let
file = "/etc/pam.d/sudo";
file = "/etc/pam.d/sudo_local"; # Using sudo_local file instead of sudo file resolves the issue that it gets reset after system updates
option = "security.pam.enableSudoTouchIdAuth";
sed = "${pkgs.gnused}/bin/sed";
in ''
Expand All @@ -44,17 +44,11 @@ in
Enable sudo authentication with Touch ID.

When enabled, this option adds the following line to
{file}`/etc/pam.d/sudo`:
{file}`/etc/pam.d/sudo_local`:

```
auth sufficient pam_tid.so
```

::: {.note}
macOS resets this file when doing a system update. As such, sudo
authentication with Touch ID won't work after a system update
until the nix-darwin configuration is reapplied.
:::
'';
};
};
Expand Down
Loading