1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-13 02:03:38 +02:00

autorandr: configModule.extraConfig

Add an option to programs.autorandr's configModule to allow arbitrary
extra config lines.

No option exists for adding arbitrary key/values to generated autorandr
profile config, as is common in other nix modules. This commit adds one.
This commit is contained in:
Zachary Hanham 2024-05-05 14:09:30 -04:00
parent fdaaf543ba
commit a2bf33bc21
2 changed files with 22 additions and 2 deletions

View File

@ -177,6 +177,18 @@ let
default = null;
example = "nearest";
};
extraConfig = 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.extraConfig != null) config.extraConfig)
else ''
output ${name}
off

View File

@ -23,6 +23,10 @@
[ 0.0 0.6 0.0 ] # d e f
[ 0.0 0.0 1.0 ] # g h i
];
extraConfig = ''
key1 value1
key2 value2
'';
};
};
};
@ -52,7 +56,10 @@
primary
mode 1920x1080
filter nearest
transform 0.600000,0.000000,0.000000,0.000000,0.600000,0.000000,0.000000,0.000000,1.000000''
transform 0.600000,0.000000,0.000000,0.000000,0.600000,0.000000,0.000000,0.000000,1.000000
key1 value1
key2 value2
''
}
'';
};