mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
refactor(samba): kyuuto
This commit is contained in:
parent
602eda1012
commit
5dcd5a5be0
14 changed files with 379 additions and 125 deletions
49
nixos/kyuuto/samba.nix
Normal file
49
nixos/kyuuto/samba.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkDefault;
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (config.networking.access) cidrForNetwork;
|
||||
inherit (config) kyuuto;
|
||||
cfg = config.services.samba;
|
||||
localAddrs = cidrForNetwork.loopback.all ++ cidrForNetwork.local.all
|
||||
++ optionals config.services.tailscale.enable cidrForNetwork.tail.all;
|
||||
in {
|
||||
services.samba = {
|
||||
usershare = {
|
||||
enable = mkDefault true;
|
||||
path = mkDefault (kyuuto.mountDir + "/usershares");
|
||||
};
|
||||
shares = mkIf cfg.enable {
|
||||
kyuuto-transfer = {
|
||||
path = kyuuto.transferDir;
|
||||
writeable = true;
|
||||
browseable = true;
|
||||
public = true;
|
||||
"acl group control" = true;
|
||||
#"guest only" = true;
|
||||
comment = "Kyuuto Media Transfer Area";
|
||||
"hosts allow" = localAddrs;
|
||||
};
|
||||
kyuuto-access = {
|
||||
path = kyuuto.libraryDir;
|
||||
writeable = false;
|
||||
browseable = true;
|
||||
public = true;
|
||||
comment = "Kyuuto Media Access";
|
||||
"hosts allow" = localAddrs;
|
||||
};
|
||||
kyuuto-media = {
|
||||
path = kyuuto.mountDir;
|
||||
writeable = true;
|
||||
browseable = true;
|
||||
public = false;
|
||||
comment = "Kyuuto Media";
|
||||
"valid users" = [ "@kyuuto" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue