nixos/gnome: integrate fprintdFix into gnome module

This commit is contained in:
Aly Raffauf 2024-07-07 19:46:57 -04:00
parent 35dd665979
commit e2c9c12c10
3 changed files with 30 additions and 47 deletions

View file

@ -19,10 +19,6 @@
${lib.getExe' pkgs.glib "gsettings"} set org.gnome.desktop.interface color-scheme $color_scheme ${lib.getExe' pkgs.glib "gsettings"} set org.gnome.desktop.interface color-scheme $color_scheme
''; '';
in { in {
imports = [
./fprintdFix.nix
];
config = lib.mkIf config.ar.desktop.gnome.enable { config = lib.mkIf config.ar.desktop.gnome.enable {
environment.systemPackages = with pkgs; environment.systemPackages = with pkgs;
[ [
@ -54,17 +50,41 @@ in {
}) })
]; ];
# Enable keyring support for KDE apps in GNOME. security.pam.services = {
security.pam.services.gdm = { login.fprintAuth = false;
gdm = {
enableGnomeKeyring = true; enableGnomeKeyring = true;
gnupg.enable = true; gnupg.enable = true;
kwallet.enable = true; kwallet.enable = true;
}; };
gdm-fingerprint = lib.mkIf (config.services.fprintd.enable) {
text = ''
auth required pam_shells.so
auth requisite pam_nologin.so
auth requisite pam_faillock.so preauth
auth required ${pkgs.fprintd}/lib/security/pam_fprintd.so
auth optional pam_permit.so
auth required pam_env.so
auth [success=ok default=1] ${pkgs.gnome.gdm}/lib/security/pam_gdm.so
auth optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so
account include login
password required pam_deny.so
session include login
session optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start
'';
};
};
# Enable GNOME and GDM. # Enable GNOME and GDM.
services = { services = {
gnome.tracker-miners.enable = true; gnome.tracker-miners.enable = true;
udev.packages = with pkgs; [gnome.gnome-settings-daemon]; udev.packages = with pkgs; [gnome.gnome-settings-daemon];
xserver = { xserver = {
desktopManager.gnome.enable = true; desktopManager.gnome.enable = true;
displayManager.gdm.enable = true; displayManager.gdm.enable = true;

View file

@ -1,33 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
config = lib.mkIf config.ar.desktop.gnome.fprintdFix {
# Need to change the order pam loads its modules
# to get proper fingerprint behavior on GDM and the lockscreen.
security.pam.services = {
login.fprintAuth = false;
gdm-fingerprint = lib.mkIf (config.services.fprintd.enable) {
text = ''
auth required pam_shells.so
auth requisite pam_nologin.so
auth requisite pam_faillock.so preauth
auth required ${pkgs.fprintd}/lib/security/pam_fprintd.so
auth optional pam_permit.so
auth required pam_env.so
auth [success=ok default=1] ${pkgs.gnome.gdm}/lib/security/pam_gdm.so
auth optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so
account include login
password required pam_deny.so
session include login
session optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start
'';
};
};
};
}

View file

@ -15,11 +15,7 @@
desktop = { desktop = {
cinnamon.enable = lib.mkEnableOption "Cinnamon desktop session."; cinnamon.enable = lib.mkEnableOption "Cinnamon desktop session.";
gnome.enable = lib.mkEnableOption "GNOME desktop session.";
gnome = {
enable = lib.mkEnableOption "GNOME desktop session.";
fprintdFix = lib.mkEnableOption "Fingerprint login fix for GDM";
};
greetd = { greetd = {
enable = lib.mkEnableOption "Greetd display manager."; enable = lib.mkEnableOption "Greetd display manager.";