2014-04-02 16:21:00 +00:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
|
|
cfg = config.services.xserver.displayManager;
|
2024-08-11 16:34:19 +00:00
|
|
|
|
gdm = pkgs.gdm;
|
2024-07-03 13:56:12 +00:00
|
|
|
|
pamCfg = config.security.pam.services;
|
2021-09-30 23:40:54 +00:00
|
|
|
|
settingsFormat = pkgs.formats.ini { };
|
|
|
|
|
configFile = settingsFormat.generate "custom.conf" cfg.gdm.settings;
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2018-06-30 07:33:45 +00:00
|
|
|
|
xSessionWrapper = if (cfg.setupCommands == "") then null else
|
|
|
|
|
pkgs.writeScript "gdm-x-session-wrapper" ''
|
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
|
${cfg.setupCommands}
|
|
|
|
|
exec "$@"
|
|
|
|
|
'';
|
|
|
|
|
|
2019-05-09 16:04:34 +00:00
|
|
|
|
# Solves problems like:
|
|
|
|
|
# https://wiki.archlinux.org/index.php/Talk:Bluetooth_headset#GDMs_pulseaudio_instance_captures_bluetooth_headset
|
|
|
|
|
# Instead of blacklisting plugins, we use Fedora's PulseAudio configuration for GDM:
|
|
|
|
|
# https://src.fedoraproject.org/rpms/gdm/blob/master/f/default.pa-for-gdm
|
|
|
|
|
pulseConfig = pkgs.writeText "default.pa" ''
|
|
|
|
|
load-module module-device-restore
|
|
|
|
|
load-module module-card-restore
|
|
|
|
|
load-module module-udev-detect
|
|
|
|
|
load-module module-native-protocol-unix
|
|
|
|
|
load-module module-default-device-restore
|
|
|
|
|
load-module module-always-sink
|
|
|
|
|
load-module module-intended-roles
|
|
|
|
|
load-module module-suspend-on-idle
|
|
|
|
|
load-module module-position-event-sounds
|
|
|
|
|
'';
|
|
|
|
|
|
2024-02-27 20:28:05 +00:00
|
|
|
|
defaultSessionName = config.services.displayManager.defaultSession;
|
2019-11-14 03:14:42 +00:00
|
|
|
|
|
2019-12-10 14:10:30 +00:00
|
|
|
|
setSessionScript = pkgs.callPackage ./account-service-util.nix { };
|
2014-04-02 16:21:00 +00:00
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
{
|
2020-04-12 10:43:50 +00:00
|
|
|
|
imports = [
|
2024-08-08 07:26:24 +00:00
|
|
|
|
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "gdm" "autoLogin" "enable" ] [
|
2020-04-12 10:43:50 +00:00
|
|
|
|
"services"
|
|
|
|
|
"displayManager"
|
|
|
|
|
"autoLogin"
|
|
|
|
|
"enable"
|
|
|
|
|
])
|
2024-08-08 07:26:24 +00:00
|
|
|
|
(lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "gdm" "autoLogin" "user" ] [
|
2020-04-12 10:43:50 +00:00
|
|
|
|
"services"
|
|
|
|
|
"displayManager"
|
|
|
|
|
"autoLogin"
|
|
|
|
|
"user"
|
|
|
|
|
])
|
2022-01-30 01:22:34 +00:00
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
(lib.mkRemovedOptionModule [ "services" "xserver" "displayManager" "gdm" "nvidiaWayland" ] "We defer to GDM whether Wayland should be enabled.")
|
2020-04-12 10:43:50 +00:00
|
|
|
|
];
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2020-04-02 00:16:24 +00:00
|
|
|
|
meta = {
|
2024-08-08 07:26:24 +00:00
|
|
|
|
maintainers = lib.teams.gnome.members;
|
2020-04-02 00:16:24 +00:00
|
|
|
|
};
|
|
|
|
|
|
2014-04-02 16:21:00 +00:00
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
|
|
services.xserver.displayManager.gdm = {
|
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
enable = lib.mkEnableOption "GDM, the GNOME Display Manager";
|
2015-08-27 16:11:09 +00:00
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
debug = lib.mkEnableOption "debugging messages in GDM";
|
2015-09-14 08:33:44 +00:00
|
|
|
|
|
2020-04-12 10:43:50 +00:00
|
|
|
|
# Auto login options specific to GDM
|
2024-08-08 07:26:24 +00:00
|
|
|
|
autoLogin.delay = lib.mkOption {
|
|
|
|
|
type = lib.types.int;
|
2020-04-12 10:43:50 +00:00
|
|
|
|
default = 0;
|
2015-08-28 03:55:56 +00:00
|
|
|
|
description = ''
|
2020-04-12 10:43:50 +00:00
|
|
|
|
Seconds of inactivity after which the autologin will be performed.
|
2015-08-28 03:55:56 +00:00
|
|
|
|
'';
|
2014-04-02 16:21:00 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
wayland = lib.mkOption {
|
|
|
|
|
type = lib.types.bool;
|
2017-05-07 20:27:02 +00:00
|
|
|
|
default = true;
|
|
|
|
|
description = ''
|
2019-09-27 22:07:43 +00:00
|
|
|
|
Allow GDM to run on Wayland instead of Xserver.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
autoSuspend = lib.mkOption {
|
2019-06-25 21:58:20 +00:00
|
|
|
|
default = true;
|
|
|
|
|
description = ''
|
2021-06-30 02:35:26 +00:00
|
|
|
|
On the GNOME Display Manager login screen, suspend the machine after inactivity.
|
|
|
|
|
(Does not affect automatic suspend while logged in, or at lock screen.)
|
2019-06-25 21:58:20 +00:00
|
|
|
|
'';
|
2024-08-08 07:26:24 +00:00
|
|
|
|
type = lib.types.bool;
|
2019-06-25 21:58:20 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
banner = lib.mkOption {
|
|
|
|
|
type = lib.types.nullOr lib.types.lines;
|
2023-09-06 23:25:38 +00:00
|
|
|
|
default = null;
|
|
|
|
|
example = ''
|
|
|
|
|
foo
|
|
|
|
|
bar
|
|
|
|
|
baz
|
|
|
|
|
'';
|
|
|
|
|
description = ''
|
|
|
|
|
Optional message to display on the login screen.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
settings = lib.mkOption {
|
2021-09-30 23:40:54 +00:00
|
|
|
|
type = settingsFormat.type;
|
|
|
|
|
default = { };
|
|
|
|
|
example = {
|
|
|
|
|
debug.enable = true;
|
|
|
|
|
};
|
|
|
|
|
description = ''
|
|
|
|
|
Options passed to the gdm daemon.
|
|
|
|
|
See [here](https://help.gnome.org/admin/gdm/stable/configuration.html.en#daemonconfig) for supported options.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-02 16:21:00 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
config = lib.mkIf cfg.gdm.enable {
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2018-08-20 12:25:25 +00:00
|
|
|
|
services.xserver.displayManager.lightdm.enable = false;
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2018-06-29 23:58:35 +00:00
|
|
|
|
users.users.gdm =
|
2014-04-02 16:21:00 +00:00
|
|
|
|
{ name = "gdm";
|
|
|
|
|
uid = config.ids.uids.gdm;
|
|
|
|
|
group = "gdm";
|
|
|
|
|
home = "/run/gdm";
|
|
|
|
|
description = "GDM user";
|
|
|
|
|
};
|
|
|
|
|
|
2018-06-29 23:58:35 +00:00
|
|
|
|
users.groups.gdm.gid = config.ids.gids.gdm;
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2016-12-04 13:48:47 +00:00
|
|
|
|
# GDM needs different xserverArgs, presumable because using wayland by default.
|
|
|
|
|
services.xserver.tty = null;
|
|
|
|
|
services.xserver.display = null;
|
2017-05-07 21:01:20 +00:00
|
|
|
|
services.xserver.verbose = null;
|
2016-12-04 13:48:47 +00:00
|
|
|
|
|
2024-02-27 20:28:05 +00:00
|
|
|
|
services.displayManager =
|
2015-08-28 03:55:56 +00:00
|
|
|
|
{
|
2024-11-05 14:52:30 +00:00
|
|
|
|
# Enable desktop session data
|
|
|
|
|
enable = true;
|
|
|
|
|
|
2014-04-02 16:21:00 +00:00
|
|
|
|
environment = {
|
2016-12-04 13:48:47 +00:00
|
|
|
|
GDM_X_SERVER_EXTRA_ARGS = toString
|
2024-08-08 07:26:24 +00:00
|
|
|
|
(lib.filter (arg: arg != "-terminate") cfg.xserverArgs);
|
2022-05-05 21:46:24 +00:00
|
|
|
|
XDG_DATA_DIRS = lib.makeSearchPath "share" [
|
|
|
|
|
gdm # for gnome-login.session
|
2024-02-27 20:28:05 +00:00
|
|
|
|
config.services.displayManager.sessionData.desktops
|
2024-08-28 21:56:06 +00:00
|
|
|
|
pkgs.gnome-control-center # for accessibility icon
|
2024-06-22 12:43:05 +00:00
|
|
|
|
pkgs.adwaita-icon-theme
|
2022-05-05 21:46:24 +00:00
|
|
|
|
pkgs.hicolor-icon-theme # empty icon theme as a base
|
|
|
|
|
];
|
2024-08-08 07:26:24 +00:00
|
|
|
|
} // lib.optionalAttrs (xSessionWrapper != null) {
|
2018-06-30 07:33:45 +00:00
|
|
|
|
# Make GDM use this wrapper before running the session, which runs the
|
|
|
|
|
# configured setupCommands. This relies on a patched GDM which supports
|
|
|
|
|
# this environment variable.
|
|
|
|
|
GDM_X_SESSION_WRAPPER = "${xSessionWrapper}";
|
2014-04-02 16:21:00 +00:00
|
|
|
|
};
|
2015-04-10 15:02:57 +00:00
|
|
|
|
execCmd = "exec ${gdm}/bin/gdm";
|
2024-08-08 07:26:24 +00:00
|
|
|
|
preStart = lib.optionalString (defaultSessionName != null) ''
|
2019-12-10 14:10:30 +00:00
|
|
|
|
# Set default session in session chooser to a specified values – basically ignore session history.
|
2024-02-27 20:28:05 +00:00
|
|
|
|
${setSessionScript}/bin/set-session ${config.services.displayManager.sessionData.autologinSession}
|
2019-12-10 14:10:30 +00:00
|
|
|
|
'';
|
2014-04-02 16:21:00 +00:00
|
|
|
|
};
|
|
|
|
|
|
2019-12-12 14:04:58 +00:00
|
|
|
|
systemd.tmpfiles.rules = [
|
2020-02-23 12:50:19 +00:00
|
|
|
|
"d /run/gdm/.config 0711 gdm gdm"
|
2024-08-08 07:26:24 +00:00
|
|
|
|
] ++ lib.optionals config.hardware.pulseaudio.enable [
|
2020-02-23 12:50:19 +00:00
|
|
|
|
"d /run/gdm/.config/pulse 0711 gdm gdm"
|
|
|
|
|
"L+ /run/gdm/.config/pulse/${pulseConfig.name} - - - - ${pulseConfig}"
|
2024-08-08 07:26:24 +00:00
|
|
|
|
] ++ lib.optionals config.services.gnome.gnome-initial-setup.enable [
|
2019-12-12 14:04:58 +00:00
|
|
|
|
# Create stamp file for gnome-initial-setup to prevent it starting in GDM.
|
2020-01-09 03:47:41 +00:00
|
|
|
|
"f /run/gdm/.config/gnome-initial-setup-done 0711 gdm gdm - yes"
|
2019-12-12 14:04:58 +00:00
|
|
|
|
];
|
|
|
|
|
|
2020-01-05 13:43:39 +00:00
|
|
|
|
# Otherwise GDM will not be able to start correctly and display Wayland sessions
|
2024-08-28 21:56:05 +00:00
|
|
|
|
systemd.packages = with pkgs.gnome; [
|
|
|
|
|
gdm
|
2024-08-28 21:56:05 +00:00
|
|
|
|
pkgs.gnome-session
|
2024-08-28 21:56:05 +00:00
|
|
|
|
pkgs.gnome-shell
|
|
|
|
|
];
|
2024-06-22 12:43:05 +00:00
|
|
|
|
environment.systemPackages = [ pkgs.adwaita-icon-theme ];
|
2020-01-05 13:43:39 +00:00
|
|
|
|
|
2021-08-09 22:38:54 +00:00
|
|
|
|
# We dont use the upstream gdm service
|
|
|
|
|
# it has to be disabled since the gdm package has it
|
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/108672
|
|
|
|
|
systemd.services.gdm.enable = false;
|
|
|
|
|
|
2019-12-10 14:10:30 +00:00
|
|
|
|
systemd.services.display-manager.wants = [
|
|
|
|
|
# Because sd_login_monitor_new requires /run/systemd/machines
|
|
|
|
|
"systemd-machined.service"
|
|
|
|
|
# setSessionScript wants AccountsService
|
|
|
|
|
"accounts-daemon.service"
|
|
|
|
|
];
|
|
|
|
|
|
2017-06-25 16:59:23 +00:00
|
|
|
|
systemd.services.display-manager.after = [
|
|
|
|
|
"rc-local.service"
|
|
|
|
|
"systemd-machined.service"
|
|
|
|
|
"systemd-user-sessions.service"
|
2019-10-11 18:07:16 +00:00
|
|
|
|
"getty@tty${gdm.initialVT}.service"
|
2019-10-04 20:39:43 +00:00
|
|
|
|
"plymouth-quit.service"
|
|
|
|
|
"plymouth-start.service"
|
2019-09-15 11:30:04 +00:00
|
|
|
|
];
|
|
|
|
|
systemd.services.display-manager.conflicts = [
|
2020-10-15 08:56:59 +00:00
|
|
|
|
"getty@tty${gdm.initialVT}.service"
|
|
|
|
|
"plymouth-quit.service"
|
2019-10-04 20:39:43 +00:00
|
|
|
|
];
|
|
|
|
|
systemd.services.display-manager.onFailure = [
|
|
|
|
|
"plymouth-quit.service"
|
2017-06-25 16:59:23 +00:00
|
|
|
|
];
|
|
|
|
|
|
2020-10-15 08:56:59 +00:00
|
|
|
|
# Prevent nixos-rebuild switch from bringing down the graphical
|
|
|
|
|
# session. (If multi-user.target wants plymouth-quit.service which
|
|
|
|
|
# conflicts display-manager.service, then when nixos-rebuild
|
|
|
|
|
# switch starts multi-user.target, display-manager.service is
|
|
|
|
|
# stopped so plymouth-quit.service can be started.)
|
2024-08-08 07:26:24 +00:00
|
|
|
|
systemd.services.plymouth-quit = lib.mkIf config.boot.plymouth.enable {
|
2023-06-30 20:15:53 +00:00
|
|
|
|
wantedBy = lib.mkForce [];
|
|
|
|
|
};
|
2020-10-15 08:56:59 +00:00
|
|
|
|
|
2017-06-25 16:59:23 +00:00
|
|
|
|
systemd.services.display-manager.serviceConfig = {
|
2017-08-28 14:56:04 +00:00
|
|
|
|
# Restart = "always"; - already defined in xserver.nix
|
|
|
|
|
KillMode = "mixed";
|
|
|
|
|
IgnoreSIGPIPE = "no";
|
|
|
|
|
BusName = "org.gnome.DisplayManager";
|
|
|
|
|
StandardError = "inherit";
|
2019-10-04 20:39:43 +00:00
|
|
|
|
ExecReload = "${pkgs.coreutils}/bin/kill -SIGHUP $MAINPID";
|
|
|
|
|
KeyringMode = "shared";
|
|
|
|
|
EnvironmentFile = "-/etc/locale.conf";
|
2017-06-25 16:59:23 +00:00
|
|
|
|
};
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2024-08-28 21:56:05 +00:00
|
|
|
|
systemd.services.display-manager.path = [ pkgs.gnome-session ];
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2018-04-30 16:15:28 +00:00
|
|
|
|
# Allow choosing an user account
|
|
|
|
|
services.accounts-daemon.enable = true;
|
|
|
|
|
|
2014-04-02 16:21:00 +00:00
|
|
|
|
services.dbus.packages = [ gdm ];
|
2016-10-03 15:11:24 +00:00
|
|
|
|
|
|
|
|
|
systemd.user.services.dbus.wantedBy = [ "default.target" ];
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2023-06-14 08:28:04 +00:00
|
|
|
|
programs.dconf.profiles.gdm.databases = lib.optionals (!cfg.gdm.autoSuspend) [{
|
|
|
|
|
settings."org/gnome/settings-daemon/plugins/power" = {
|
|
|
|
|
sleep-inactive-ac-type = "nothing";
|
|
|
|
|
sleep-inactive-battery-type = "nothing";
|
|
|
|
|
sleep-inactive-ac-timeout = lib.gvariant.mkInt32 0;
|
|
|
|
|
sleep-inactive-battery-timeout = lib.gvariant.mkInt32 0;
|
2019-06-25 21:58:20 +00:00
|
|
|
|
};
|
2023-09-06 23:25:38 +00:00
|
|
|
|
}] ++ lib.optionals (cfg.gdm.banner != null) [{
|
|
|
|
|
settings."org/gnome/login-screen" = {
|
|
|
|
|
banner-message-enable = true;
|
|
|
|
|
banner-message-text = cfg.gdm.banner;
|
|
|
|
|
};
|
2023-06-14 08:28:04 +00:00
|
|
|
|
}] ++ [ "${gdm}/share/gdm/greeter-dconf-defaults" ];
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2015-09-14 08:48:00 +00:00
|
|
|
|
# Use AutomaticLogin if delay is zero, because it's immediate.
|
|
|
|
|
# Otherwise with TimedLogin with zero seconds the prompt is still
|
|
|
|
|
# presented and there's a little delay.
|
2021-09-30 23:40:54 +00:00
|
|
|
|
services.xserver.displayManager.gdm.settings = {
|
2024-08-08 07:26:24 +00:00
|
|
|
|
daemon = lib.mkMerge [
|
2021-09-30 23:40:54 +00:00
|
|
|
|
{ WaylandEnable = cfg.gdm.wayland; }
|
|
|
|
|
# nested if else didn't work
|
2024-08-08 07:26:24 +00:00
|
|
|
|
(lib.mkIf (config.services.displayManager.autoLogin.enable && cfg.gdm.autoLogin.delay != 0 ) {
|
2021-09-30 23:40:54 +00:00
|
|
|
|
TimedLoginEnable = true;
|
2024-02-27 20:28:05 +00:00
|
|
|
|
TimedLogin = config.services.displayManager.autoLogin.user;
|
2021-09-30 23:40:54 +00:00
|
|
|
|
TimedLoginDelay = cfg.gdm.autoLogin.delay;
|
|
|
|
|
})
|
2024-08-08 07:26:24 +00:00
|
|
|
|
(lib.mkIf (config.services.displayManager.autoLogin.enable && cfg.gdm.autoLogin.delay == 0 ) {
|
2021-09-30 23:40:54 +00:00
|
|
|
|
AutomaticLoginEnable = true;
|
2024-02-27 20:28:05 +00:00
|
|
|
|
AutomaticLogin = config.services.displayManager.autoLogin.user;
|
2021-09-30 23:40:54 +00:00
|
|
|
|
})
|
|
|
|
|
];
|
2024-08-08 07:26:24 +00:00
|
|
|
|
debug = lib.mkIf cfg.gdm.debug {
|
2021-09-30 23:40:54 +00:00
|
|
|
|
Enable = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
environment.etc."gdm/custom.conf".source = configFile;
|
2015-08-27 16:11:09 +00:00
|
|
|
|
|
2024-02-27 20:28:05 +00:00
|
|
|
|
environment.etc."gdm/Xsession".source = config.services.displayManager.sessionData.wrapper;
|
2018-07-22 23:34:53 +00:00
|
|
|
|
|
2014-04-02 16:21:00 +00:00
|
|
|
|
# GDM LFS PAM modules, adapted somehow to NixOS
|
|
|
|
|
security.pam.services = {
|
|
|
|
|
gdm-launch-environment.text = ''
|
|
|
|
|
auth required pam_succeed_if.so audit quiet_success user = gdm
|
|
|
|
|
auth optional pam_permit.so
|
|
|
|
|
|
|
|
|
|
account required pam_succeed_if.so audit quiet_success user = gdm
|
|
|
|
|
account sufficient pam_unix.so
|
|
|
|
|
|
|
|
|
|
password required pam_deny.so
|
|
|
|
|
|
|
|
|
|
session required pam_succeed_if.so audit quiet_success user = gdm
|
2021-07-28 04:28:25 +00:00
|
|
|
|
session required pam_env.so conffile=/etc/pam/environment readenv=0
|
2022-05-05 11:23:32 +00:00
|
|
|
|
session optional ${config.systemd.package}/lib/security/pam_systemd.so
|
2014-04-02 16:21:00 +00:00
|
|
|
|
session optional pam_keyinit.so force revoke
|
|
|
|
|
session optional pam_permit.so
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
gdm-password.text = ''
|
2017-01-13 16:16:55 +00:00
|
|
|
|
auth substack login
|
|
|
|
|
account include login
|
|
|
|
|
password substack login
|
|
|
|
|
session include login
|
2014-04-02 16:21:00 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
gdm-autologin.text = ''
|
2017-01-13 16:16:55 +00:00
|
|
|
|
auth requisite pam_nologin.so
|
|
|
|
|
auth required pam_succeed_if.so uid >= 1000 quiet
|
2024-01-20 11:52:43 +00:00
|
|
|
|
${lib.optionalString pamCfg.login.enableGnomeKeyring ''
|
2024-08-11 16:34:19 +00:00
|
|
|
|
auth [success=ok default=1] ${gdm}/lib/security/pam_gdm.so
|
2024-01-20 11:52:43 +00:00
|
|
|
|
auth optional ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so
|
|
|
|
|
''}
|
2017-01-13 16:16:55 +00:00
|
|
|
|
auth required pam_permit.so
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2017-01-13 16:16:55 +00:00
|
|
|
|
account sufficient pam_unix.so
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2023-03-12 16:59:01 +00:00
|
|
|
|
password requisite pam_unix.so nullok yescrypt
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
2017-01-13 16:16:55 +00:00
|
|
|
|
session optional pam_keyinit.so revoke
|
|
|
|
|
session include login
|
2014-04-02 16:21:00 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2024-07-03 21:26:31 +00:00
|
|
|
|
# This would block password prompt when included by gdm-password.
|
|
|
|
|
# GDM will instead run gdm-fingerprint in parallel.
|
2024-08-08 07:26:24 +00:00
|
|
|
|
login.fprintAuth = lib.mkIf config.services.fprintd.enable false;
|
2024-07-03 21:26:31 +00:00
|
|
|
|
|
2024-08-08 07:26:24 +00:00
|
|
|
|
gdm-fingerprint.text = lib.mkIf config.services.fprintd.enable ''
|
2024-04-23 16:58:49 +00:00
|
|
|
|
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 required pam_env.so
|
2024-07-03 13:56:12 +00:00
|
|
|
|
${lib.optionalString pamCfg.login.enableGnomeKeyring ''
|
2024-08-11 16:34:19 +00:00
|
|
|
|
auth [success=ok default=1] ${gdm}/lib/security/pam_gdm.so
|
2024-07-03 13:56:12 +00:00
|
|
|
|
auth optional ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so
|
|
|
|
|
''}
|
2024-04-23 16:58:49 +00:00
|
|
|
|
|
|
|
|
|
account include login
|
|
|
|
|
|
|
|
|
|
password required pam_deny.so
|
|
|
|
|
|
|
|
|
|
session include login
|
|
|
|
|
'';
|
2014-04-02 16:21:00 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|