git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #68492 from worldofpeace/pam-sessionvariables

Introduce environment.profileRelativeSessionVariables

commitee29fbd9a2f6b6f8222e4a0711baeb404406aedd authorworldofpeace <worldofpeace@protonmail.ch> dateWed 18 Sep 2019, 11:15 (7 years ago) parenteb597556663a79
22 files changed+176−155
nixos/modules/config/shells-environment.nix+2 nixos/modules/config/system-environment.nix+66−10 nixos/modules/config/terminfo.nix+1−1 nixos/modules/config/xdg/icons.nix+6−6 nixos/modules/programs/environment.nix+3−1 nixos/modules/security/pam.nix+1−1 nixos/modules/services/editors/emacs.nix+1−7 nixos/modules/services/x11/desktop-managers/enlightenment.nix−4 nixos/modules/services/x11/desktop-managers/mate.nix−6 nixos/modules/services/x11/desktop-managers/xfce.nix−6 nixos/modules/services/x11/desktop-managers/xfce4-14.nix−6 nixos/modules/services/x11/display-managers/gdm.nix+1−3 nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix+8−28 nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix+7−29 nixos/modules/services/x11/display-managers/lightdm-greeters/mini.nix+1−6 nixos/modules/services/x11/display-managers/lightdm.nix+1−1 nixos/modules/services/x11/display-managers/sddm.nix+1−3 pkgs/applications/display-managers/lightdm-enso-os-greeter/default.nix+20−21 pkgs/applications/display-managers/lightdm-enso-os-greeter/fix-paths.patch+24 pkgs/applications/display-managers/lightdm-mini-greeter/default.nix+9−4 pkgs/applications/display-managers/lightdm/gtk-greeter.nix+24−9 pkgs/misc/themes/clearlooks-phenix/default.nix−3
nixos/modules/config/shells-environment.nix+2
@@ -157,6 +157,8 @@ in
157157 # terminal instead of logging out of X11).
158158 environment.variables = config.environment.sessionVariables;
159159
160+ environment.profileRelativeEnvVars = config.environment.profileRelativeSessionVariables;
161+
160162 environment.shellAliases = mapAttrs (name: mkDefault) {
161163 ls = "ls --color=tty";
162164 ll = "ls -l";
nixos/modules/config/system-environment.nix+66−10
@@ -8,6 +8,11 @@ let
88
99 cfg = config.environment;
1010
11+ pamProfiles =
12+ map
13+ (replaceStrings ["$HOME" "$USER"] ["@{HOME}" "@{PAM_USER}"])
14+ cfg.profiles;
15+
1116in
1217
1318{
@@ -18,25 +23,76 @@ in
1823 default = {};
1924 description = ''
2025 A set of environment variables used in the global environment.
21− These variables will be set by PAM.
22− The value of each variable can be either a string or a list of
23− strings. The latter is concatenated, interspersed with colon
24− characters.
26+ These variables will be set by PAM early in the login process.
27+
28+ The value of each session variable can be either a string or a
29+ list of strings. The latter is concatenated, interspersed with
30+ colon characters.
31+
32+ Note, due to limitations in the PAM format values may not
33+ contain the <literal>"</literal> character.
34+
35+ Also, these variables are merged into
36+ <xref linkend="opt-environment.variables"/> and it is
37+ therefore not possible to use PAM style variables such as
38+ <code>@{HOME}</code>.
2539 '';
2640 type = with types; attrsOf (either str (listOf str));
2741 apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v);
2842 };
2943
44+ environment.profileRelativeSessionVariables = mkOption {
45+ type = types.attrsOf (types.listOf types.str);
46+ example = { PATH = [ "/bin" ]; MANPATH = [ "/man" "/share/man" ]; };
47+ description = ''
48+ Attribute set of environment variable used in the global
49+ environment. These variables will be set by PAM early in the
50+ login process.
51+
52+ Variable substitution is available as described in
53+ <citerefentry>
54+ <refentrytitle>pam_env.conf</refentrytitle>
55+ <manvolnum>5</manvolnum>
56+ </citerefentry>.
57+
58+ Each attribute maps to a list of relative paths. Each relative
59+ path is appended to the each profile of
60+ <option>environment.profiles</option> to form the content of
61+ the corresponding environment variable.
62+
63+ Also, these variables are merged into
64+ <xref linkend="opt-environment.profileRelativeEnvVars"/> and it is
65+ therefore not possible to use PAM style variables such as
66+ <code>@{HOME}</code>.
67+ '';
68+ };
69+
3070 };
3171
3272 config = {
3373
34− system.build.pamEnvironment = pkgs.writeText "pam-environment"
35− ''
36− ${concatStringsSep "\n" (
37− (mapAttrsToList (n: v: ''${n}="${concatStringsSep ":" v}"'')
38− (zipAttrsWith (const concatLists) ([ (mapAttrs (n: v: [ v ]) cfg.sessionVariables) ]))))}
39− '';
74+ system.build.pamEnvironment =
75+ let
76+ suffixedVariables =
77+ flip mapAttrs cfg.profileRelativeSessionVariables (envVar: suffixes:
78+ flip concatMap pamProfiles (profile:
79+ map (suffix: "${profile}${suffix}") suffixes
80+ )
81+ );
82+
83+ pamVariable = n: v:
84+ ''${n} DEFAULT="${concatStringsSep ":" (toList v)}"'';
85+
86+ pamVariables =
87+ concatStringsSep "\n"
88+ (mapAttrsToList pamVariable
89+ (zipAttrsWith (n: concatLists)
90+ [
91+ (mapAttrs (n: toList) cfg.sessionVariables)
92+ suffixedVariables
93+ ]));
94+ in
95+ pkgs.writeText "pam-environment" "${pamVariables}\n";
4096
4197 };
4298
nixos/modules/config/terminfo.nix+1−1
@@ -12,7 +12,7 @@
1212 source = "${config.system.path}/share/terminfo";
1313 };
1414
15− environment.profileRelativeEnvVars = {
15+ environment.profileRelativeSessionVariables = {
1616 TERMINFO_DIRS = [ "/share/terminfo" ];
1717 };
1818
nixos/modules/config/xdg/icons.nix+6−6
@@ -7,19 +7,19 @@ with lib;
77 type = types.bool;
88 default = true;
99 description = ''
10− Whether to install files to support the
10+ Whether to install files to support the
1111 <link xlink:href="https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">XDG Icon Theme specification</link>.
1212 '';
1313 };
1414 };
1515
1616 config = mkIf config.xdg.icons.enable {
17− environment.pathsToLink = [
18− "/share/icons"
19− "/share/pixmaps"
17+ environment.pathsToLink = [
18+ "/share/icons"
19+ "/share/pixmaps"
2020 ];
21−
22− environment.profileRelativeEnvVars = {
21+
22+ environment.profileRelativeSessionVariables = {
2323 XCURSOR_PATH = [ "/share/icons" ];
2424 };
2525 };
nixos/modules/programs/environment.nix+3−1
@@ -22,6 +22,8 @@ in
2222 EDITOR = mkDefault "nano";
2323 XCURSOR_PATH = [ "$HOME/.icons" ];
2424 XDG_CONFIG_DIRS = [ "/etc/xdg" ]; # needs to be before profile-relative paths to allow changes through environment.etc
25+ GTK_DATA_PREFIX = "${config.system.path}"; # needed for gtk2 apps to find themes
26+ GTK_EXE_PREFIX = "${config.system.path}";
2527 };
2628
2729 environment.profiles = mkAfter
@@ -30,7 +32,7 @@ in
3032 ];
3133
3234 # TODO: move most of these elsewhere
33− environment.profileRelativeEnvVars =
35+ environment.profileRelativeSessionVariables =
3436 { PATH = [ "/bin" ];
3537 INFOPATH = [ "/info" "/share/info" ];
3638 KDEDIRS = [ "" ];
nixos/modules/security/pam.nix+1−1
@@ -415,7 +415,7 @@ let
415415
416416 # Session management.
417417 ${optionalString cfg.setEnvironment ''
418− session required pam_env.so envfile=${config.system.build.pamEnvironment}
418+ session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
419419 ''}
420420 session required pam_unix.so
421421 ${optionalString cfg.setLoginUid
nixos/modules/services/editors/emacs.nix+1−7
@@ -95,13 +95,7 @@ in {
9595
9696 environment.systemPackages = [ cfg.package editorScript desktopApplicationFile ];
9797
98− environment.variables = {
99− # This is required so that GTK applications launched from Emacs
100− # get properly themed:
101− GTK_DATA_PREFIX = "${config.system.path}";
102− } // (if cfg.defaultEditor then {
103− EDITOR = mkOverride 900 "${editorScript}/bin/emacseditor";
104− } else {});
98+ environment.variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "${editorScript}/bin/emacseditor");
10599 };
106100
107101 meta.doc = ./emacs.xml;
nixos/modules/services/x11/desktop-managers/enlightenment.nix−4
@@ -48,10 +48,6 @@ in
4848 services.xserver.desktopManager.session = [
4949 { name = "Enlightenment";
5050 start = ''
51− # Set GTK_DATA_PREFIX so that GTK can find the themes
52− export GTK_DATA_PREFIX=${config.system.path}
53− # find theme engines
54− export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0
5551 export XDG_MENU_PREFIX=e-
5652
5753 export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}"
nixos/modules/services/x11/desktop-managers/mate.nix−6
@@ -48,12 +48,6 @@ in
4848 name = "mate";
4949 bgSupport = true;
5050 start = ''
51− # Set GTK_DATA_PREFIX so that GTK can find the themes
52− export GTK_DATA_PREFIX=${config.system.path}
53−
54− # Find theme engines
55− export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0
56−
5751 export XDG_MENU_PREFIX=mate-
5852
5953 # Let caja find extensions
nixos/modules/services/x11/desktop-managers/xfce.nix−6
@@ -107,12 +107,6 @@ in
107107 start = ''
108108 ${cfg.extraSessionCommands}
109109
110− # Set GTK_PATH so that GTK can find the theme engines.
111− export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
112−
113− # Set GTK_DATA_PREFIX so that GTK can find the Xfce themes.
114− export GTK_DATA_PREFIX=${config.system.path}
115−
116110 ${pkgs.runtimeShell} ${pkgs.xfce.xinitrc} &
117111 waitPID=$!
118112 '';
nixos/modules/services/x11/desktop-managers/xfce4-14.nix−6
@@ -114,12 +114,6 @@ in
114114 name = "xfce4-14";
115115 bgSupport = true;
116116 start = ''
117− # Set GTK_PATH so that GTK can find the theme engines.
118− export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
119−
120− # Set GTK_DATA_PREFIX so that GTK can find the Xfce themes.
121− export GTK_DATA_PREFIX=${config.system.path}
122−
123117 ${pkgs.runtimeShell} ${pkgs.xfce4-14.xinitrc} &
124118 waitPID=$!
125119 '';
nixos/modules/services/x11/display-managers/gdm.nix+1−3
@@ -142,8 +142,6 @@ in
142142 GDM_X_SERVER_EXTRA_ARGS = toString
143143 (filter (arg: arg != "-terminate") cfg.xserverArgs);
144144 XDG_DATA_DIRS = "${cfg.session.desktops}/share/";
145− # Find the mouse
146− XCURSOR_PATH = "~/.icons:${pkgs.gnome3.adwaita-icon-theme}/share/icons";
147145 } // optionalAttrs (xSessionWrapper != null) {
148146 # Make GDM use this wrapper before running the session, which runs the
149147 # configured setupCommands. This relies on a patched GDM which supports
@@ -262,7 +260,7 @@ in
262260 password required pam_deny.so
263261
264262 session required pam_succeed_if.so audit quiet_success user = gdm
265− session required pam_env.so envfile=${config.system.build.pamEnvironment}
263+ session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
266264 session optional ${pkgs.systemd}/lib/security/pam_systemd.so
267265 session optional pam_keyinit.so force revoke
268266 session optional pam_permit.so
nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix+8−28
@@ -10,32 +10,6 @@ let
1010 icons = cfg.iconTheme.package;
1111 cursors = cfg.cursorTheme.package;
1212
13− # We need a few things in the environment for the greeter to run with
14− # fonts/icons.
15− wrappedEnsoGreeter = pkgs.runCommand "lightdm-enso-os-greeter" {
16− buildInputs = [ pkgs.makeWrapper ];
17− preferLocalBuild = true;
18− } ''
19− # This wrapper ensures that we actually get themes
20− makeWrapper ${pkgs.lightdm-enso-os-greeter}/bin/pantheon-greeter \
21− $out/greeter \
22− --prefix PATH : "${pkgs.glibc.bin}/bin" \
23− --set GDK_PIXBUF_MODULE_FILE "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" \
24− --set GTK_PATH "${theme}:${pkgs.gtk3.out}" \
25− --set GTK_EXE_PREFIX "${theme}" \
26− --set GTK_DATA_PREFIX "${theme}" \
27− --set XDG_DATA_DIRS "${theme}/share:${icons}/share:${cursors}/share" \
28− --set XDG_CONFIG_HOME "${theme}/share"
29−
30− cat - > $out/lightdm-enso-os-greeter.desktop << EOF
31− [Desktop Entry]
32− Name=LightDM Greeter
33− Comment=This runs the LightDM Greeter
34− Exec=$out/greeter
35− Type=Application
36− EOF
37− '';
38−
3913 ensoGreeterConf = pkgs.writeText "lightdm-enso-os-greeter.conf" ''
4014 [greeter]
4115 default-wallpaper=${ldmcfg.background}
@@ -144,10 +118,16 @@ in {
144118 config = mkIf (ldmcfg.enable && cfg.enable) {
145119 environment.etc."lightdm/greeter.conf".source = ensoGreeterConf;
146120
121+ environment.systemPackages = [
122+ cursors
123+ icons
124+ theme
125+ ];
126+
147127 services.xserver.displayManager.lightdm = {
148128 greeter = mkDefault {
149− package = wrappedEnsoGreeter;
150− name = "lightdm-enso-os-greeter";
129+ package = pkgs.lightdm-enso-os-greeter.xgreeters;
130+ name = "pantheon-greeter";
151131 };
152132
153133 greeters = {
nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix+7−29
@@ -15,34 +15,6 @@ let
1515 icons = cfg.iconTheme.package;
1616 cursors = cfg.cursorTheme.package;
1717
18− # The default greeter provided with this expression is the GTK greeter.
19− # Again, we need a few things in the environment for the greeter to run with
20− # fonts/icons.
21− wrappedGtkGreeter = pkgs.runCommand "lightdm-gtk-greeter" {
22− buildInputs = [ pkgs.makeWrapper ];
23− preferLocalBuild = true;
24− } ''
25− # This wrapper ensures that we actually get themes
26− makeWrapper ${pkgs.lightdm_gtk_greeter}/sbin/lightdm-gtk-greeter \
27− $out/greeter \
28− --prefix PATH : "${lib.getBin pkgs.stdenv.cc.libc}/bin" \
29− --set GDK_PIXBUF_MODULE_FILE "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" \
30− --set GTK_PATH "${theme}:${pkgs.gtk3.out}" \
31− --set GTK_EXE_PREFIX "${theme}" \
32− --set GTK_DATA_PREFIX "${theme}" \
33− --set XDG_DATA_DIRS "${theme}/share:${icons}/share" \
34− --set XDG_CONFIG_HOME "${theme}/share" \
35− --set XCURSOR_PATH "${cursors}/share/icons"
36−
37− cat - > $out/lightdm-gtk-greeter.desktop << EOF
38− [Desktop Entry]
39− Name=LightDM Greeter
40− Comment=This runs the LightDM Greeter
41− Exec=$out/greeter
42− Type=Application
43− EOF
44− '';
45−
4618 gtkGreeterConf = writeText "lightdm-gtk-greeter.conf"
4719 ''
4820 [greeter]
@@ -185,10 +157,16 @@ in
185157 config = mkIf (ldmcfg.enable && cfg.enable) {
186158
187159 services.xserver.displayManager.lightdm.greeter = mkDefault {
188− package = wrappedGtkGreeter;
160+ package = pkgs.lightdm_gtk_greeter.xgreeters;
189161 name = "lightdm-gtk-greeter";
190162 };
191163
164+ environment.systemPackages = [
165+ cursors
166+ icons
167+ theme
168+ ];
169+
192170 environment.etc."lightdm/lightdm-gtk-greeter.conf".source = gtkGreeterConf;
193171
194172 };
nixos/modules/services/x11/display-managers/lightdm-greeters/mini.nix+1−6
@@ -8,11 +8,6 @@ let
88 ldmcfg = dmcfg.lightdm;
99 cfg = ldmcfg.greeters.mini;
1010
11− xgreeters = pkgs.linkFarm "lightdm-mini-greeter-xgreeters" [{
12− path = "${pkgs.lightdm-mini-greeter}/share/xgreeters/lightdm-mini-greeter.desktop";
13− name = "lightdm-mini-greeter.desktop";
14− }];
15−
1611 miniGreeterConf = pkgs.writeText "lightdm-mini-greeter.conf"
1712 ''
1813 [greeter]
@@ -90,7 +85,7 @@ in
9085 services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
9186
9287 services.xserver.displayManager.lightdm.greeter = mkDefault {
93− package = xgreeters;
88+ package = pkgs.lightdm-mini-greeter.xgreeters;
9489 name = "lightdm-mini-greeter";
9590 };
9691
nixos/modules/services/x11/display-managers/lightdm.nix+1−1
@@ -249,7 +249,7 @@ in
249249 password required pam_deny.so
250250
251251 session required pam_succeed_if.so audit quiet_success user = lightdm
252− session required pam_env.so envfile=${config.system.build.pamEnvironment}
252+ session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
253253 session optional ${pkgs.systemd}/lib/security/pam_systemd.so
254254 session optional pam_keyinit.so force revoke
255255 session optional pam_permit.so
nixos/modules/services/x11/display-managers/sddm.nix+1−3
@@ -219,8 +219,6 @@ in
219219 # Load themes from system environment
220220 QT_PLUGIN_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtPluginPrefix;
221221 QML2_IMPORT_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtQmlPrefix;
222−
223− XDG_DATA_DIRS = "/run/current-system/sw/share";
224222 };
225223
226224 execCmd = "exec /run/current-system/sw/bin/sddm";
@@ -242,7 +240,7 @@ in
242240 password required pam_deny.so
243241
244242 session required pam_succeed_if.so audit quiet_success user = sddm
245− session required pam_env.so envfile=${config.system.build.pamEnvironment}
243+ session required pam_env.so conffile=${config.system.build.pamEnvironment} readenv=0
246244 session optional ${pkgs.systemd}/lib/security/pam_systemd.so
247245 session optional pam_keyinit.so force revoke
248246 session optional pam_permit.so
pkgs/applications/display-managers/lightdm-enso-os-greeter/default.nix+20−21
@@ -1,6 +1,6 @@
1−{ stdenv, fetchgit, pkgconfig
1+{ stdenv, fetchgit, pkgconfig, linkFarm, lightdm-enso-os-greeter
22, dbus, pcre, epoxy, libXdmcp, at-spi2-core, libxklavier, libxkbcommon, libpthreadstubs
3−, gtk3, vala, cmake, libgee, libX11, lightdm, gdk-pixbuf, clutter-gtk }:
3+, gtk3, vala, cmake, libgee, libX11, lightdm, gdk-pixbuf, clutter-gtk, wrapGAppsHook, librsvg }:
44
55stdenv.mkDerivation {
66 version = "0.2.1";
@@ -12,12 +12,21 @@ stdenv.mkDerivation {
1212 sha256 = "11jm181jq1vbn83h235avpdxz7pqq6prqyzki5yryy53mkj4kgxz";
1313 };
1414
15+ patches = [
16+ ./fix-paths.patch
17+ ];
18+
19+ nativeBuildInputs = [
20+ cmake
21+ pkgconfig
22+ vala
23+ wrapGAppsHook
24+ ];
25+
1526 buildInputs = [
1627 dbus
1728 gtk3
1829 pcre
19− vala
20− cmake
2130 epoxy
2231 libgee
2332 libX11
@@ -29,31 +38,21 @@ stdenv.mkDerivation {
2938 at-spi2-core
3039 libxkbcommon
3140 libpthreadstubs
41+ librsvg
3242 ];
3343
34− nativeBuildInputs = [
35− pkgconfig
36− ];
37−
38− postPatch = ''
39− sed -i "s@\''${CMAKE_INSTALL_PREFIX}/@@" greeter/CMakeLists.txt
40− '';
41−
4244 preConfigure = ''
4345 cd greeter
4446 '';
4547
46− installFlags = [
47− "DESTDIR=$(out)"
48− ];
49−
50− preFixup = ''
51− mv $out/usr/* $out
52− rm -r $out/usr
53− '';
48+ passthru.xgreeters = linkFarm "enso-os-greeter-xgreeters" [{
49+ path = "${lightdm-enso-os-greeter}/share/xgreeters/pantheon-greeter.desktop";
50+ name = "pantheon-greeter.desktop";
51+ }];
5452
5553 postFixup = ''
56− rm -r $out/sbin
54+ substituteInPlace $out/share/xgreeters/pantheon-greeter.desktop \
55+ --replace "pantheon-greeter" "$out/bin/pantheon-greeter"
5756 '';
5857
5958 meta = with stdenv.lib; {
pkgs/applications/display-managers/lightdm-enso-os-greeter/fix-paths.patchnew file+24
@@ -0,0 +1,24 @@
1+diff --git a/greeter/CMakeLists.txt b/greeter/CMakeLists.txt
2+index 57aebb0..ab50bff 100644
3+--- a/greeter/CMakeLists.txt
4++++ b/greeter/CMakeLists.txt
5+@@ -9,7 +9,6 @@ list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
6+ set (CONF_DIR "/etc/lightdm")
7+ set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
8+ set (PKGDATADIR "${DATADIR}/enso/greeter")
9+-set (CMAKE_INSTALL_PREFIX /usr)
10+ set (VERSION "1.0.6")
11+
12+
13+@@ -94,9 +93,9 @@ glib_compile_resources (GLIB_RESOURCES_CSS SOURCE data/css.gresource.xml)
14+ add_executable (pantheon-greeter ${VALA_C} ${GLIB_RESOURCES_CSS})
15+ target_link_libraries(pantheon-greeter m)
16+
17+-install (TARGETS pantheon-greeter RUNTIME DESTINATION sbin)
18++install (TARGETS pantheon-greeter RUNTIME DESTINATION bin)
19+ install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/pantheon-greeter.desktop DESTINATION share/xgreeters)
20+-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/greeter.conf DESTINATION ${CONF_DIR})
21++install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/greeter.conf DESTINATION etc/lightdm)
22+ install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/fingerprint.svg DESTINATION ${PKGDATADIR})
23+ install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/power.svg DESTINATION ${PKGDATADIR})
24+ install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/checked.svg DESTINATION ${PKGDATADIR})
pkgs/applications/display-managers/lightdm-mini-greeter/default.nix+9−4
@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, lightdm, gtk3 }:
1+{ stdenv, linkFarm, lightdm-mini-greeter, fetchFromGitHub, autoreconfHook, pkgconfig, lightdm, gtk3, glib, gdk-pixbuf, wrapGAppsHook, librsvg }:
22
33stdenv.mkDerivation rec {
44 pname = "lightdm-mini-greeter";
@@ -11,17 +11,22 @@ stdenv.mkDerivation rec {
1111 sha256 = "1qi0bsqi8z2zv3303ww0kd7bciz6qx8na5bkvgrqlwyvq31czai5";
1212 };
1313
14− nativeBuildInputs = [ autoreconfHook pkgconfig ];
15− buildInputs = [ lightdm gtk3 ];
14+ nativeBuildInputs = [ autoreconfHook pkgconfig wrapGAppsHook ];
15+ buildInputs = [ lightdm gtk3 glib gdk-pixbuf librsvg ];
1616
1717 configureFlags = [ "--sysconfdir=/etc" ];
18− makeFlags = [ "configdir=$(out)/etc" ];
18+ makeFlags = [ "configdir=${placeholder "out"}/etc" ];
1919
2020 postInstall = ''
2121 substituteInPlace "$out/share/xgreeters/lightdm-mini-greeter.desktop" \
2222 --replace "Exec=lightdm-mini-greeter" "Exec=$out/bin/lightdm-mini-greeter"
2323 '';
2424
25+ passthru.xgreeters = linkFarm "lightdm-mini-greeter-xgreeters" [{
26+ path = "${lightdm-mini-greeter}/share/xgreeters/lightdm-mini-greeter.desktop";
27+ name = "lightdm-mini-greeter.desktop";
28+ }];
29+
2530 meta = with stdenv.lib; {
2631 description = "A minimal, configurable, single-user GTK3 LightDM greeter";
2732 homepage = https://github.com/prikhi/lightdm-mini-greeter;
pkgs/applications/display-managers/lightdm/gtk-greeter.nix+24−9
@@ -1,7 +1,18 @@
1−{ stdenv, fetchurl, lightdm, pkgconfig, intltool
2−, hicolor-icon-theme, makeWrapper
3−, useGTK2 ? false, gtk2, gtk3 # gtk3 seems better supported
4−, exo, at-spi2-core
1+{ stdenv
2+, lightdm_gtk_greeter
3+, fetchurl
4+, lightdm
5+, pkgconfig
6+, intltool
7+, linkFarm
8+, wrapGAppsHook
9+, useGTK2 ? false
10+, gtk2
11+, gtk3 # gtk3 seems better supported
12+, exo
13+, at-spi2-core
14+, librsvg
15+, hicolor-icon-theme
516}:
617
718#ToDo: bad icons with gtk2;
@@ -20,14 +31,15 @@ stdenv.mkDerivation rec {
2031 sha256 = "1pis5qyg95pg31dvnfqq34bzgj00hg4vs547r8h60lxjk81z8p15";
2132 };
2233
23− nativeBuildInputs = [ pkgconfig ];
24− buildInputs = [ lightdm exo intltool makeWrapper hicolor-icon-theme ]
34+ nativeBuildInputs = [ pkgconfig intltool wrapGAppsHook ];
35+ buildInputs = [ lightdm exo librsvg hicolor-icon-theme ]
2536 ++ (if useGTK2 then [ gtk2 ] else [ gtk3 ]);
2637
2738 configureFlags = [
2839 "--localstatedir=/var"
2940 "--sysconfdir=/etc"
3041 "--disable-indicator-services-command"
42+ "--sbindir=${placeholder "out"}/bin" # for wrapGAppsHook to wrap automatically
3143 ] ++ stdenv.lib.optional useGTK2 "--with-gtk2";
3244
3345 preConfigure = ''
@@ -43,11 +55,14 @@ stdenv.mkDerivation rec {
4355
4456 postInstall = ''
4557 substituteInPlace "$out/share/xgreeters/lightdm-gtk-greeter.desktop" \
46− --replace "Exec=lightdm-gtk-greeter" "Exec=$out/sbin/lightdm-gtk-greeter"
47− wrapProgram "$out/sbin/lightdm-gtk-greeter" \
48− --prefix XDG_DATA_DIRS ":" "${hicolor-icon-theme}/share"
58+ --replace "Exec=lightdm-gtk-greeter" "Exec=$out/bin/lightdm-gtk-greeter"
4959 '';
5060
61+ passthru.xgreeters = linkFarm "lightdm-gtk-greeter-xgreeters" [{
62+ path = "${lightdm_gtk_greeter}/share/xgreeters/lightdm-gtk-greeter.desktop";
63+ name = "lightdm-gtk-greeter.desktop";
64+ }];
65+
5166 meta = with stdenv.lib; {
5267 homepage = https://launchpad.net/lightdm-gtk-greeter;
5368 platforms = platforms.linux;
pkgs/misc/themes/clearlooks-phenix/default.nix−3
@@ -23,9 +23,6 @@ stdenv.mkDerivation rec {
2323 The Clearlooks-Phénix project aims at creating a GTK3 port of Clearlooks,
2424 the default theme for Gnome 2. Style is also included for GTK2, Unity and
2525 for Metacity, Openbox and Xfwm4 window managers.
26−
27− You should install this theme into your user profile and then set
28− GTK_DATA_PREFIX to `~/.nix-profile`.
2926 '';
3027 homepage = https://github.com/jpfleury/clearlooks-phenix;
3128 downloadPage = https://github.com/jpfleury/clearlooks-phenix/releases;