oh-my-posh: add assertion for config source

We only use one of the config methods, let user know their configuration
will be discarded if they attempt to use more than one.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2025-09-17 00:00:42 -05:00
parent 624c97de9c
commit 51372c4afb

View File

@@ -72,6 +72,18 @@ in
};
config = mkIf cfg.enable {
assertions = [
{
assertion =
lib.count (x: x) [
(cfg.settings != { })
(cfg.useTheme != null)
(cfg.configFile != null)
] <= 1;
message = "oh-my-posh: Only one of 'settings', 'useTheme', or 'configFile' can be configured at a time.";
}
];
home.packages = [ cfg.package ];
xdg.configFile."oh-my-posh/config.json" = mkIf (cfg.settings != { }) {