2024-05-27 15:09:37 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2024-05-27 16:17:34 +02:00
|
|
|
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 {
|
2024-05-27 16:17:34 +02:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|