1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-02 16:09:46 +01:00

cosmic: tidy up options

This commit is contained in:
atagen 2024-08-01 13:28:50 +10:00
parent c88b8ebf61
commit a12755f889

View file

@ -85,6 +85,7 @@ let
cfg = config.programs.cosmic; cfg = config.programs.cosmic;
in { in {
meta.maintainers = [ hm.maintainers.atagen ];
options.programs.cosmic = { options.programs.cosmic = {
enable = with lib; mkEnableOption "COSMIC DE"; enable = with lib; mkEnableOption "COSMIC DE";
@ -181,18 +182,15 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "programs.cosmic" pkgs platforms.linux) ];
xdg.configFile = { xdg.configFile = {
"cosmic/com.system76.CosmicSettings.Shortcuts/v1/custom".text = "cosmic/com.system76.CosmicSettings.Shortcuts/v1/custom".text =
mapBindings cfg.keybindings; (lib.mkIf cfg.keybindings != [ ]) mapBindings cfg.keybindings;
"cosmic/com.system76.CosmicSettings.Shortcuts/v1/defaults" = { "cosmic/com.system76.CosmicSettings.Shortcuts/v1/defaults" = {
text = "{}"; text = "{}";
enable = !cfg.defaultKeybindings; enable = !cfg.defaultKeybindings;
}; };
} // concatMapAttrs } // concatMapAttrs
(application: options: mapCosmicSettings application options) (application: options: mapCosmicSettings application options)
config.programs.cosmic.settings; cfg.settings;
}; };
} }