mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
nixos/gtklock: ensure main config section doesn't get set if config is empty
This commit is contained in:
@@ -61,13 +61,15 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.gtklock.config.main = {
|
||||
style = lib.mkIf (cfg.style != null) "${pkgs.writeText "style.css" cfg.style}";
|
||||
programs.gtklock.config.main = lib.mkMerge [
|
||||
(lib.mkIf (cfg.style != null) {
|
||||
style = "${pkgs.writeText "style.css" cfg.style}";
|
||||
})
|
||||
|
||||
modules = lib.mkIf (cfg.modules != [ ]) (
|
||||
map (pkg: "${pkg}/lib/gtklock/${lib.removePrefix "gtklock-" pkg.pname}.so") cfg.modules
|
||||
);
|
||||
};
|
||||
(lib.mkIf (cfg.modules != [ ]) {
|
||||
modules = map (pkg: "${pkg}/lib/gtklock/${lib.removePrefix "gtklock-" pkg.pname}.so") cfg.modules;
|
||||
})
|
||||
];
|
||||
|
||||
environment.etc."xdg/gtklock/config.ini" = lib.mkIf (cfg.config != { }) {
|
||||
source = configFormat.generate "config.ini" cfg.config;
|
||||
|
||||
Reference in New Issue
Block a user