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
|
|
@ -1,51 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
kyuuto = "/mnt/kyuuto-media";
|
||||
kyuuto-transfer = kyuuto + "/transfer";
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (config.networking.access) cidrForNetwork;
|
||||
in {
|
||||
services.nfs.server.exports = let
|
||||
mapPerm = perm: map (addr: "${addr}(${perm})");
|
||||
toPerms = concatStringsSep " ";
|
||||
localAddrs = cidrForNetwork.loopback.all ++ cidrForNetwork.local.all;
|
||||
tailAddrs = optionals config.services.tailscale.enable cidrForNetwork.tail.all;
|
||||
allAddrs = localAddrs ++ tailAddrs;
|
||||
kyuutoPerms =
|
||||
mapPerm "ro" localAddrs
|
||||
++ mapPerm "rw" tailAddrs;
|
||||
transferPerms = mapPerm "rw" allAddrs;
|
||||
in ''
|
||||
${kyuuto} ${toPerms kyuutoPerms}
|
||||
${kyuuto-transfer} ${toPerms transferPerms}
|
||||
'';
|
||||
|
||||
services.samba.shares = {
|
||||
kyuuto-transfer = {
|
||||
path = kyuuto-transfer;
|
||||
writeable = "yes";
|
||||
browseable = "yes";
|
||||
public = "yes";
|
||||
"guest only" = "yes";
|
||||
comment = "Kyuuto Media Transfer Area";
|
||||
};
|
||||
kyuuto-access = {
|
||||
path = kyuuto;
|
||||
writeable = false;
|
||||
browseable = "yes";
|
||||
public = "yes";
|
||||
comment = "Kyuuto Media Access";
|
||||
};
|
||||
kyuuto-media = {
|
||||
path = kyuuto;
|
||||
writeable = "yes";
|
||||
browseable = "yes";
|
||||
public = "no";
|
||||
comment = "Kyuuto Media";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -8,12 +8,16 @@
|
|||
nixos.sops
|
||||
nixos.base
|
||||
nixos.reisen-ct
|
||||
nixos.kyuuto
|
||||
nixos.tailscale
|
||||
nixos.nfs
|
||||
nixos.samba
|
||||
./nfs.nix
|
||||
];
|
||||
|
||||
kyuuto.setup = true;
|
||||
|
||||
proxmoxLXC.privileged = true;
|
||||
|
||||
systemd.network.networks.eth0 = {
|
||||
name = "eth0";
|
||||
matchConfig = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue