Unverified Commit cf39ba5e authored by Bobby Rong's avatar Bobby Rong
Browse files

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.
parent c5797e85
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -130,7 +130,8 @@ in

    services.xserver.desktopManager.budgie.sessionPath = [ pkgs.budgie-desktop-view ];

    environment.extraInit = ''
    environment.extraInit =
      ''
        ${concatMapStrings (p: ''
          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}
@@ -140,6 +141,13 @@ in
            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
      '';

    environment.systemPackages =
+19 −11
Original line number Diff line number Diff line
@@ -87,7 +87,8 @@ in
      };

      # 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
              export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
@@ -98,6 +99,13 @@ in
              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
        '';

      # Default services
+8 −0
Original line number Diff line number Diff line
@@ -59,6 +59,14 @@ in
        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
      environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";