nixos-config/machines/chungus/media-share.nix

41 lines
1,001 B
Nix
Raw Permalink Normal View History

2023-05-05 22:33:05 +02:00
{ config, ... }:
{
2023-10-20 08:46:57 +02:00
networking.firewall.interfaces.enp0s31f6.allowedTCPPorts = [ 445 139 ];
networking.firewall.interfaces.enp0s31f6.allowedUDPPorts = [ 137 138 ];
2023-05-05 22:33:05 +02:00
# To set password:
# nix-shell -p samba --run "smbpasswd -a media"
2024-03-03 09:59:17 +01:00
samba-share.enable = true;
samba-share.folders = {
music = "/media/music";
2023-07-03 10:29:34 +02:00
audio-books = "/media/audio-books";
2023-08-31 11:50:58 +02:00
movies = "/media/movies";
series = "/media/series";
samples = "/media/samples";
};
2023-05-05 22:33:05 +02:00
2024-08-07 06:24:45 +02:00
users.users.mainUser.extraGroups = [ "media" ];
2023-05-05 22:33:05 +02:00
users.groups."media".gid = config.ids.gids.transmission;
users.users."media" = {
uid = config.ids.uids.transmission;
2023-06-13 19:58:51 +02:00
useDefaultShell = true;
home = "/home/media";
createHome = true;
2023-05-05 22:33:05 +02:00
group = "media";
};
services.permown."/media" = {
owner = "media";
group = "media";
2023-05-07 02:28:37 +02:00
directory-mode = "770";
file-mode = "770";
};
services.permown."/robi" = {
owner = "media";
group = "media";
directory-mode = "770";
file-mode = "770";
2023-05-05 22:33:05 +02:00
};
}