Merge remote-tracking branch 'refs/remotes/origin/nixos' into nixos

nixos
Moritz Böhme 2024-06-12 09:42:13 +02:00
commit bdc849205e
8 changed files with 137 additions and 18 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

@ -12,8 +12,6 @@ in
config = mkIf cfg.enable {
home-manager.users.moritz = {
# HACK: to make foot server work
systemd.user.services.foot.Service.Environment = lib.mkForce "PATH=/run/current-system/sw/bin/";
programs.foot = {
enable = true;
settings = {

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

View File

@ -36,12 +36,13 @@ in
nixd
nixpkgs-fmt
nodePackages.bash-language-server
nodePackages.jsonlint
python3Packages.python-lsp-server
python3Packages.ruff-lsp
shellcheck
shfmt
stable.yamlfix
statix
taplo
stable.yamlfix
yamllint
];
extraLuaConfig = readFile ./options.lua;

View File

@ -10,7 +10,6 @@ null_ls.setup({
null_ls.builtins.diagnostics.deadnix,
null_ls.builtins.diagnostics.dotenv_linter,
null_ls.builtins.diagnostics.fish,
null_ls.builtins.diagnostics.jsonlint,
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.diagnostics.statix,
null_ls.builtins.diagnostics.trail_space,

View File

@ -23,12 +23,7 @@ local lspconfig = require("lspconfig")
local on_attach_def = function(client, bufnr)
require("which-key").register({
K = {
function()
local winid = require("ufo").peekFoldedLinesUnderCursor()
if not winid then
vim.lsp.buf.hover()
end
end,
vim.lsp.buf.hover,
"Hover",
},
["<leader>"] = {
@ -102,7 +97,7 @@ local on_attach_def = function(client, bufnr)
}
local timeout = vim.tbl_contains(slow_lsp_servers, client.name, {}) and 500 or 0
vim.defer_fn(function()
vim.lsp.inlay_hint.enable(bufnr, true)
vim.lsp.inlay_hint.enable(true, { bufnr })
end, timeout)
end
end