dotfiles/modules/programs/jetbrains/default.nix

39 lines
914 B
Nix
Raw Normal View History

2024-05-27 15:09:37 +02:00
{ config, lib, pkgs, ... }:
let
inherit (lib) any filterAttrs mapAttrsToList mkEnableOption mkIf mkOption;
2024-05-27 15:09:37 +02:00
cfg = config.my.programs.jetbrains;
isEnabled = _: value: value.enable;
anyEnabled = any (x: x) (mapAttrsToList isEnabled cfg);
in
{
options.my.programs.jetbrains = {
pycharm = {
enable = mkEnableOption "pycharm";
package = mkOption {
default = pkgs.jetbrains.pycharm-community;
};
};
idea = {
enable = mkEnableOption "idea";
package = mkOption {
default = pkgs.jetbrains.idea-community;
2024-05-27 15:09:37 +02:00
};
};
};
config = mkIf anyEnabled {
home-manager.users.moritz = {
xdg.configFile."ideavim/ideavimrc" = {
source = ./ideavimrc;
};
home.packages =
let
enabledPackages = filterAttrs isEnabled cfg;
in
mapAttrsToList (_: value: value.package) enabledPackages;
};
};
}