Create samba share + launching VLC/program

Hello all,

I am new with NixOS and already hooked :slight_smile: but I have a few problems with my configuration:

  • I want to auto create a samba share but I can’t seem to access it.
  • I want to auto start VLC media player with a script, but it doesnt launch (VLC is correctly installed) and I want to add parameters to play media from this samba share.

Here is the relevant code in configuration.nix

“”

  #create media directory for samba
  systemd.tmpfiles.rules = [
    "d /media 0777 nobody users"
   ];

services.samba = {
  enable = true;
  securityType = "user";
  extraConfig = ''
    workgroup = WORKGROUP
    server string = Wasteland SMB Share
    #netbios name = wasteland
    wins support = yes
    security = user 
    #use sendfile = yes
    #max protocol = smb3
    # note: localhost is the ipv6 localhost ::1
    #hosts allow = 192.168.1. 127.0.0.1 localhost
    hosts deny = 0.0.0.0/0
    guest account = nobody
    map to guest = bad user
  '';
  shares = {
    Media = {
      path = "/media";
      browseable = "yes";
      "read only" = "no";
      "guest ok" = "no";
      "create mask" = "0777";
      "directory mask" = "0777";
      "force user" = "henk";
    
     
    };
   
  };
};
systemd.user.services.startvlc = {
  description = "vlc";
  serviceConfig.PassEnvironment = "DISPLAY";
  script = ''
 vlc
  '';
  wantedBy = [ "multi-user.target" ]; # starts after login
}```