mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
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:
@@ -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 != { }) {
|
||||
|
||||
Reference in New Issue
Block a user