mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 21:29:12 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
51
modules-clone/nixos/server/nfs.nix
Normal file
51
modules-clone/nixos/server/nfs.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{ lib, config, pkgs, globals, confLib, ... }:
|
||||
let
|
||||
nfsUser = globals.user.name;
|
||||
in
|
||||
{
|
||||
options.swarselmodules.server.nfs = lib.mkEnableOption "enable nfs on server";
|
||||
config = lib.mkIf config.swarselmodules.server.nfs {
|
||||
|
||||
users.persistentIds = {
|
||||
avahi = confLib.mkIds 978;
|
||||
};
|
||||
|
||||
environment.persistence."/state" = lib.mkIf config.swarselsystems.isMicroVM {
|
||||
directories = [
|
||||
{ directory = "/var/cache/samba"; }
|
||||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
# add a user with sudo smbpasswd -a <user>
|
||||
samba = {
|
||||
package = pkgs.samba4;
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings.Eternor = {
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "no";
|
||||
path = "/storage";
|
||||
writable = "true";
|
||||
comment = "Eternor";
|
||||
"valid users" = nfsUser;
|
||||
};
|
||||
};
|
||||
|
||||
avahi = {
|
||||
publish.enable = true;
|
||||
publish.userServices = true; # Needed to allow samba to automatically register mDNS records without the need for an `extraServiceFile`
|
||||
nssmdns4 = true;
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
# This enables autodiscovery on windows since SMB1 (and thus netbios) support was discontinued
|
||||
samba-wsdd = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue