diff options
author | linsui <linsui555@gmail.com> | 2023-06-14 16:28:04 +0800 |
---|---|---|
committer | linsui <linsui@inbox.lv> | 2023-08-15 19:20:39 +0800 |
commit | 0e6827ed9c09e517d47575e1b9e19f52e0961225 (patch) | |
tree | 8a23480957d86c7c4e16d7f59006e9a5bd987da5 /pkgs/desktops/gnome | |
parent | 038d78d4ce9fdef9f271891953d946233fe5ed42 (diff) |
nixos/gdm: switch to dconf settings
Diffstat (limited to 'pkgs/desktops/gnome')
-rw-r--r-- | pkgs/desktops/gnome/core/gdm/default.nix | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/pkgs/desktops/gnome/core/gdm/default.nix b/pkgs/desktops/gnome/core/gdm/default.nix index 8faa1615dc07d..cfdde43ae776b 100644 --- a/pkgs/desktops/gnome/core/gdm/default.nix +++ b/pkgs/desktops/gnome/core/gdm/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , fetchurl , fetchpatch , substituteAll @@ -8,7 +9,6 @@ , pkg-config , glib , itstool -, libxml2 , xorg , accountsservice , libX11 @@ -24,12 +24,12 @@ , audit , gobject-introspection , plymouth -, librsvg , coreutils , xorgserver , xwayland , dbus , nixos-icons +, runCommand }: let @@ -41,21 +41,21 @@ let in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gdm"; version = "44.1"; outputs = [ "out" "dev" ]; src = fetchurl { - url = "mirror://gnome/sources/gdm/${lib.versions.major version}/${pname}-${version}.tar.xz"; + url = "mirror://gnome/sources/gdm/${lib.versions.major finalAttrs.version}/${finalAttrs.pname}-${finalAttrs.version}.tar.xz"; sha256 = "aCZrOr59KPxGnQBnqsnF2rsMp5UswffCOKBJUfPcWw0="; }; 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}" + "-Dinitial-vt=${finalAttrs.passthru.initialVT}" "-Dudev-dir=${placeholder "out"}/lib/udev/rules.d" "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user" @@ -131,21 +131,21 @@ stdenv.mkDerivation rec { ''; preInstall = '' - install -D ${override} ${DESTDIR}/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override + install -D ${override} $DESTDIR/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override ''; postInstall = '' # Move stuff from DESTDIR to proper location. # We use rsync to merge the directories. - rsync --archive "${DESTDIR}/etc" "$out" - rm --recursive "${DESTDIR}/etc" + rsync --archive "$DESTDIR/etc" "$out" + rm --recursive "$DESTDIR/etc" for o in $(getAllOutputNames); do if [[ "$o" = "debug" ]]; then continue; fi - rsync --archive "${DESTDIR}/''${!o}" "$(dirname "''${!o}")" - rm --recursive "${DESTDIR}/''${!o}" + rsync --archive "$DESTDIR/''${!o}" "$(dirname "''${!o}")" + rm --recursive "$DESTDIR/''${!o}" done # Ensure the DESTDIR is removed. - rmdir "${DESTDIR}/nix/store" "${DESTDIR}/nix" "${DESTDIR}" + 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" @@ -170,6 +170,18 @@ stdenv.mkDerivation rec { # Used in GDM NixOS module # Don't remove. initialVT = "7"; + dconfDb = "${finalAttrs.finalPackage}/share/gdm/greeter-dconf-defaults"; + dconfProfile = "user-db:user\nfile-db:${finalAttrs.passthru.dconfDb}"; + + tests = { + profile = runCommand "gdm-profile-test" { } '' + if test "${finalAttrs.passthru.dconfProfile}" != "$(cat ${finalAttrs.finalPackage}/share/dconf/profile/gdm)"; then + echo "GDM dconf profile changed, please update gdm.nix" + exit 1 + fi + touch $out + ''; + }; }; meta = with lib; { @@ -179,4 +191,4 @@ stdenv.mkDerivation rec { maintainers = teams.gnome.members; platforms = platforms.linux; }; -} +}) |