formatting
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-samba;
|
||||
let cfg = config.nas-samba;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# make shares visible for Windows clients
|
||||
@@ -24,7 +21,7 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "user";
|
||||
@@ -42,26 +39,26 @@ in {
|
||||
guest account = nobody
|
||||
map to guest = bad user
|
||||
'';
|
||||
shares =
|
||||
let
|
||||
make = name: share: nameValuePair "${name}"
|
||||
{
|
||||
path = share.sharePath;
|
||||
public = if share.enableTimeMachine then false else share.public;
|
||||
private = if !share.public || share.enableTimeMachine then "yes" else "no";
|
||||
browseable = if share.browseable then "yes" else "no";
|
||||
writable = "yes";
|
||||
"read only" = if share.readOnly then "yes" else "no";
|
||||
"guest ok" = if share.guestOk then "yes" else "no";
|
||||
"create mask" = share.createMask;
|
||||
"directory mask" = share.directoryMask;
|
||||
"fruit:aapl" = if share.enableTimeMachine then "yes" else "no";
|
||||
"fruit:time machine" = if share.enableTimeMachine then "yes" else "no";
|
||||
"vfs objects" = "catia fruit streams_xattr";
|
||||
"fruit:time machine max size" = share.timeMachineMaxSize;
|
||||
};
|
||||
in
|
||||
mapAttrs' make cfg.shares;
|
||||
shares = let
|
||||
make = name: share:
|
||||
nameValuePair "${name}" {
|
||||
path = share.sharePath;
|
||||
public = if share.enableTimeMachine then false else share.public;
|
||||
private =
|
||||
if !share.public || share.enableTimeMachine then "yes" else "no";
|
||||
browseable = if share.browseable then "yes" else "no";
|
||||
writable = "yes";
|
||||
"read only" = if share.readOnly then "yes" else "no";
|
||||
"guest ok" = if share.guestOk then "yes" else "no";
|
||||
"create mask" = share.createMask;
|
||||
"directory mask" = share.directoryMask;
|
||||
"fruit:aapl" = if share.enableTimeMachine then "yes" else "no";
|
||||
"fruit:time machine" =
|
||||
if share.enableTimeMachine then "yes" else "no";
|
||||
"vfs objects" = "catia fruit streams_xattr";
|
||||
"fruit:time machine max size" = share.timeMachineMaxSize;
|
||||
};
|
||||
in mapAttrs' make cfg.shares;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user