Add Samba Module.
This commit is contained in:
parent
715239373d
commit
78f9908a26
2 changed files with 26 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
./pushover
|
||||
./security.nix
|
||||
./systempackages.nix
|
||||
./samba
|
||||
./time.nix
|
||||
./zfs.nix
|
||||
];
|
||||
|
|
25
nixos/modules/nixos/system/samba/default.nix
Normal file
25
nixos/modules/nixos/system/samba/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.mySystem.services.samba;
|
||||
in
|
||||
{
|
||||
options.mySystem.services.samba = {
|
||||
enable = lib.mkEnableOption "samba";
|
||||
extraConfig = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
shares = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.attrsOf lib.types.unspecified);
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.samba.enable = true;
|
||||
services.samba.extraConfig = cfg.extraConfig;
|
||||
services.samba.shares = cfg.shares;
|
||||
services.samba.openFirewall = true;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue