nixpkgs/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix
Jan Tojnar eb04659fc2 treewide: wrapGAppsHook → wrapGAppsHook3
This was achieved using the following command:

    sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b')

And then manually reverted the following changes:

- alias in top-level.nix
- function name in wrap-gapps-hook.sh
- comment in postFixup of at-spi2-core
- comment in gtk4
- comment in preFixup of 1password-gui/linux.nix
- comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix
- comment in postFixup of telegram-desktop
- comment in postFixup of fwupd
- buildCommand of mongodb-compass
- postFixup of xflux-gui
- comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config
- description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
2024-04-27 02:23:22 +02:00

129 lines
3.0 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, nix-update-script
, linkFarm
, substituteAll
, elementary-greeter
, pkg-config
, meson
, ninja
, vala
, desktop-file-utils
, gtk3
, granite
, libgee
, libhandy
, gnome-settings-daemon
, mesa
, mutter
, elementary-icon-theme
, wingpanel-with-indicators
, elementary-gtk-theme
, nixos-artwork
, lightdm
, gdk-pixbuf
, dbus
, accountsservice
, wrapGAppsHook3
}:
stdenv.mkDerivation rec {
pname = "elementary-greeter";
version = "7.0.0";
src = fetchFromGitHub {
owner = "elementary";
repo = "greeter";
rev = version;
sha256 = "sha256-m/xuaMCAPoqhl/M547mdafBPBu3UhHmVmBIUKQoS5L8=";
};
patches = [
./sysconfdir-install.patch
# Needed until https://github.com/elementary/greeter/issues/360 is fixed
(substituteAll {
src = ./hardcode-fallback-background.patch;
default_wallpaper = "${nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}";
})
];
nativeBuildInputs = [
desktop-file-utils
meson
ninja
pkg-config
vala
wrapGAppsHook3
];
buildInputs = [
accountsservice
elementary-icon-theme
gnome-settings-daemon
gdk-pixbuf
granite
gtk3
libgee
libhandy
lightdm
mesa # for libEGL
mutter
];
mesonFlags = [
# A hook does this but after wrapGAppsHook3 so the files never get wrapped.
"--sbindir=${placeholder "out"}/bin"
# baked into the program for discovery of the greeter configuration
"--sysconfdir=/etc"
"-Dgsd-dir=${gnome-settings-daemon}/libexec/" # trailing slash is needed
];
preFixup = ''
gappsWrapperArgs+=(
# dbus-launch needed in path
--prefix PATH : "${dbus}/bin"
# for `io.elementary.wingpanel -g`
--prefix PATH : "${wingpanel-with-indicators}/bin"
# for the compositor
--prefix PATH : "$out/bin"
# the GTK theme is hardcoded
--prefix XDG_DATA_DIRS : "${elementary-gtk-theme}/share"
# the icon theme is hardcoded
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
)
'';
postFixup = ''
# 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.gnomeFilePath}"
substituteInPlace $out/share/xgreeters/io.elementary.greeter.desktop \
--replace "Exec=io.elementary.greeter" "Exec=$out/bin/io.elementary.greeter"
'';
passthru = {
updateScript = nix-update-script { };
xgreeters = linkFarm "pantheon-greeter-xgreeters" [{
path = "${elementary-greeter}/share/xgreeters/io.elementary.greeter.desktop";
name = "io.elementary.greeter.desktop";
}];
};
meta = with lib; {
description = "LightDM Greeter for Pantheon";
homepage = "https://github.com/elementary/greeter";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = teams.pantheon.members;
mainProgram = "io.elementary.greeter";
};
}