config: improve conditional for checking NixOS module

This is mainly for integrating NixOS modules with home-manager by
setting them conditionally if certain options are enabled. This prevents
duplicate configurations which often result in conflicts (like the
Firefox module that is both available on NixOS and home-manager).
This commit is contained in:
Gabriel Arazas 2023-09-25 23:00:40 +08:00
parent ac3476b839
commit c35bb4b185
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ in {
ffmpeg-full # Ah yes, everyman's multimedia swiss army knife. ffmpeg-full # Ah yes, everyman's multimedia swiss army knife.
imagemagick # Ah yes, everyman's image manipulation tool. imagemagick # Ah yes, everyman's image manipulation tool.
gmic # Don't let the gimmicks fool you, it's a magical image framework. gmic # Don't let the gimmicks fool you, it's a magical image framework.
] ++ (lib.optional (osConfig ? programs.blender.enable && !osConfig.programs.blender.enable) blender); ] ++ (lib.optional (osConfig ? programs.blender.enable -> !osConfig.programs.blender.enable) blender);
}) })
(lib.mkIf cfg.audio.enable { (lib.mkIf cfg.audio.enable {

View File

@ -33,7 +33,7 @@
}; };
# Despite the name, it isn't a browser for furries. # Despite the name, it isn't a browser for furries.
programs.firefox = lib.mkIf (osConfig ? programs.firefox.enable && !osConfig.programs.firefox.enable) { programs.firefox = lib.mkIf (osConfig ? programs.firefox.enable -> !osConfig.programs.firefox.enable) {
enable = true; enable = true;
package = with pkgs; wrapFirefox firefox-unwrapped { package = with pkgs; wrapFirefox firefox-unwrapped {