From de9f8ee5c295632f814d6cd24a7376a27cf912be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 17 Nov 2025 09:29:33 +0000 Subject: [PATCH] s1: remove deprecated fields --- modules/services/sentinelone/default.nix | 47 +----------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/modules/services/sentinelone/default.nix b/modules/services/sentinelone/default.nix index 7ae79bc..f494141 100644 --- a/modules/services/sentinelone/default.nix +++ b/modules/services/sentinelone/default.nix @@ -7,11 +7,6 @@ with lib; let cfg = config.services.sentinelone; - customerId = - cfg.customerId or ( - if cfg.email != null && cfg.serialNumber != null then "${cfg.email}-${cfg.serialNumber}" else null - ); - hasCustomerId = customerId != null; initScript = pkgs.writeShellScriptBin "sentinelone-init.sh" '' #!/bin/bash @@ -25,7 +20,7 @@ let S1_AGENT_MANAGEMENT_TOKEN=$(cat ${cfg.sentinelOneManagementTokenPath}) S1_AGENT_DEVICE_TYPE=desktop S1_AGENT_AUTO_START=true - ${optionalString hasCustomerId "S1_AGENT_CUSTOMER_ID=${customerId}"} + S1_AGENT_CUSTOMER_ID=${cfg.customerId} EOF cat << EOF > ${cfg.dataDir}/configuration/installation_params.json @@ -58,22 +53,11 @@ in customerId = mkOption { type = types.nullOr types.str; - default = null; description = '' - Set a customer specific identifier for the host. It is common practice to set this as your email and serial number separated by a hyphen. + Set a customer specific identifier for the host. ''; example = "me@gmail.com-FTXYZWW"; }; - email = mkOption { - type = types.nullOr types.str; - default = null; - example = "me@gmail.com"; - }; - serialNumber = mkOption { - type = types.nullOr types.str; - default = null; - example = "FTXYZWW"; - }; sentinelOneManagementTokenPath = mkOption { type = types.path; example = "/run/secrets/s1_mgmt_token"; @@ -87,33 +71,6 @@ in }; config = mkIf cfg.enable { - warnings = - optional (cfg.email != null) "services.sentinelone.email is deprecated in favour of customerId." - ++ optional ( - cfg.serialNumber != null - ) "services.sentinelone.serialNumber is deprecated in favour of customerId."; - - assertions = [ - { - assertion = (cfg.customerId != null) -> (cfg.email == null && cfg.serialNumber == null); - message = '' - You cannot use services.sentinelone.customerId with the deprecated services.sentinelone.email and services.sentinelone.serialNumber options. - ''; - } - { - assertion = (cfg.email != null) -> (cfg.serialNumber != null); - message = '' - services.sentinelone.email requires services.sentinelone.serialNumber to also be set. - ''; - } - { - assertion = (cfg.serialNumber != null) -> (cfg.email != null); - message = '' - services.sentinelone.serialNumber requires services.sentinelone.email to also be set. - ''; - } - ]; - users.users.sentinelone = { isSystemUser = true; createHome = true;