From 603159799cb57cad0fe854bae3601108cb75d9ab Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Sun, 8 Sep 2024 13:23:28 +0200 Subject: [PATCH] nixos/samba: revert default values --- .../services/network-filesystems/samba.nix | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/network-filesystems/samba.nix b/nixos/modules/services/network-filesystems/samba.nix index b98c0c126bb0..2b46a14b672a 100644 --- a/nixos/modules/services/network-filesystems/samba.nix +++ b/nixos/modules/services/network-filesystems/samba.nix @@ -106,13 +106,39 @@ in ''; settings = lib.mkOption { - type = lib.types.submodule { freeformType = settingsFormat.type; }; - default = {}; + type = lib.types.submodule { + freeformType = settingsFormat.type; + options = { + global.security = lib.mkOption { + type = lib.types.enum [ "auto" "user" "domain" "ads" ]; + default = "user"; + description = "Samba security type."; + }; + global."invalid users" = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ "root" ]; + description = "List of users who are denied to login via Samba."; + apply = x: lib.concatStringsSep " " x; + }; + global."passwd program" = lib.mkOption { + type = lib.types.str; + default = "/run/wrappers/bin/passwd %u"; + description = "Path to a program that can be used to set UNIX user passwords."; + }; + }; + }; + default = { + "global" = { + "security" = "user"; + "passwd program" = "/run/wrappers/bin/passwd %u"; + "invalid users" = [ "root" ]; + }; + }; example = { "global" = { "security" = "user"; "passwd program" = "/run/wrappers/bin/passwd %u"; - "invalid users" = "root"; + "invalid users" = [ "root" ]; }; "public" = { "path" = "/srv/public";