misc: smb username map and apple fs support, other small changes

This commit is contained in:
Evar 2025-06-24 22:17:33 -04:00
parent 8a928e8f58
commit 9030a12931
3 changed files with 37 additions and 6 deletions

View file

@ -35,6 +35,8 @@
pkgs.spotify # Proprietary
# Documents
pkgs.kdePackages.kimageformats
pkgs.kdePackages.kdegraphics-thumbnailers
# emily suggested I try these (albiet via their web thing), so keeping them commented
#pkgs.typst # TeX alternative
@ -50,6 +52,7 @@
#pkgs.zed-editor
pkgs.obsidian
pkgs.anki
pkgs.quickemu
];

1
nixos/smb-usernames.map Normal file
View file

@ -0,0 +1 @@
evar = microsoft@evar.dev

View file

@ -105,13 +105,8 @@ in {
useDHCP = false;
ipv4 = {
addresses = [
{ address = "10.0.5.1"; prefixLength = 24; }
{ address = "10.0.5.1"; prefixLength = 32; }
];
routes = [{
address = "10.0.5.1";
prefixLength = 24;
options = { scope = "link"; metric = "900"; };
}];
};
};
@ -201,6 +196,9 @@ in {
# Samba share. Primarily intended to be used via the
# bridged network adapter for speed
#
# TODO: https://www.samba.org/samba/docs/current/man-html/vfs_btrfs.8.html
# to take advantage of btrfs stuff
services.samba = {
enable = true;
openFirewall = true;
@ -211,6 +209,8 @@ in {
"netbios name" = "Atreus";
"security" = "user";
"username map" = "${./smb-usernames.map}";
# don't show shares to people who aren't valid to see them
"access based share enum" = "yes";
@ -226,17 +226,44 @@ in {
# "hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
# Stuff for MacOS
# see https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X
# for additional settings - see manpage for vfs_fruit
"vfs objects" = "fruit streams_xattr"; # load in modules, enable APPL extensions - order is critical
"fruit:metadata" = "stream"; # stores osx medatadata
"fruit:model" = "MacSamba"; # server icon in finder
"fruit:veto_appledouble" = "no"; # following stuff generally cleans up files
"fruit:zero_file_id" = "yes";
"fruit:wipe_intentionally_left_blank_rfork" = "yes";
"fruit:delete_empty_adfiles" = "yes";
"fruit:posix_rename" = "yes";
"fruit:nfs_aces" = "no"; # prevents macOS clients from motifying the UNIX mode of directories that use NFS ACEs
};
"TimeMachineBackup" = {
"fruit:time machine" = "yes";
# "fruit:time machine max size" = "SIZE";
};
"Virtio Shared" = {
# macos spotlight indexing backend
# see smb.conf for other elasticsearch params
"spotlight backend" = "elasticsearch";
"path" = "/home/evar/Virtio Shared";
"comment" = "Virtio shared directory";
"valid users" = "evar";
"force user" = "evar";
# POSIX ACE entry maps to Full Control ACL in windows
"acl map full control" = "yes";
# allow users with write access to also change perms
"dos filemode" = "yes";
# files created by a samba client have posix ace
"force create mode" = 0777;
"read only" = "no";