mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 13:28:16 +00:00
Use GNU version of sed from nixpkgs
This commit is contained in:
parent
e5f24e97a7
commit
c1ac8e9b3d
1 changed files with 3 additions and 2 deletions
|
@ -19,18 +19,19 @@ let
|
||||||
let
|
let
|
||||||
file = "/etc/pam.d/sudo";
|
file = "/etc/pam.d/sudo";
|
||||||
option = "security.pam.enableSudoTouchIdAuth";
|
option = "security.pam.enableSudoTouchIdAuth";
|
||||||
|
sed = "${pkgs.gnused}/bin/sed";
|
||||||
in ''
|
in ''
|
||||||
${if isEnabled then ''
|
${if isEnabled then ''
|
||||||
# Enable sudo Touch ID authentication, if not already enabled
|
# Enable sudo Touch ID authentication, if not already enabled
|
||||||
if ! grep 'pam_tid.so' ${file} > /dev/null; then
|
if ! grep 'pam_tid.so' ${file} > /dev/null; then
|
||||||
sed -i "" '2i\
|
${sed} -i '2i\
|
||||||
auth sufficient pam_tid.so # nix-darwin: ${option}
|
auth sufficient pam_tid.so # nix-darwin: ${option}
|
||||||
' ${file}
|
' ${file}
|
||||||
fi
|
fi
|
||||||
'' else ''
|
'' else ''
|
||||||
# Disable sudo Touch ID authentication, if added by nix-darwin
|
# Disable sudo Touch ID authentication, if added by nix-darwin
|
||||||
if grep '${option}' ${file} > /dev/null; then
|
if grep '${option}' ${file} > /dev/null; then
|
||||||
sed -i "" '/${option}/d' ${file}
|
${sed} -i '/${option}/d' ${file}
|
||||||
fi
|
fi
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Reference in a new issue