diff --git a/nixos/modules/nixos/system/default.nix b/nixos/modules/nixos/system/default.nix index 43478ea..cdbc6fa 100644 --- a/nixos/modules/nixos/system/default.nix +++ b/nixos/modules/nixos/system/default.nix @@ -8,6 +8,7 @@ ./pushover ./security.nix ./systempackages.nix + ./samba ./time.nix ./zfs.nix ]; diff --git a/nixos/modules/nixos/system/samba/default.nix b/nixos/modules/nixos/system/samba/default.nix new file mode 100644 index 0000000..3da8828 --- /dev/null +++ b/nixos/modules/nixos/system/samba/default.nix @@ -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; + }; +}