mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge branch 'gdm'
This commit is contained in:
commit
14895d6c95
13 changed files with 306 additions and 9 deletions
|
@ -139,6 +139,7 @@
|
|||
polipo = 129;
|
||||
mopidy = 130;
|
||||
unifi = 131;
|
||||
gdm = 132;
|
||||
|
||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||
|
||||
|
@ -252,6 +253,7 @@
|
|||
polipo = 129;
|
||||
mopidy = 130;
|
||||
docker = 131;
|
||||
gdm = 132;
|
||||
|
||||
# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
./programs/bash/bash.nix
|
||||
./programs/bash/command-not-found.nix
|
||||
./programs/blcr.nix
|
||||
./programs/dconf.nix
|
||||
./programs/environment.nix
|
||||
./programs/info.nix
|
||||
./programs/screen.nix
|
||||
|
@ -279,6 +280,7 @@
|
|||
./services/x11/desktop-managers/default.nix
|
||||
./services/x11/display-managers/auto.nix
|
||||
./services/x11/display-managers/default.nix
|
||||
./services/x11/display-managers/gdm.nix
|
||||
./services/x11/display-managers/kdm.nix
|
||||
./services/x11/display-managers/lightdm.nix
|
||||
./services/x11/display-managers/slim.nix
|
||||
|
|
34
nixos/modules/programs/dconf.nix
Normal file
34
nixos/modules/programs/dconf.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption mkIf types mapAttrsToList;
|
||||
cfg = config.programs.dconf;
|
||||
|
||||
mkDconfProfile = name: path:
|
||||
{ source = path; target = "dconf/profile/${name}"; };
|
||||
|
||||
in
|
||||
{
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
programs.dconf = {
|
||||
|
||||
profiles = mkOption {
|
||||
type = types.attrsOf types.path;
|
||||
default = {};
|
||||
description = "Set of dconf profile files.";
|
||||
internal = true;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf (cfg.profiles != {}) {
|
||||
environment.etc =
|
||||
(mapAttrsToList mkDconfProfile cfg.profiles);
|
||||
};
|
||||
|
||||
}
|
151
nixos/modules/services/x11/display-managers/gdm.nix
Normal file
151
nixos/modules/services/x11/display-managers/gdm.nix
Normal file
|
@ -0,0 +1,151 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.xserver.displayManager;
|
||||
gdm = pkgs.gnome3_12.gdm; # gdm 3.10 not supported
|
||||
gnome3 = config.environment.gnome3.packageSet;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.xserver.displayManager.gdm = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
Whether to enable GDM as the display manager.
|
||||
<emphasis>GDM is very experimental and may render system unusable.</emphasis>
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.gdm.enable {
|
||||
|
||||
services.xserver.displayManager.slim.enable = false;
|
||||
|
||||
users.extraUsers.gdm =
|
||||
{ name = "gdm";
|
||||
uid = config.ids.uids.gdm;
|
||||
group = "gdm";
|
||||
home = "/run/gdm";
|
||||
description = "GDM user";
|
||||
};
|
||||
|
||||
users.extraGroups.gdm.gid = config.ids.gids.gdm;
|
||||
|
||||
services.xserver.displayManager.job =
|
||||
{
|
||||
environment = {
|
||||
GDM_X_SERVER = "${cfg.xserverBin} ${cfg.xserverArgs}";
|
||||
GDM_SESSIONS_DIR = "${cfg.session.desktops}";
|
||||
XDG_CONFIG_DIRS = "${gnome3.gnome_settings_daemon}/etc/xdg";
|
||||
};
|
||||
execCmd = "exec ${gdm}/sbin/gdm";
|
||||
};
|
||||
|
||||
# Because sd_login_monitor_new requires /run/systemd/machines
|
||||
systemd.services.display-manager.wants = [ "systemd-machined.service" ];
|
||||
systemd.services.display-manager.after = [ "systemd-machined.service" ];
|
||||
|
||||
systemd.services.display-manager.path = [ gnome3.gnome_shell gnome3.caribou ];
|
||||
|
||||
services.dbus.packages = [ gdm ];
|
||||
|
||||
programs.dconf.profiles.gdm = "${gdm}/share/dconf/profile/gdm";
|
||||
|
||||
# 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
|
||||
session required pam_env.so envfile=${config.system.build.pamEnvironment}
|
||||
session optional ${pkgs.systemd}/lib/security/pam_systemd.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session optional pam_permit.so
|
||||
'';
|
||||
|
||||
gdm.text = ''
|
||||
auth requisite pam_nologin.so
|
||||
auth required pam_env.so
|
||||
|
||||
auth required pam_succeed_if.so uid >= 1000 quiet
|
||||
auth optional ${gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so
|
||||
auth sufficient pam_unix.so nullok likeauth
|
||||
auth required pam_deny.so
|
||||
|
||||
account sufficient pam_unix.so
|
||||
|
||||
password requisite pam_unix.so nullok sha512
|
||||
|
||||
session required pam_env.so envfile=${config.system.build.pamEnvironment}
|
||||
session required pam_unix.so
|
||||
session required pam_loginuid.so
|
||||
session optional ${pkgs.systemd}/lib/security/pam_systemd.so
|
||||
session optional ${gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so auto_start
|
||||
'';
|
||||
|
||||
gdm-password.text = ''
|
||||
auth requisite pam_nologin.so
|
||||
auth required pam_env.so envfile=${config.system.build.pamEnvironment}
|
||||
|
||||
auth required pam_succeed_if.so uid >= 1000 quiet
|
||||
auth optional ${gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so
|
||||
auth sufficient pam_unix.so nullok likeauth
|
||||
auth required pam_deny.so
|
||||
|
||||
account sufficient pam_unix.so
|
||||
|
||||
password requisite pam_unix.so nullok sha512
|
||||
|
||||
session required pam_env.so envfile=${config.system.build.pamEnvironment}
|
||||
session required pam_unix.so
|
||||
session required pam_loginuid.so
|
||||
session optional ${pkgs.systemd}/lib/security/pam_systemd.so
|
||||
session optional ${gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so auto_start
|
||||
'';
|
||||
|
||||
gdm-autologin.text = ''
|
||||
auth requisite pam_nologin.so
|
||||
|
||||
auth required pam_succeed_if.so uid >= 1000 quiet
|
||||
auth required pam_permit.so
|
||||
|
||||
account sufficient pam_unix.so
|
||||
|
||||
password requisite pam_unix.so nullok sha512
|
||||
|
||||
session optional pam_keyinit.so revoke
|
||||
session required pam_env.so envfile=${config.system.build.pamEnvironment}
|
||||
session required pam_unix.so
|
||||
session required pam_loginuid.so
|
||||
session optional ${pkgs.systemd}/lib/security/pam_systemd.so
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue