Merge pull request #68492 from worldofpeace/pam-sessionvariables

Introduce environment.profileRelativeSessionVariables
This commit is contained in:
worldofpeace 2019-09-18 11:15:26 -04:00 committed by GitHub
commit ee29fbd9a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 176 additions and 155 deletions

View file

@ -157,6 +157,8 @@ in
# terminal instead of logging out of X11). # terminal instead of logging out of X11).
environment.variables = config.environment.sessionVariables; environment.variables = config.environment.sessionVariables;
environment.profileRelativeEnvVars = config.environment.profileRelativeSessionVariables;
environment.shellAliases = mapAttrs (name: mkDefault) { environment.shellAliases = mapAttrs (name: mkDefault) {
ls = "ls --color=tty"; ls = "ls --color=tty";
ll = "ls -l"; ll = "ls -l";

View file

@ -8,6 +8,11 @@ let
cfg = config.environment; cfg = config.environment;
pamProfiles =
map
(replaceStrings ["$HOME" "$USER"] ["@{HOME}" "@{PAM_USER}"])
cfg.profiles;
in in
{ {
@ -18,25 +23,76 @@ in
default = {}; default = {};
description = '' description = ''
A set of environment variables used in the global environment. A set of environment variables used in the global environment.
These variables will be set by PAM. These variables will be set by PAM early in the login process.
The value of each variable can be either a string or a list of
strings. The latter is concatenated, interspersed with colon The value of each session variable can be either a string or a
characters. list of strings. The latter is concatenated, interspersed with
colon characters.
Note, due to limitations in the PAM format values may not
contain the <literal>"</literal> character.
Also, these variables are merged into
<xref linkend="opt-environment.variables"/> and it is
therefore not possible to use PAM style variables such as
<code>@{HOME}</code>.
''; '';
type = with types; attrsOf (either str (listOf str)); type = with types; attrsOf (either str (listOf str));
apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v); apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v);
}; };
environment.profileRelativeSessionVariables = mkOption {
type = types.attrsOf (types.listOf types.str);
example = { PATH = [ "/bin" ]; MANPATH = [ "/man" "/share/man" ]; };
description = ''
Attribute set of environment variable used in the global
environment. These variables will be set by PAM early in the
login process.
Variable substitution is available as described in
<citerefentry>
<refentrytitle>pam_env.conf</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry>.
Each attribute maps to a list of relative paths. Each relative
path is appended to the each profile of
<option>environment.profiles</option> to form the content of
the corresponding environment variable.
Also, these variables are merged into
<xref linkend="opt-environment.profileRelativeEnvVars"/> and it is
therefore not possible to use PAM style variables such as
<code>@{HOME}</code>.
'';
};
}; };
config = { config = {
system.build.pamEnvironment = pkgs.writeText "pam-environment" system.build.pamEnvironment =
'' let
${concatStringsSep "\n" ( suffixedVariables =
(mapAttrsToList (n: v: ''${n}="${concatStringsSep ":" v}"'') flip mapAttrs cfg.profileRelativeSessionVariables (envVar: suffixes:
(zipAttrsWith (const concatLists) ([ (mapAttrs (n: v: [ v ]) cfg.sessionVariables) ]))))} flip concatMap pamProfiles (profile:
''; map (suffix: "${profile}${suffix}") suffixes
)
);
pamVariable = n: v:
''${n} DEFAULT="${concatStringsSep ":" (toList v)}"'';
pamVariables =
concatStringsSep "\n"
(mapAttrsToList pamVariable
(zipAttrsWith (n: concatLists)
[
(mapAttrs (n: toList) cfg.sessionVariables)
suffixedVariables
]));
in
pkgs.writeText "pam-environment" "${pamVariables}\n";
}; };

View file

@ -12,7 +12,7 @@
source = "${config.system.path}/share/terminfo"; source = "${config.system.path}/share/terminfo";
}; };
environment.profileRelativeEnvVars = { environment.profileRelativeSessionVariables = {
TERMINFO_DIRS = [ "/share/terminfo" ]; TERMINFO_DIRS = [ "/share/terminfo" ];
}; };

View file

@ -7,19 +7,19 @@ with lib;
type = types.bool; type = types.bool;
default = true; default = true;
description = '' description = ''
Whether to install files to support the Whether to install files to support the
<link xlink:href="https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">XDG Icon Theme specification</link>. <link xlink:href="https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">XDG Icon Theme specification</link>.
''; '';
}; };
}; };
config = mkIf config.xdg.icons.enable { config = mkIf config.xdg.icons.enable {
environment.pathsToLink = [ environment.pathsToLink = [
"/share/icons" "/share/icons"
"/share/pixmaps" "/share/pixmaps"
]; ];
environment.profileRelativeEnvVars = { environment.profileRelativeSessionVariables = {
XCURSOR_PATH = [ "/share/icons" ]; XCURSOR_PATH = [ "/share/icons" ];
}; };
}; };

View file

@ -22,6 +22,8 @@ in
EDITOR = mkDefault "nano"; EDITOR = mkDefault "nano";
XCURSOR_PATH = [ "$HOME/.icons" ]; XCURSOR_PATH = [ "$HOME/.icons" ];
XDG_CONFIG_DIRS = [ "/etc/xdg" ]; # needs to be before profile-relative paths to allow changes through environment.etc XDG_CONFIG_DIRS = [ "/etc/xdg" ]; # needs to be before profile-relative paths to allow changes through environment.etc
GTK_DATA_PREFIX = "${config.system.path}"; # needed for gtk2 apps to find themes
GTK_EXE_PREFIX = "${config.system.path}";
}; };
environment.profiles = mkAfter environment.profiles = mkAfter
@ -30,7 +32,7 @@ in
]; ];
# TODO: move most of these elsewhere # TODO: move most of these elsewhere
environment.profileRelativeEnvVars = environment.profileRelativeSessionVariables =
{ PATH = [ "/bin" ]; { PATH = [ "/bin" ];
INFOPATH = [ "/info" "/share/info" ]; INFOPATH = [ "/info" "/share/info" ];
KDEDIRS = [ "" ]; KDEDIRS = [ "" ];

View file

@ -415,7 +415,7 @@ let
# Session management. # Session management.
${optionalString cfg.setEnvironment '' ${optionalString cfg.setEnvironment ''
session required pam_env.so envfile=${config.system.build.pamEnvironment} session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
''} ''}
session required pam_unix.so session required pam_unix.so
${optionalString cfg.setLoginUid ${optionalString cfg.setLoginUid

View file

@ -95,13 +95,7 @@ in {
environment.systemPackages = [ cfg.package editorScript desktopApplicationFile ]; environment.systemPackages = [ cfg.package editorScript desktopApplicationFile ];
environment.variables = { environment.variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "${editorScript}/bin/emacseditor");
# This is required so that GTK applications launched from Emacs
# get properly themed:
GTK_DATA_PREFIX = "${config.system.path}";
} // (if cfg.defaultEditor then {
EDITOR = mkOverride 900 "${editorScript}/bin/emacseditor";
} else {});
}; };
meta.doc = ./emacs.xml; meta.doc = ./emacs.xml;

View file

@ -48,10 +48,6 @@ in
services.xserver.desktopManager.session = [ services.xserver.desktopManager.session = [
{ name = "Enlightenment"; { name = "Enlightenment";
start = '' start = ''
# Set GTK_DATA_PREFIX so that GTK can find the themes
export GTK_DATA_PREFIX=${config.system.path}
# find theme engines
export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0
export XDG_MENU_PREFIX=e- export XDG_MENU_PREFIX=e-
export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}" export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}"

View file

@ -48,12 +48,6 @@ in
name = "mate"; name = "mate";
bgSupport = true; bgSupport = true;
start = '' start = ''
# Set GTK_DATA_PREFIX so that GTK can find the themes
export GTK_DATA_PREFIX=${config.system.path}
# Find theme engines
export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0
export XDG_MENU_PREFIX=mate- export XDG_MENU_PREFIX=mate-
# Let caja find extensions # Let caja find extensions

View file

@ -107,12 +107,6 @@ in
start = '' start = ''
${cfg.extraSessionCommands} ${cfg.extraSessionCommands}
# Set GTK_PATH so that GTK can find the theme engines.
export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
# Set GTK_DATA_PREFIX so that GTK can find the Xfce themes.
export GTK_DATA_PREFIX=${config.system.path}
${pkgs.runtimeShell} ${pkgs.xfce.xinitrc} & ${pkgs.runtimeShell} ${pkgs.xfce.xinitrc} &
waitPID=$! waitPID=$!
''; '';

View file

@ -114,12 +114,6 @@ in
name = "xfce4-14"; name = "xfce4-14";
bgSupport = true; bgSupport = true;
start = '' start = ''
# Set GTK_PATH so that GTK can find the theme engines.
export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
# Set GTK_DATA_PREFIX so that GTK can find the Xfce themes.
export GTK_DATA_PREFIX=${config.system.path}
${pkgs.runtimeShell} ${pkgs.xfce4-14.xinitrc} & ${pkgs.runtimeShell} ${pkgs.xfce4-14.xinitrc} &
waitPID=$! waitPID=$!
''; '';

View file

@ -142,8 +142,6 @@ in
GDM_X_SERVER_EXTRA_ARGS = toString GDM_X_SERVER_EXTRA_ARGS = toString
(filter (arg: arg != "-terminate") cfg.xserverArgs); (filter (arg: arg != "-terminate") cfg.xserverArgs);
XDG_DATA_DIRS = "${cfg.session.desktops}/share/"; XDG_DATA_DIRS = "${cfg.session.desktops}/share/";
# Find the mouse
XCURSOR_PATH = "~/.icons:${pkgs.gnome3.adwaita-icon-theme}/share/icons";
} // optionalAttrs (xSessionWrapper != null) { } // optionalAttrs (xSessionWrapper != null) {
# Make GDM use this wrapper before running the session, which runs the # Make GDM use this wrapper before running the session, which runs the
# configured setupCommands. This relies on a patched GDM which supports # configured setupCommands. This relies on a patched GDM which supports
@ -262,7 +260,7 @@ in
password required pam_deny.so password required pam_deny.so
session required pam_succeed_if.so audit quiet_success user = gdm session required pam_succeed_if.so audit quiet_success user = gdm
session required pam_env.so envfile=${config.system.build.pamEnvironment} session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
session optional ${pkgs.systemd}/lib/security/pam_systemd.so session optional ${pkgs.systemd}/lib/security/pam_systemd.so
session optional pam_keyinit.so force revoke session optional pam_keyinit.so force revoke
session optional pam_permit.so session optional pam_permit.so

View file

@ -10,32 +10,6 @@ let
icons = cfg.iconTheme.package; icons = cfg.iconTheme.package;
cursors = cfg.cursorTheme.package; cursors = cfg.cursorTheme.package;
# We need a few things in the environment for the greeter to run with
# fonts/icons.
wrappedEnsoGreeter = pkgs.runCommand "lightdm-enso-os-greeter" {
buildInputs = [ pkgs.makeWrapper ];
preferLocalBuild = true;
} ''
# This wrapper ensures that we actually get themes
makeWrapper ${pkgs.lightdm-enso-os-greeter}/bin/pantheon-greeter \
$out/greeter \
--prefix PATH : "${pkgs.glibc.bin}/bin" \
--set GDK_PIXBUF_MODULE_FILE "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" \
--set GTK_PATH "${theme}:${pkgs.gtk3.out}" \
--set GTK_EXE_PREFIX "${theme}" \
--set GTK_DATA_PREFIX "${theme}" \
--set XDG_DATA_DIRS "${theme}/share:${icons}/share:${cursors}/share" \
--set XDG_CONFIG_HOME "${theme}/share"
cat - > $out/lightdm-enso-os-greeter.desktop << EOF
[Desktop Entry]
Name=LightDM Greeter
Comment=This runs the LightDM Greeter
Exec=$out/greeter
Type=Application
EOF
'';
ensoGreeterConf = pkgs.writeText "lightdm-enso-os-greeter.conf" '' ensoGreeterConf = pkgs.writeText "lightdm-enso-os-greeter.conf" ''
[greeter] [greeter]
default-wallpaper=${ldmcfg.background} default-wallpaper=${ldmcfg.background}
@ -144,10 +118,16 @@ in {
config = mkIf (ldmcfg.enable && cfg.enable) { config = mkIf (ldmcfg.enable && cfg.enable) {
environment.etc."lightdm/greeter.conf".source = ensoGreeterConf; environment.etc."lightdm/greeter.conf".source = ensoGreeterConf;
environment.systemPackages = [
cursors
icons
theme
];
services.xserver.displayManager.lightdm = { services.xserver.displayManager.lightdm = {
greeter = mkDefault { greeter = mkDefault {
package = wrappedEnsoGreeter; package = pkgs.lightdm-enso-os-greeter.xgreeters;
name = "lightdm-enso-os-greeter"; name = "pantheon-greeter";
}; };
greeters = { greeters = {

View file

@ -15,34 +15,6 @@ let
icons = cfg.iconTheme.package; icons = cfg.iconTheme.package;
cursors = cfg.cursorTheme.package; cursors = cfg.cursorTheme.package;
# The default greeter provided with this expression is the GTK greeter.
# Again, we need a few things in the environment for the greeter to run with
# fonts/icons.
wrappedGtkGreeter = pkgs.runCommand "lightdm-gtk-greeter" {
buildInputs = [ pkgs.makeWrapper ];
preferLocalBuild = true;
} ''
# This wrapper ensures that we actually get themes
makeWrapper ${pkgs.lightdm_gtk_greeter}/sbin/lightdm-gtk-greeter \
$out/greeter \
--prefix PATH : "${lib.getBin pkgs.stdenv.cc.libc}/bin" \
--set GDK_PIXBUF_MODULE_FILE "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" \
--set GTK_PATH "${theme}:${pkgs.gtk3.out}" \
--set GTK_EXE_PREFIX "${theme}" \
--set GTK_DATA_PREFIX "${theme}" \
--set XDG_DATA_DIRS "${theme}/share:${icons}/share" \
--set XDG_CONFIG_HOME "${theme}/share" \
--set XCURSOR_PATH "${cursors}/share/icons"
cat - > $out/lightdm-gtk-greeter.desktop << EOF
[Desktop Entry]
Name=LightDM Greeter
Comment=This runs the LightDM Greeter
Exec=$out/greeter
Type=Application
EOF
'';
gtkGreeterConf = writeText "lightdm-gtk-greeter.conf" gtkGreeterConf = writeText "lightdm-gtk-greeter.conf"
'' ''
[greeter] [greeter]
@ -185,10 +157,16 @@ in
config = mkIf (ldmcfg.enable && cfg.enable) { config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeter = mkDefault { services.xserver.displayManager.lightdm.greeter = mkDefault {
package = wrappedGtkGreeter; package = pkgs.lightdm_gtk_greeter.xgreeters;
name = "lightdm-gtk-greeter"; name = "lightdm-gtk-greeter";
}; };
environment.systemPackages = [
cursors
icons
theme
];
environment.etc."lightdm/lightdm-gtk-greeter.conf".source = gtkGreeterConf; environment.etc."lightdm/lightdm-gtk-greeter.conf".source = gtkGreeterConf;
}; };

View file

@ -8,11 +8,6 @@ let
ldmcfg = dmcfg.lightdm; ldmcfg = dmcfg.lightdm;
cfg = ldmcfg.greeters.mini; cfg = ldmcfg.greeters.mini;
xgreeters = pkgs.linkFarm "lightdm-mini-greeter-xgreeters" [{
path = "${pkgs.lightdm-mini-greeter}/share/xgreeters/lightdm-mini-greeter.desktop";
name = "lightdm-mini-greeter.desktop";
}];
miniGreeterConf = pkgs.writeText "lightdm-mini-greeter.conf" miniGreeterConf = pkgs.writeText "lightdm-mini-greeter.conf"
'' ''
[greeter] [greeter]
@ -90,7 +85,7 @@ in
services.xserver.displayManager.lightdm.greeters.gtk.enable = false; services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
services.xserver.displayManager.lightdm.greeter = mkDefault { services.xserver.displayManager.lightdm.greeter = mkDefault {
package = xgreeters; package = pkgs.lightdm-mini-greeter.xgreeters;
name = "lightdm-mini-greeter"; name = "lightdm-mini-greeter";
}; };

View file

@ -249,7 +249,7 @@ in
password required pam_deny.so password required pam_deny.so
session required pam_succeed_if.so audit quiet_success user = lightdm session required pam_succeed_if.so audit quiet_success user = lightdm
session required pam_env.so envfile=${config.system.build.pamEnvironment} session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
session optional ${pkgs.systemd}/lib/security/pam_systemd.so session optional ${pkgs.systemd}/lib/security/pam_systemd.so
session optional pam_keyinit.so force revoke session optional pam_keyinit.so force revoke
session optional pam_permit.so session optional pam_permit.so

View file

@ -219,8 +219,6 @@ in
# Load themes from system environment # Load themes from system environment
QT_PLUGIN_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtPluginPrefix; QT_PLUGIN_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtPluginPrefix;
QML2_IMPORT_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtQmlPrefix; QML2_IMPORT_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtQmlPrefix;
XDG_DATA_DIRS = "/run/current-system/sw/share";
}; };
execCmd = "exec /run/current-system/sw/bin/sddm"; execCmd = "exec /run/current-system/sw/bin/sddm";
@ -242,7 +240,7 @@ in
password required pam_deny.so password required pam_deny.so
session required pam_succeed_if.so audit quiet_success user = sddm session required pam_succeed_if.so audit quiet_success user = sddm
session required pam_env.so envfile=${config.system.build.pamEnvironment} session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
session optional ${pkgs.systemd}/lib/security/pam_systemd.so session optional ${pkgs.systemd}/lib/security/pam_systemd.so
session optional pam_keyinit.so force revoke session optional pam_keyinit.so force revoke
session optional pam_permit.so session optional pam_permit.so

View file

@ -1,6 +1,6 @@
{ stdenv, fetchgit, pkgconfig { stdenv, fetchgit, pkgconfig, linkFarm, lightdm-enso-os-greeter
, dbus, pcre, epoxy, libXdmcp, at-spi2-core, libxklavier, libxkbcommon, libpthreadstubs , dbus, pcre, epoxy, libXdmcp, at-spi2-core, libxklavier, libxkbcommon, libpthreadstubs
, gtk3, vala, cmake, libgee, libX11, lightdm, gdk-pixbuf, clutter-gtk }: , gtk3, vala, cmake, libgee, libX11, lightdm, gdk-pixbuf, clutter-gtk, wrapGAppsHook, librsvg }:
stdenv.mkDerivation { stdenv.mkDerivation {
version = "0.2.1"; version = "0.2.1";
@ -12,12 +12,21 @@ stdenv.mkDerivation {
sha256 = "11jm181jq1vbn83h235avpdxz7pqq6prqyzki5yryy53mkj4kgxz"; sha256 = "11jm181jq1vbn83h235avpdxz7pqq6prqyzki5yryy53mkj4kgxz";
}; };
patches = [
./fix-paths.patch
];
nativeBuildInputs = [
cmake
pkgconfig
vala
wrapGAppsHook
];
buildInputs = [ buildInputs = [
dbus dbus
gtk3 gtk3
pcre pcre
vala
cmake
epoxy epoxy
libgee libgee
libX11 libX11
@ -29,31 +38,21 @@ stdenv.mkDerivation {
at-spi2-core at-spi2-core
libxkbcommon libxkbcommon
libpthreadstubs libpthreadstubs
librsvg
]; ];
nativeBuildInputs = [
pkgconfig
];
postPatch = ''
sed -i "s@\''${CMAKE_INSTALL_PREFIX}/@@" greeter/CMakeLists.txt
'';
preConfigure = '' preConfigure = ''
cd greeter cd greeter
''; '';
installFlags = [ passthru.xgreeters = linkFarm "enso-os-greeter-xgreeters" [{
"DESTDIR=$(out)" path = "${lightdm-enso-os-greeter}/share/xgreeters/pantheon-greeter.desktop";
]; name = "pantheon-greeter.desktop";
}];
preFixup = ''
mv $out/usr/* $out
rm -r $out/usr
'';
postFixup = '' postFixup = ''
rm -r $out/sbin substituteInPlace $out/share/xgreeters/pantheon-greeter.desktop \
--replace "pantheon-greeter" "$out/bin/pantheon-greeter"
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {

View file

@ -0,0 +1,24 @@
diff --git a/greeter/CMakeLists.txt b/greeter/CMakeLists.txt
index 57aebb0..ab50bff 100644
--- a/greeter/CMakeLists.txt
+++ b/greeter/CMakeLists.txt
@@ -9,7 +9,6 @@ list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set (CONF_DIR "/etc/lightdm")
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
set (PKGDATADIR "${DATADIR}/enso/greeter")
-set (CMAKE_INSTALL_PREFIX /usr)
set (VERSION "1.0.6")
@@ -94,9 +93,9 @@ glib_compile_resources (GLIB_RESOURCES_CSS SOURCE data/css.gresource.xml)
add_executable (pantheon-greeter ${VALA_C} ${GLIB_RESOURCES_CSS})
target_link_libraries(pantheon-greeter m)
-install (TARGETS pantheon-greeter RUNTIME DESTINATION sbin)
+install (TARGETS pantheon-greeter RUNTIME DESTINATION bin)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/pantheon-greeter.desktop DESTINATION share/xgreeters)
-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/greeter.conf DESTINATION ${CONF_DIR})
+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/greeter.conf DESTINATION etc/lightdm)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/fingerprint.svg DESTINATION ${PKGDATADIR})
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/power.svg DESTINATION ${PKGDATADIR})
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/checked.svg DESTINATION ${PKGDATADIR})

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, lightdm, gtk3 }: { stdenv, linkFarm, lightdm-mini-greeter, fetchFromGitHub, autoreconfHook, pkgconfig, lightdm, gtk3, glib, gdk-pixbuf, wrapGAppsHook, librsvg }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "lightdm-mini-greeter"; pname = "lightdm-mini-greeter";
@ -11,17 +11,22 @@ stdenv.mkDerivation rec {
sha256 = "1qi0bsqi8z2zv3303ww0kd7bciz6qx8na5bkvgrqlwyvq31czai5"; sha256 = "1qi0bsqi8z2zv3303ww0kd7bciz6qx8na5bkvgrqlwyvq31czai5";
}; };
nativeBuildInputs = [ autoreconfHook pkgconfig ]; nativeBuildInputs = [ autoreconfHook pkgconfig wrapGAppsHook ];
buildInputs = [ lightdm gtk3 ]; buildInputs = [ lightdm gtk3 glib gdk-pixbuf librsvg ];
configureFlags = [ "--sysconfdir=/etc" ]; configureFlags = [ "--sysconfdir=/etc" ];
makeFlags = [ "configdir=$(out)/etc" ]; makeFlags = [ "configdir=${placeholder "out"}/etc" ];
postInstall = '' postInstall = ''
substituteInPlace "$out/share/xgreeters/lightdm-mini-greeter.desktop" \ substituteInPlace "$out/share/xgreeters/lightdm-mini-greeter.desktop" \
--replace "Exec=lightdm-mini-greeter" "Exec=$out/bin/lightdm-mini-greeter" --replace "Exec=lightdm-mini-greeter" "Exec=$out/bin/lightdm-mini-greeter"
''; '';
passthru.xgreeters = linkFarm "lightdm-mini-greeter-xgreeters" [{
path = "${lightdm-mini-greeter}/share/xgreeters/lightdm-mini-greeter.desktop";
name = "lightdm-mini-greeter.desktop";
}];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A minimal, configurable, single-user GTK3 LightDM greeter"; description = "A minimal, configurable, single-user GTK3 LightDM greeter";
homepage = https://github.com/prikhi/lightdm-mini-greeter; homepage = https://github.com/prikhi/lightdm-mini-greeter;

View file

@ -1,7 +1,18 @@
{ stdenv, fetchurl, lightdm, pkgconfig, intltool { stdenv
, hicolor-icon-theme, makeWrapper , lightdm_gtk_greeter
, useGTK2 ? false, gtk2, gtk3 # gtk3 seems better supported , fetchurl
, exo, at-spi2-core , lightdm
, pkgconfig
, intltool
, linkFarm
, wrapGAppsHook
, useGTK2 ? false
, gtk2
, gtk3 # gtk3 seems better supported
, exo
, at-spi2-core
, librsvg
, hicolor-icon-theme
}: }:
#ToDo: bad icons with gtk2; #ToDo: bad icons with gtk2;
@ -20,14 +31,15 @@ stdenv.mkDerivation rec {
sha256 = "1pis5qyg95pg31dvnfqq34bzgj00hg4vs547r8h60lxjk81z8p15"; sha256 = "1pis5qyg95pg31dvnfqq34bzgj00hg4vs547r8h60lxjk81z8p15";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig intltool wrapGAppsHook ];
buildInputs = [ lightdm exo intltool makeWrapper hicolor-icon-theme ] buildInputs = [ lightdm exo librsvg hicolor-icon-theme ]
++ (if useGTK2 then [ gtk2 ] else [ gtk3 ]); ++ (if useGTK2 then [ gtk2 ] else [ gtk3 ]);
configureFlags = [ configureFlags = [
"--localstatedir=/var" "--localstatedir=/var"
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--disable-indicator-services-command" "--disable-indicator-services-command"
"--sbindir=${placeholder "out"}/bin" # for wrapGAppsHook to wrap automatically
] ++ stdenv.lib.optional useGTK2 "--with-gtk2"; ] ++ stdenv.lib.optional useGTK2 "--with-gtk2";
preConfigure = '' preConfigure = ''
@ -43,11 +55,14 @@ stdenv.mkDerivation rec {
postInstall = '' postInstall = ''
substituteInPlace "$out/share/xgreeters/lightdm-gtk-greeter.desktop" \ substituteInPlace "$out/share/xgreeters/lightdm-gtk-greeter.desktop" \
--replace "Exec=lightdm-gtk-greeter" "Exec=$out/sbin/lightdm-gtk-greeter" --replace "Exec=lightdm-gtk-greeter" "Exec=$out/bin/lightdm-gtk-greeter"
wrapProgram "$out/sbin/lightdm-gtk-greeter" \
--prefix XDG_DATA_DIRS ":" "${hicolor-icon-theme}/share"
''; '';
passthru.xgreeters = linkFarm "lightdm-gtk-greeter-xgreeters" [{
path = "${lightdm_gtk_greeter}/share/xgreeters/lightdm-gtk-greeter.desktop";
name = "lightdm-gtk-greeter.desktop";
}];
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = https://launchpad.net/lightdm-gtk-greeter; homepage = https://launchpad.net/lightdm-gtk-greeter;
platforms = platforms.linux; platforms = platforms.linux;

View file

@ -23,9 +23,6 @@ stdenv.mkDerivation rec {
The Clearlooks-Phénix project aims at creating a GTK3 port of Clearlooks, The Clearlooks-Phénix project aims at creating a GTK3 port of Clearlooks,
the default theme for Gnome 2. Style is also included for GTK2, Unity and the default theme for Gnome 2. Style is also included for GTK2, Unity and
for Metacity, Openbox and Xfwm4 window managers. for Metacity, Openbox and Xfwm4 window managers.
You should install this theme into your user profile and then set
GTK_DATA_PREFIX to `~/.nix-profile`.
''; '';
homepage = https://github.com/jpfleury/clearlooks-phenix; homepage = https://github.com/jpfleury/clearlooks-phenix;
downloadPage = https://github.com/jpfleury/clearlooks-phenix/releases; downloadPage = https://github.com/jpfleury/clearlooks-phenix/releases;