Skip to content

Commit

Permalink
change smb config
Browse files Browse the repository at this point in the history
  • Loading branch information
MayNiklas committed Oct 16, 2024
1 parent 90cc735 commit 16beeac
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions modules/transmission/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{ lib, pkgs, config, ... }:
with lib;
let cfg = config.mayniklas.transmission;
in
{
let
cfg = config.mayniklas.transmission;
transmission_pkgs = import (builtins.fetchTarball {
url =
"https://github.com/NixOS/nixpkgs/archive/0c19708cf035f50d28eb4b2b8e7a79d4dc52f6bb.tar.gz";
sha256 = "sha256:0ngw2shvl24swam5pzhcs9hvbwrgzsbcdlhpvzqc7nfk8lc28sp3";
}) { system = "${pkgs.system}"; };
in {

options.mayniklas.transmission = {
enable = mkEnableOption "activate transmission";
Expand All @@ -27,18 +32,19 @@ in

services.samba = mkIf cfg.smb {
enable = true;
securityType = "user";
extraConfig = ''
workgroup = WORKGROUP
server string = smbnix
netbios name = smbnix
security = user
hosts allow = 192.168.5.0/24
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
settings = {
global = {
"invalid users" = [ "root" ];
"passwd program" = "/run/wrappers/bin/passwd %u";
security = "user";
workgroup = "WORKGROUP";
"server string" = "smbnix";
"netbios name" = "smbnix";
"hosts allow" = "192.168.5.0/24";
"hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
};
public = {
path = "/var/lib/transmission/Downloads";
"read only" = true;
Expand Down Expand Up @@ -67,7 +73,8 @@ in

services.transmission = {
enable = true;
webHome = pkgs.flood-for-transmission;
package = transmission_pkgs.transmission_4;
webHome = transmission_pkgs.flood-for-transmission;
openFirewall = true;

settings = {
Expand Down

0 comments on commit 16beeac

Please sign in to comment.