Samba: Difference between revisions

imported>Makefu
split into client and server
imported>Mic92
printer sharing example
Line 115: Line 115:
</syntaxhighlight>
</syntaxhighlight>


==== Printer sharing ====
The `samba` packages comes without cups support compiled in, however `sambaFull` features printer sharing support.
To use it set the `services.samba.package` option:
<syntaxhighlight lang=nix>
services.samba.package = pkgs.sambaFull;
</syntaxhighlight>
A printer share that allows all members in the local network printing could look like this:
<syntaxhighlight lang=nix>
{ pkgs, ... }: {
  services.samba = {
    enable = true;
    package = pkgs.sambaFull;
    extraConfig = ''
      load printers = yes
      printing = cups
      printcap name = cups
    '';
    shares = {
      printers = {
        comment = "All Printers";
        path = "/var/spool/samba";
        public = "yes";
        browseable = "yes";
        # to allow user 'guest account' to print.
        "guest ok" = "yes";
        writable = "no";
        printable = "yes";
        "create mode" = 0700;
      };
  };
  systemd.tmpfiles.rules = [
    "d /var/spool/samba 1777 root root -"
  ];
}
</syntaxhighlight>


== links ==
== links ==