From 30c50c14e22f9e00f24a72ebacbffc529f3c0e83 Mon Sep 17 00:00:00 2001 From: Zachary Hanham Date: Sun, 5 May 2024 14:09:30 -0400 Subject: [PATCH] autorandr: configModule.extraLines Add an option to programs.autorandr's configModule to allow arbitrary extraLines. No option exists for adding arbitrary key/values to generated autorandr profile config, as is common in other nix modules. This commit adds one. --- modules/programs/autorandr.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/programs/autorandr.nix b/modules/programs/autorandr.nix index edbe83de636c..1fb87081b47d 100644 --- a/modules/programs/autorandr.nix +++ b/modules/programs/autorandr.nix @@ -177,6 +177,18 @@ let default = null; example = "nearest"; }; + + extraLines = mkOption { + type = types.nullOr types.lines; + description = "Extra lines to append to this profile's config."; + default = null; + example = literalExpression '' + ''' + x-prop-non_desktop 0 + some-key some-value + ''' + ''; + }; }; }; @@ -267,7 +279,8 @@ let + concatMapStringsSep "," toString (flatten config.transform)) ++ optional (config.scale != null) ((if config.scale.method == "factor" then "scale" else "scale-from") - + " ${toString config.scale.x}x${toString config.scale.y}")) + + " ${toString config.scale.x}x${toString config.scale.y}") + ++ optional (config.extraLines != null) config.extraLines) else '' output ${name} off