2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-10-02 19:47:00 +01:00
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, substituteAll
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, python3
|
|
|
|
, rsync
|
|
|
|
, pkg-config
|
|
|
|
, glib
|
|
|
|
, itstool
|
|
|
|
, libxml2
|
|
|
|
, xorg
|
|
|
|
, accountsservice
|
|
|
|
, libX11
|
2021-05-07 22:18:14 +01:00
|
|
|
, gnome
|
2020-10-02 19:47:00 +01:00
|
|
|
, systemd
|
|
|
|
, dconf
|
|
|
|
, gtk3
|
|
|
|
, libcanberra-gtk3
|
|
|
|
, pam
|
|
|
|
, libselinux
|
|
|
|
, keyutils
|
|
|
|
, audit
|
|
|
|
, gobject-introspection
|
|
|
|
, plymouth
|
|
|
|
, librsvg
|
|
|
|
, coreutils
|
|
|
|
, xwayland
|
|
|
|
, dbus
|
|
|
|
, nixos-icons
|
|
|
|
}:
|
2019-09-20 00:14:12 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
override = substituteAll {
|
|
|
|
src = ./org.gnome.login-screen.gschema.override;
|
2021-02-25 18:29:01 +00:00
|
|
|
icon = "${nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg";
|
2019-09-20 00:14:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2016-09-18 20:35:23 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gdm";
|
2021-07-25 09:24:38 +01:00
|
|
|
version = "40.1";
|
2020-10-02 19:47:00 +01:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2018-02-25 20:07:20 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-21 06:02:56 +00:00
|
|
|
url = "mirror://gnome/sources/gdm/${lib.versions.major version}/${pname}-${version}.tar.xz";
|
2021-07-25 09:24:38 +01:00
|
|
|
sha256 = "q7ih6mZISPLJD4SsqkLpTSVgVwNYgamPvUH7xdfRc/0=";
|
2018-02-25 20:07:20 +00:00
|
|
|
};
|
|
|
|
|
2020-10-02 19:47:00 +01:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dgdm-xsession=true"
|
|
|
|
# TODO: Setup a default-path? https://gitlab.gnome.org/GNOME/gdm/-/blob/6fc40ac6aa37c8ad87c32f0b1a5d813d34bf7770/meson_options.txt#L6
|
|
|
|
"-Dinitial-vt=${passthru.initialVT}"
|
|
|
|
"-Dudev-dir=${placeholder "out"}/lib/udev/rules.d"
|
|
|
|
"-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
|
|
|
"-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
|
2018-04-27 17:53:21 +01:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
];
|
2016-09-18 20:35:23 +01:00
|
|
|
|
2020-10-02 19:47:00 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
dconf
|
|
|
|
glib # for glib-compile-schemas
|
|
|
|
itstool
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
rsync
|
2018-04-27 17:53:21 +01:00
|
|
|
];
|
2016-09-18 20:35:23 +01:00
|
|
|
|
2020-10-02 19:47:00 +01:00
|
|
|
buildInputs = [
|
|
|
|
accountsservice
|
|
|
|
audit
|
|
|
|
glib
|
|
|
|
gobject-introspection
|
|
|
|
gtk3
|
|
|
|
keyutils
|
|
|
|
libX11
|
|
|
|
libcanberra-gtk3
|
|
|
|
libselinux
|
|
|
|
pam
|
|
|
|
plymouth
|
|
|
|
systemd
|
|
|
|
xorg.libXdmcp
|
|
|
|
];
|
2016-09-18 20:35:23 +01:00
|
|
|
|
2018-04-27 17:53:21 +01:00
|
|
|
patches = [
|
2021-03-21 06:02:56 +00:00
|
|
|
# GDM fails to find g-s with the following error in the journal.
|
|
|
|
# gdm-x-session[976]: dbus-run-session: failed to exec 'gnome-session': No such file or directory
|
|
|
|
# https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/92
|
2020-10-02 19:47:00 +01:00
|
|
|
(fetchpatch {
|
2021-03-21 06:02:56 +00:00
|
|
|
url = "https://gitlab.gnome.org/GNOME/gdm/-/commit/ccecd9c975d04da80db4cd547b67a1a94fa83292.patch";
|
|
|
|
sha256 = "5hKS9wjjhuSAYwXct5vS0dPbmPRIINJoLC0Zm1naz6Q=";
|
|
|
|
revert = true;
|
2020-10-02 19:47:00 +01:00
|
|
|
})
|
|
|
|
|
2018-06-30 08:33:45 +01:00
|
|
|
# Change hardcoded paths to nix store paths.
|
2018-04-27 17:53:21 +01:00
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
2020-10-02 19:47:00 +01:00
|
|
|
inherit coreutils plymouth xwayland dbus;
|
2018-04-27 17:53:21 +01:00
|
|
|
})
|
2018-06-30 08:33:45 +01:00
|
|
|
|
|
|
|
# The following patches implement certain environment variables in GDM which are set by
|
|
|
|
# the gdm configuration module (nixos/modules/services/x11/display-managers/gdm.nix).
|
|
|
|
|
2018-04-27 17:53:21 +01:00
|
|
|
./gdm-x-session_extra_args.patch
|
2018-06-30 08:33:45 +01:00
|
|
|
|
|
|
|
# Allow specifying a wrapper for running the session command.
|
|
|
|
./gdm-x-session_session-wrapper.patch
|
|
|
|
|
|
|
|
# Forwards certain environment variables to the gdm-x-session child process
|
|
|
|
# to ensure that the above two patches actually work.
|
|
|
|
./gdm-session-worker_forward-vars.patch
|
2018-10-15 08:56:36 +01:00
|
|
|
|
|
|
|
# Set up the environment properly when launching sessions
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/48255
|
|
|
|
./reset-environment.patch
|
2018-04-27 17:53:21 +01:00
|
|
|
];
|
|
|
|
|
2020-10-02 19:47:00 +01:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs build-aux/meson_post_install.py
|
|
|
|
|
|
|
|
# Upstream checks some common paths to find an `X` binary. We already know it.
|
|
|
|
echo #!/bin/sh > build-aux/find-x-server.sh
|
2021-01-15 13:21:58 +00:00
|
|
|
echo "echo ${lib.getBin xorg.xorgserver}/bin/X" >> build-aux/find-x-server.sh
|
2020-10-02 19:47:00 +01:00
|
|
|
patchShebangs build-aux/find-x-server.sh
|
|
|
|
'';
|
|
|
|
|
2019-09-20 00:14:12 +01:00
|
|
|
preInstall = ''
|
2020-10-02 19:47:00 +01:00
|
|
|
install -D ${override} ${DESTDIR}/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override
|
2019-09-20 00:14:12 +01:00
|
|
|
'';
|
|
|
|
|
2020-10-02 19:47:00 +01:00
|
|
|
postInstall = ''
|
|
|
|
# Move stuff from DESTDIR to proper location.
|
|
|
|
# We use rsync to merge the directories.
|
|
|
|
rsync --archive "${DESTDIR}/etc" "$out"
|
|
|
|
rm --recursive "${DESTDIR}/etc"
|
|
|
|
for o in $outputs; do
|
|
|
|
rsync --archive "${DESTDIR}/''${!o}" "$(dirname "''${!o}")"
|
|
|
|
rm --recursive "${DESTDIR}/''${!o}"
|
|
|
|
done
|
|
|
|
# Ensure the DESTDIR is removed.
|
|
|
|
rmdir "${DESTDIR}/nix/store" "${DESTDIR}/nix" "${DESTDIR}"
|
|
|
|
|
|
|
|
# We are setting DESTDIR so the post-install script does not compile the schemas.
|
|
|
|
glib-compile-schemas "$out/share/glib-2.0/schemas"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# HACK: We want to install configuration files to $out/etc
|
|
|
|
# but GDM should read them from /etc on a NixOS system.
|
|
|
|
# With autotools, it was possible to override Make variables
|
|
|
|
# at install time but Meson does not support this
|
|
|
|
# so we need to convince it to install all files to a temporary
|
|
|
|
# location using DESTDIR and then move it to proper one in postInstall.
|
|
|
|
DESTDIR = "${placeholder "out"}/dest";
|
|
|
|
|
2018-04-27 17:53:21 +01:00
|
|
|
passthru = {
|
2021-05-07 22:18:14 +01:00
|
|
|
updateScript = gnome.updateScript {
|
2018-04-27 17:53:21 +01:00
|
|
|
packageName = "gdm";
|
2021-05-07 22:18:14 +01:00
|
|
|
attrPath = "gnome.gdm";
|
2018-04-27 17:53:21 +01:00
|
|
|
};
|
2020-10-02 19:47:00 +01:00
|
|
|
|
|
|
|
# Used in GDM NixOS module
|
|
|
|
# Don't remove.
|
|
|
|
initialVT = "7";
|
2018-04-27 17:53:21 +01:00
|
|
|
};
|
2016-09-18 20:35:23 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-09-18 20:35:23 +01:00
|
|
|
description = "A program that manages graphical display servers and handles graphical user logins";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://wiki.gnome.org/Projects/GDM";
|
2018-04-27 17:53:21 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-01 13:40:51 +01:00
|
|
|
maintainers = teams.gnome.members;
|
2018-04-27 17:53:21 +01:00
|
|
|
platforms = platforms.linux;
|
2016-09-18 20:35:23 +01:00
|
|
|
};
|
|
|
|
}
|