hyfetch: prevent writing config with default/empty settings (#3124)

This commit is contained in:
Lily Foster 2022-08-01 19:58:38 -04:00 committed by GitHub
parent d1c677ac25
commit 77648a07e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 3 deletions

View file

@ -37,7 +37,8 @@ in {
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."hyfetch.json".source =
jsonFormat.generate "hyfetch.json" cfg.settings;
xdg.configFile."hyfetch.json" = mkIf (cfg.settings != { }) {
source = jsonFormat.generate "hyfetch.json" cfg.settings;
};
};
}