forked from mirrors/nixpkgs
Merge pull request #68729 from worldofpeace/elementary-greeter/master
nixos/pantheon: use Pantheon's greeter
This commit is contained in:
commit
760b677c19
|
@ -79,8 +79,7 @@ in
|
|||
Using Pantheon without LightDM as a displayManager will break screenlocking from the UI.
|
||||
'';
|
||||
|
||||
services.xserver.displayManager.lightdm.enable = mkDefault true;
|
||||
services.xserver.displayManager.lightdm.greeters.gtk.enable = mkDefault true;
|
||||
services.xserver.displayManager.lightdm.greeters.pantheon.enable = mkDefault true;
|
||||
|
||||
# If not set manually Pantheon session cannot be started
|
||||
# Known issue of https://github.com/NixOS/nixpkgs/pull/43992
|
||||
|
@ -98,10 +97,6 @@ in
|
|||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
|
||||
fi
|
||||
'') cfg.sessionPath}
|
||||
|
||||
# Settings from elementary-default-settings
|
||||
export GTK_CSD=1
|
||||
export GTK_MODULES=$GTK_MODULES:pantheon-filechooser-module
|
||||
fi
|
||||
'';
|
||||
|
||||
|
@ -166,9 +161,14 @@ in
|
|||
networkmanager-iodine networkmanager-l2tp; };
|
||||
|
||||
# Override GSettings schemas
|
||||
environment.variables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
|
||||
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
|
||||
|
||||
environment.variables.GNOME_SESSION_DEBUG = optionalString cfg.debug "1";
|
||||
environment.sessionVariables.GNOME_SESSION_DEBUG = optionalString cfg.debug "1";
|
||||
|
||||
# Settings from elementary-default-settings
|
||||
environment.sessionVariables.GTK_CSD = "1";
|
||||
environment.sessionVariables.GTK_MODULES = "pantheon-filechooser-module";
|
||||
environment.etc."gtk-3.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-3.0/settings.ini";
|
||||
|
||||
environment.pathsToLink = [
|
||||
# FIXME: modules should link subdirs of `/share` rather than relying on this
|
||||
|
|
|
@ -8,11 +8,6 @@ let
|
|||
ldmcfg = dmcfg.lightdm;
|
||||
cfg = ldmcfg.greeters.pantheon;
|
||||
|
||||
xgreeters = pkgs.linkFarm "pantheon-greeter-xgreeters" [{
|
||||
path = "${pkgs.pantheon.elementary-greeter}/share/xgreeters/io.elementary.greeter.desktop";
|
||||
name = "io.elementary.greeter.desktop";
|
||||
}];
|
||||
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
@ -33,17 +28,10 @@ in
|
|||
|
||||
config = mkIf (ldmcfg.enable && cfg.enable) {
|
||||
|
||||
warnings = [
|
||||
''
|
||||
The Pantheon greeter is suboptimal in NixOS and can possibly put you in
|
||||
a situation where you cannot start a session when switching desktopManagers.
|
||||
''
|
||||
];
|
||||
|
||||
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
|
||||
|
||||
services.xserver.displayManager.lightdm.greeter = mkDefault {
|
||||
package = xgreeters;
|
||||
package = pkgs.pantheon.elementary-greeter.xgreeters;
|
||||
name = "io.elementary.greeter";
|
||||
};
|
||||
|
||||
|
|
|
@ -90,9 +90,7 @@ lib.makeScope pkgs.newScope (self: with self; {
|
|||
|
||||
elementary-default-settings = callPackage ./desktop/elementary-default-settings { };
|
||||
|
||||
elementary-greeter = callPackage ./desktop/elementary-greeter {
|
||||
inherit (gnome3) gnome-desktop;
|
||||
};
|
||||
elementary-greeter = callPackage ./desktop/elementary-greeter { };
|
||||
|
||||
elementary-print-shim = callPackage ./desktop/elementary-print-shim { };
|
||||
|
||||
|
|
|
@ -1,20 +1,41 @@
|
|||
{ stdenv, fetchFromGitHub, pantheon, pkgconfig, substituteAll, meson
|
||||
, ninja, vala, desktop-file-utils, gtk3, granite, libgee, elementary-settings-daemon
|
||||
, gnome-desktop, mutter, elementary-icon-theme, wingpanel-with-indicators
|
||||
, elementary-gtk-theme, nixos-artwork, lightdm, numlockx
|
||||
, clutter-gtk, libGL, dbus, wrapGAppsHook }:
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, linkFarm
|
||||
, elementary-greeter
|
||||
, pantheon
|
||||
, pkgconfig
|
||||
, meson
|
||||
, ninja
|
||||
, vala
|
||||
, desktop-file-utils
|
||||
, gtk3
|
||||
, granite
|
||||
, libgee
|
||||
, elementary-settings-daemon
|
||||
, mutter
|
||||
, elementary-icon-theme
|
||||
, wingpanel-with-indicators
|
||||
, elementary-gtk-theme
|
||||
, nixos-artwork
|
||||
, lightdm
|
||||
, gdk-pixbuf
|
||||
, clutter-gtk
|
||||
, dbus
|
||||
, accountsservice
|
||||
, wrapGAppsHook
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "elementary-greeter";
|
||||
version = "3.3.1";
|
||||
version = "unstable-2019-09-10";
|
||||
|
||||
repoName = "greeter";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elementary";
|
||||
repo = repoName;
|
||||
rev = version;
|
||||
sha256 = "1vkq4z0hrmvzv4sh2qkxjajdxcycd1zj97a3pc8n4yb858pqfyzc";
|
||||
rev = "cad7d28d2b40ed04f6ce49ab44408297b5c69468";
|
||||
sha256 = "0m8iq04wdwgg6arm7dzwi7a0snxvss62zpnw2knpr6lp77vd7hqr";
|
||||
};
|
||||
|
||||
passthru = {
|
||||
|
@ -22,6 +43,11 @@ stdenv.mkDerivation rec {
|
|||
inherit repoName;
|
||||
attrPath = pname;
|
||||
};
|
||||
|
||||
xgreeters = linkFarm "pantheon-greeter-xgreeters" [{
|
||||
path = "${elementary-greeter}/share/xgreeters/io.elementary.greeter.desktop";
|
||||
name = "io.elementary.greeter.desktop";
|
||||
}];
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -34,38 +60,32 @@ stdenv.mkDerivation rec {
|
|||
];
|
||||
|
||||
buildInputs = [
|
||||
clutter-gtk
|
||||
elementary-icon-theme
|
||||
accountsservice
|
||||
clutter-gtk # else we get could not generate cargs for mutter-clutter-2
|
||||
elementary-gtk-theme
|
||||
elementary-icon-theme
|
||||
elementary-settings-daemon
|
||||
gnome-desktop
|
||||
gdk-pixbuf
|
||||
granite
|
||||
gtk3
|
||||
libgee
|
||||
libGL
|
||||
lightdm
|
||||
mutter
|
||||
wingpanel-with-indicators
|
||||
];
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./gsd.patch;
|
||||
elementary_settings_daemon = "${elementary-settings-daemon}/libexec/";
|
||||
})
|
||||
(substituteAll {
|
||||
src = ./numlockx.patch;
|
||||
inherit numlockx;
|
||||
})
|
||||
./01-sysconfdir-install.patch
|
||||
./hardcode-theme.patch
|
||||
];
|
||||
|
||||
mesonFlags = [
|
||||
# A hook does this but after wrapGAppsHook so the files never get wrapped.
|
||||
"--sbindir=${placeholder "out"}/bin"
|
||||
# baked into the program for discovery of the greeter configuration
|
||||
"--sysconfdir=/etc"
|
||||
# We use the patched gnome-settings-daemon
|
||||
"-Dubuntu-patched-gsd=true"
|
||||
"-Dgsd-dir=${elementary-settings-daemon}/libexec/" # trailing slash is needed
|
||||
];
|
||||
|
||||
patches = [
|
||||
./sysconfdir-install.patch
|
||||
];
|
||||
|
||||
preFixup = ''
|
||||
|
@ -76,18 +96,19 @@ stdenv.mkDerivation rec {
|
|||
# for `wingpanel -g`
|
||||
--prefix PATH : "${wingpanel-with-indicators}/bin"
|
||||
|
||||
# TODO: they should be using meson for this
|
||||
# See: https://github.com/elementary/greeter/blob/19c0730fded4e9ddec5a491f0e78f83c7c04eb59/src/PantheonGreeter.vala#L451
|
||||
# for the compositor
|
||||
--prefix PATH : "$out/bin"
|
||||
)
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
substituteInPlace $out/share/xgreeters/io.elementary.greeter.desktop \
|
||||
--replace "Exec=io.elementary.greeter" "Exec=$out/bin/io.elementary.greeter"
|
||||
|
||||
# Use NixOS default wallpaper
|
||||
substituteInPlace $out/etc/lightdm/io.elementary.greeter.conf \
|
||||
--replace "#default-wallpaper=/usr/share/backgrounds/elementaryos-default" "default-wallpaper=${nixos-artwork.wallpapers.simple-dark-gray}/share/artwork/gnome/nix-wallpaper-simple-dark-gray.png"
|
||||
--replace "#default-wallpaper=/usr/share/backgrounds/elementaryos-default" \
|
||||
"default-wallpaper=${nixos-artwork.wallpapers.simple-dark-gray}/share/artwork/gnome/nix-wallpaper-simple-dark-gray.png"
|
||||
|
||||
substituteInPlace $out/share/xgreeters/io.elementary.greeter.desktop \
|
||||
--replace "Exec=io.elementary.greeter" "Exec=$out/bin/io.elementary.greeter"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/src/meson.build b/src/meson.build
|
||||
index 2450c1a..a908d11 100644
|
||||
--- a/src/meson.build
|
||||
+++ b/src/meson.build
|
||||
@@ -1,7 +1,7 @@
|
||||
conf_data = configuration_data()
|
||||
conf_data.set('CONF_DIR', join_paths(get_option('sysconfdir'), 'lightdm'))
|
||||
conf_data.set('GETTEXT_PACKAGE', meson.project_name())
|
||||
-conf_data.set('GSD_DIR', '/usr/lib/gnome-settings-daemon/')
|
||||
+conf_data.set('GSD_DIR', '@elementary_settings_daemon@')
|
||||
conf_data.set('VERSION', meson.project_version())
|
||||
config_header = configure_file (
|
||||
input: 'config.vala.in',
|
|
@ -1,15 +0,0 @@
|
|||
diff --git a/src/PantheonGreeter.vala b/src/PantheonGreeter.vala
|
||||
index 11aa4c0..daf4a8a 100644
|
||||
--- a/src/PantheonGreeter.vala
|
||||
+++ b/src/PantheonGreeter.vala
|
||||
@@ -474,6 +474,10 @@ public static int main (string [] args) {
|
||||
Gdk.CursorType.LEFT_PTR);
|
||||
Gdk.get_default_root_window ().set_cursor (cursor);
|
||||
|
||||
+ var settings = Gtk.Settings.get_default ();
|
||||
+ settings.gtk_icon_theme_name = "elementary";
|
||||
+ settings.gtk_theme_name = "elementary";
|
||||
+
|
||||
var icon_theme = Gtk.IconTheme.get_default ();
|
||||
icon_theme.add_resource_path ("/io/elementary/greeter/icons");
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/src/PantheonGreeter.vala b/src/PantheonGreeter.vala
|
||||
index 11aa4c0..ae7bf7e 100644
|
||||
--- a/src/PantheonGreeter.vala
|
||||
+++ b/src/PantheonGreeter.vala
|
||||
@@ -163,7 +163,7 @@ public class PantheonGreeter : Gtk.Window {
|
||||
warning (e.message);
|
||||
}
|
||||
if (activate_numlock) {
|
||||
- Granite.Services.System.execute_command ("/usr/bin/numlockx on");
|
||||
+ Granite.Services.System.execute_command ("@numlockx@/bin/numlockx on");
|
||||
}
|
||||
|
||||
var screensaver_timeout = 60;
|
|
@ -1,14 +1,14 @@
|
|||
From 2384bee55a46eac44eb9d329be4c2a097e053ae1 Mon Sep 17 00:00:00 2001
|
||||
From 7bb0d507cbb0122f167127b9f6460bd53d8234de Mon Sep 17 00:00:00 2001
|
||||
From: worldofpeace <worldofpeace@users.noreply.github.com>
|
||||
Date: Tue, 17 Jul 2018 07:04:18 -0400
|
||||
Subject: [PATCH 1/1] 'sysconfdir' will be etc not /etc for install
|
||||
Date: Sat, 16 Mar 2019 16:07:24 -0400
|
||||
Subject: [PATCH] 'sysconfdir' will be etc not /etc for install
|
||||
|
||||
---
|
||||
data/meson.build | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/data/meson.build b/data/meson.build
|
||||
index 7621b03..7c08eaf 100644
|
||||
index fd54b75..b1120ae 100644
|
||||
--- a/data/meson.build
|
||||
+++ b/data/meson.build
|
||||
@@ -20,7 +20,7 @@ i18n.merge_file (
|
||||
|
@ -19,7 +19,7 @@ index 7621b03..7c08eaf 100644
|
|||
+ install_dir: join_paths(get_option('prefix'), 'etc', 'lightdm')
|
||||
)
|
||||
|
||||
install_data(
|
||||
test (
|
||||
--
|
||||
2.17.1
|
||||
2.19.2
|
||||
|
|
@ -14,6 +14,8 @@
|
|||
, mutter
|
||||
, json-glib
|
||||
, python3
|
||||
, elementary-gtk-theme
|
||||
, elementary-icon-theme
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
@ -44,6 +46,8 @@ stdenv.mkDerivation rec {
|
|||
];
|
||||
|
||||
buildInputs = [
|
||||
elementary-gtk-theme
|
||||
elementary-icon-theme
|
||||
gala
|
||||
granite
|
||||
gtk3
|
||||
|
|
Loading…
Reference in a new issue