feat: add jetbrains module

This commit is contained in:
Moritz Böhme 2024-05-27 15:09:37 +02:00
parent b526cfc6f8
commit f6174bc0ba
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
4 changed files with 131 additions and 6 deletions

View file

@ -4,16 +4,23 @@
, ...
}:
with lib;
let
cfg = config.my.profiles.webis;
inherit (lib) mkEnableOption mkIf;
in
{
options.my.profiles.webis.enable = mkEnableOption "webis profile";
config = mkIf cfg.enable {
my.programs.ssh.includeSecrets = [ ../../secrets/webis-ssh.age ];
my.programs = {
ssh.includeSecrets = [ ../../secrets/webis-ssh.age ];
jetbrains = {
pycharm.enable = true;
pycharm.package = pkgs.jetbrains.pycharm-professional;
};
};
age.secrets.webis = {
file = ../../secrets/webis.age;
name = "webis.ovpn";
@ -25,9 +32,6 @@ in
updateResolvConf = true;
};
};
environment.systemPackages = with pkgs; [
jetbrains.pycharm-professional
];
programs.dconf.enable = true;
};
}

View file

@ -133,7 +133,7 @@ in
windowrulev2 = rounding 0, xwayland:1, floating:1
windowrulev2 = center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$
windowrulev2 = size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$
${mkRules ["opaque" "noshadow" "noblur" "noanim" "move cursor 5 5"] ["class:^(.*jetbrains-.*)$"]}
windowrulev2 = nofocus, class:^jetbrains-(?!toolbox), floating:1, title:^win\d+$
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER

View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkEnableOption mkIf mkOption any filterAttrs mapAttrsToList;
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.pycharm-community;
};
};
};
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;
};
};
}

View file

@ -0,0 +1,84 @@
""" Map leader to space ---------------------
let mapleader=" "
""" Plugins --------------------------------
set surround
set commentary
""" Common settings -------------------------
set showmode
set so=5
set incsearch
set nu
""" Which-Key
set which-key
set timeoutlen=5000
""" Idea specific settings ------------------
set ideajoin
""" Mappings --------------------------------
"" Quick action
let g:WhichKeyDesc_quick_action = '<leader>q Quick action'
map <leader>q <Action>(ShowIntentionActions)
"" Refactor binds
let g:WhichKeyDesc_inline = '<leader>i Inline'
map <leader>i <Action>(Inline)
let g:WhichKeyDesc_extract = '<leader>e Extract'
let g:WhichKeyDesc_extract_variable = '<leader>ev Extract variable'
map <leader>ev <Action>(IntroduceVariable)
let g:WhichKeyDesc_extract_constant = '<leader>ec Extract constant'
map <leader>ec <Action>(IntroduceConstant)
let g:WhichKeyDesc_extract_field = '<leader>ef Extract field'
map <leader>ef <Action>(IntroduceField)
let g:WhichKeyDesc_extract_parameter = '<leader>ep Extract parameter'
map <leader>ep <Action>(IntroduceParameter)
let g:WhichKeyDesc_rename = '<leader>r Rename'
map <leader>r <Action>(RenameElement)
"" Navigation
let g:WhichKeyDesc_prev_buffer = ']b Previous buffer'
map [b <Action>(PreviousTab)
let g:WhichKeyDesc_next_buffer = ']b Next buffer'
map ]b <Action>(NextTab)
let g:WhichKeyDesc_prev_error = 'gI Goto Implementation'
map gI <Action>(GotoImplementation)
"" Other
let g:WhichKeyDesc_terminal = '<leader>t Terminal'
map <leader>t <Action>(ActivateTerminalToolWindow)
map <Esc> <Action>(HideActiveWindow)
map = <Action>(ReformatCode)
"" Folding
let g:WhichKeyDesc_folding = 'z Folding'
let g:WhichKeyDesc_folding_toggle = 'za Toggle fold'
map za <Action>(ExpandCollapseToggleAction)
let g:WhichKeyDesc_folding_expand = 'zr Fold less'
map zr <Action>(ExpandRegion)
let g:WhichKeyDesc_folding_collapse = 'zR Open all folds'
map zR <Action>(ExpandAllRegions)
let g:WhichKeyDesc_folding_collapse = 'zm Fold more'
map zm <Action>(CollapseRegion)
let g:WhichKeyDesc_folding_collapse = 'zM Close all folds'
map zM <Action>(CollapseAllRegions)
let g:WhichKeyDesc_folding_collapse_doc = 'zc Collapse doc comments'
map zc <Action>(CollapseDocComments)
let g:WhichKeyDesc_folding_expand_doc = 'zC Expand doc comments'
map zC <Action>(ExpandDocComments)
let g:WhichKeyDesc_folding_expand_level_one = 'z1 Expand all to level 1'
map z1 <Action>(ExpandAllToLevel1)
let g:WhichKeyDesc_folding_expand_level_two = 'z2 Expand all to level 2'
map z2 <Action>(ExpandAllToLevel2)
let g:WhichKeyDesc_folding_expand_level_three = 'z3 Expand all to level 3'
map z3 <Action>(ExpandAllToLevel3)
let g:WhichKeyDesc_folding_expand_level_four = 'z4 Expand all to level 4'
map z4 <Action>(ExpandAllToLevel4)