mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-05-19 02:46:06 -07:00
Move samba server outside of modules
This commit is contained in:
parent
5a58d74799
commit
b226a0c55d
@ -2,6 +2,7 @@
|
||||
{
|
||||
imports = [
|
||||
./wireguard-server.nix
|
||||
./samba-server.nix
|
||||
../../modules
|
||||
];
|
||||
|
||||
@ -128,7 +129,6 @@
|
||||
tooling.enable = true;
|
||||
};
|
||||
services = {
|
||||
samba-server.enable = true;
|
||||
jellyfin.enable = true;
|
||||
syncthing.enable = true;
|
||||
};
|
||||
|
41
provision/nixos/hosts/torus/samba-server.nix
Normal file
41
provision/nixos/hosts/torus/samba-server.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
services.samba = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
workgroup = WORKGROUP
|
||||
server string = smbnix
|
||||
netbios name = smbnix
|
||||
security = user
|
||||
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 = {
|
||||
private = {
|
||||
"path" = "/engi";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "no";
|
||||
"force user" = "tstarr";
|
||||
"force group" = "users";
|
||||
};
|
||||
public = {
|
||||
"path" = "/engi";
|
||||
browseable = "yes";
|
||||
"read only" = "yes";
|
||||
"guest ok" = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Curiously, `services.samba` does not automatically open
|
||||
# the needed ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [ 445 139 ];
|
||||
networking.firewall.allowedUDPPorts = [ 137 138 ];
|
||||
|
||||
# To make SMB mounting easier on the command line
|
||||
environment.systemPackages = with pkgs; [ cifs-utils ];
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./syncthing.nix ./samba-server.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ./peripherals.nix ];
|
||||
imports = [ ./syncthing.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ./peripherals.nix ];
|
||||
}
|
||||
|
@ -1,46 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.modules.services.samba-server;
|
||||
in {
|
||||
options.modules.services.samba-server.enable = lib.mkEnableOption "samba-server";
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.samba = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
workgroup = WORKGROUP
|
||||
server string = smbnix
|
||||
netbios name = smbnix
|
||||
security = user
|
||||
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 = {
|
||||
private = {
|
||||
"path" = "/engi";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "no";
|
||||
"force user" = "tstarr";
|
||||
"force group" = "users";
|
||||
};
|
||||
public = {
|
||||
"path" = "/engi";
|
||||
browseable = "yes";
|
||||
"read only" = "yes";
|
||||
"guest ok" = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Curiously, `services.samba` does not automatically open
|
||||
# the needed ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [ 445 139 ];
|
||||
networking.firewall.allowedUDPPorts = [ 137 138 ];
|
||||
|
||||
# To make SMB mounting easier on the command line
|
||||
environment.systemPackages = with pkgs; [ cifs-utils ];
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user