From 04d2bad3cbaa6207f3f9b5060d3ba130c659f390 Mon Sep 17 00:00:00 2001 From: RockWolf Date: Sun, 25 Jan 2026 16:53:35 +0100 Subject: [PATCH] nixos/nm-file-secret-agent: add `trim` option The `trim` option has been introduced in v1.2.0 https://git.hanse.de/lilly/nm-file-secret-agent/releases/tag/v1.2.0 --- nixos/modules/services/networking/nm-file-secret-agent.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/modules/services/networking/nm-file-secret-agent.nix b/nixos/modules/services/networking/nm-file-secret-agent.nix index 7078b998d575..f1cac3dd279d 100644 --- a/nixos/modules/services/networking/nm-file-secret-agent.nix +++ b/nixos/modules/services/networking/nm-file-secret-agent.nix @@ -24,6 +24,7 @@ let // lib.optionalAttrs (i.matchSetting != null) { match_setting = i.matchSetting; } + // lib.optionalAttrs (i.trim != null) { trim = i.trim; } ) cfg.ensureProfiles.secrets.entries; }; nmFileSecretAgentConfigFile = toml.generate "config.toml" nmFileSecretAgentConfig; @@ -108,6 +109,11 @@ in description = "file from which the secret value is read"; type = lib.types.str; }; + trim = lib.mkOption { + description = "whether leading and trailing whitespace should be stripped from the files content before being passed to NetworkManager"; + type = lib.types.nullOr lib.types.bool; + default = null; + }; }; } );