nixos/{budgie,cinnamon,mate}: Hack around SSH_AUTH_SOCK
Make sure SSH_AUTH_SOCK is known by these sessions, which are not systemd managed. It should not be a problem for users who know this environment variable and use multiple desktops environments to opt-out of this and I would prefer a more out-of-the-box experience for those who don't.
This commit is contained in:
@@ -130,17 +130,25 @@ in
|
|||||||
|
|
||||||
services.xserver.desktopManager.budgie.sessionPath = [ pkgs.budgie-desktop-view ];
|
services.xserver.desktopManager.budgie.sessionPath = [ pkgs.budgie-desktop-view ];
|
||||||
|
|
||||||
environment.extraInit = ''
|
environment.extraInit =
|
||||||
${concatMapStrings (p: ''
|
''
|
||||||
if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
|
${concatMapStrings (p: ''
|
||||||
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
|
if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
|
||||||
|
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
|
||||||
|
fi
|
||||||
|
if [ -d "${p}/lib/girepository-1.0" ]; then
|
||||||
|
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
|
||||||
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
|
||||||
|
fi
|
||||||
|
'') cfg.sessionPath}
|
||||||
|
''
|
||||||
|
+ lib.optionalString config.services.gnome.gcr-ssh-agent.enable ''
|
||||||
|
# Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still
|
||||||
|
# applies to sessions not managed by systemd.
|
||||||
|
if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then
|
||||||
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
|
||||||
fi
|
fi
|
||||||
if [ -d "${p}/lib/girepository-1.0" ]; then
|
'';
|
||||||
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
|
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
|
|
||||||
fi
|
|
||||||
'') cfg.sessionPath}
|
|
||||||
'';
|
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|||||||
@@ -87,18 +87,26 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Have to take care of GDM + Cinnamon on Wayland users
|
# Have to take care of GDM + Cinnamon on Wayland users
|
||||||
environment.extraInit = ''
|
environment.extraInit =
|
||||||
${concatMapStrings (p: ''
|
''
|
||||||
if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
|
${concatMapStrings (p: ''
|
||||||
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
|
if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
|
||||||
fi
|
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d "${p}/lib/girepository-1.0" ]; then
|
if [ -d "${p}/lib/girepository-1.0" ]; then
|
||||||
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
|
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
|
||||||
|
fi
|
||||||
|
'') cfg.sessionPath}
|
||||||
|
''
|
||||||
|
+ lib.optionalString config.services.gnome.gcr-ssh-agent.enable ''
|
||||||
|
# Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still
|
||||||
|
# applies to sessions not managed by systemd.
|
||||||
|
if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then
|
||||||
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
|
||||||
fi
|
fi
|
||||||
'') cfg.sessionPath}
|
'';
|
||||||
'';
|
|
||||||
|
|
||||||
# Default services
|
# Default services
|
||||||
services.blueman.enable = mkDefault (notExcluded pkgs.blueman);
|
services.blueman.enable = mkDefault (notExcluded pkgs.blueman);
|
||||||
|
|||||||
@@ -59,6 +59,14 @@ in
|
|||||||
pkgs.mate.mate-session-manager
|
pkgs.mate.mate-session-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
environment.extraInit = lib.optionalString config.services.gnome.gcr-ssh-agent.enable ''
|
||||||
|
# Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still
|
||||||
|
# applies to sessions not managed by systemd.
|
||||||
|
if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then
|
||||||
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
# Debugging
|
# Debugging
|
||||||
environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";
|
environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user