Samba: Difference between revisions

imported>Jchv
- Remove GIO_EXTRA_MODULES hack as it should no longer be needed as of 19.09. - Add more detail around the dbus session.
imported>Jchv
More improvements to documentation around PCManFM.
Line 31: Line 31:


== Browsing samba shares with PCManFM ==
== Browsing samba shares with PCManFM ==
=== excerpt of /etc/nixos/configuration.nix ===
You will need to modify your configuration to enable GVFS in order for SMB shares to be available in PCManFM.


Excerpt of <code>/etc/nixos/configuration.nix</code>:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = with pkgs; [ lxqt.lxqt-policykit ]; # provides a default authentification client for policykit
environment.systemPackages = with pkgs; [ lxqt.lxqt-policykit ]; # provides a default authentification client for policykit
services.gnome3.gvfs.enable = true; # enables gvfs
services.gvfs.enable = true; # enables gvfs
</syntaxhighlight>
</syntaxhighlight>


Furthermore, if you happen to start your Window Manager directly, via `xinitrc`, or directly invoke a Wayland compositor such as Sway, you should ensure that you launch dbus at startup in your session and export its environment. If you do not have a dbus session in your environment, you will see errors such as "Operation not supported" when attempting to browse the network.
(If you are using XFCE, you may find that your build of GVFS does not contain SMB support. You can mitigate this by setting the <code>services.gvfs.package</code> option, like for example: <code>services.gvfs.package = pkgs.gvfs;</code>)


For example, if you are using `xinitrc`, you could invoke `dbus-launch`:
Furthermore, if you happen to start your Window Manager directly, via <code>.xinitrc</code>, or directly invoke a Wayland compositor such as Sway, you should ensure that you launch dbus at startup in your session and export its environment. If you do not have a dbus session in your environment, you will see errors such as "Operation not supported" when attempting to browse the network.
 
For example, if you are using <code>.xinitrc</code>, you could invoke <code>dbus-launch</code>:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
export `dbus-launch` # starts dbus and exports its address
export `dbus-launch` # starts dbus and exports its address
exec xterm # your prefered Window Manager
exec xterm # your prefered Window Manager
</syntaxhighlight>
</syntaxhighlight>
(You need to restart your Window Manager to have the changes in ''.xinitrc'' to take place.)
(You need to restart your Window Manager to have the changes in <code>.xinitrc</code> to take place.)


If you are using a Wayland compositor like Sway, you can run it under `dbus-run-session` for the same effect:
If you are using a Wayland compositor like Sway, you can run it under <code>dbus-run-session</code> for the same effect:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
dbus-run-session sway
dbus-run-session sway
</syntaxhighlight>
</syntaxhighlight>


(Because `dbus-run-session` exits when the child process exits, it is only appropriate to use `dbus-run-session` with a process that will be running during the entire session. This is the case for Wayland compositors, but is not necessarily true for all configurations of X11 window managers.)
(Because <code>dbus-run-session</code> exits when the child process exits, it is only appropriate to use <code>dbus-run-session</code> with a process that will be running during the entire session. This is the case for Wayland compositors, but is not necessarily true for all configurations of X11 window managers.)


== Samba Server ==
== Samba Server ==