2023-02-28 05:05:04 +00:00
|
|
|
{ config, lib, ... }: {
|
|
|
|
|
|
|
|
options = { samba.enable = lib.mkEnableOption "Enable Samba sharing."; };
|
|
|
|
|
2023-03-02 19:49:20 +00:00
|
|
|
config = {
|
2023-02-28 05:05:04 +00:00
|
|
|
|
2023-03-02 19:49:20 +00:00
|
|
|
services.samba = lib.mkIf (config.samba.enable) {
|
|
|
|
enable = true;
|
|
|
|
shares.video = {
|
|
|
|
path = "/data/video";
|
|
|
|
browseable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "no";
|
|
|
|
"force user" = config.user;
|
|
|
|
"force group" = config.user;
|
|
|
|
comment = "Movies and TV";
|
|
|
|
};
|
2023-02-28 05:05:04 +00:00
|
|
|
};
|
|
|
|
|
2023-03-02 19:49:20 +00:00
|
|
|
# Allow browsing Samba shares
|
|
|
|
services.gvfs =
|
|
|
|
lib.mkIf (config.gui.enable && config.nautilus.enable) { enable = true; };
|
|
|
|
|
2023-02-28 05:05:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|