From 466dbad9de9473a4e139d51682de5d1ca3009db2 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Fri, 8 Nov 2024 09:01:09 +0700 Subject: [PATCH] ideavimrc: move to home/ideavimrc.nix --- home/config/ideavim/.ideavimrc | 31 -------------------------- home/config/ideavim/default.nix | 11 --------- home/default.nix | 2 +- home/ideavimrc.nix | 38 ++++++++++++++++++++++++++++++++ home/programs/default.nix | 1 + home/programs/jetbrains-idea.nix | 13 +++++++++++ options/programs.nix | 1 + profiles/castle.nix | 1 + 8 files changed, 55 insertions(+), 43 deletions(-) delete mode 100644 home/config/ideavim/.ideavimrc delete mode 100644 home/config/ideavim/default.nix create mode 100644 home/ideavimrc.nix create mode 100644 home/programs/jetbrains-idea.nix diff --git a/home/config/ideavim/.ideavimrc b/home/config/ideavim/.ideavimrc deleted file mode 100644 index 686b5ff..0000000 --- a/home/config/ideavim/.ideavimrc +++ /dev/null @@ -1,31 +0,0 @@ -set nrformats-=octal -set incsearch -set scrolloff=5 -set sidescrolloff=5 -set history=1000 - -set clipboard^=unnamedplus,unnamed -set hlsearch -set ignorecase -set smartcase -set visualbell - -set showmode -set number relativenumber - -" change leader key to space -nmap -let mapleader = " " - -" Smart join for -set ideajoin -" Map vim marks to IDEA global marks -set ideamarks - -" Mappings -nmap gd (GotoTypeDeclaration) -nmap gi (GotoImplementation) -nmap (RenameElement) -nmap K (ShowHoverInfo) - -nmap db (ToggleLineBreakpoint) diff --git a/home/config/ideavim/default.nix b/home/config/ideavim/default.nix deleted file mode 100644 index 06e3e0c..0000000 --- a/home/config/ideavim/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.profile.ideavim; -in -{ - config = lib.mkIf cfg.enable { - home.file.".ideavimrc" = { - source = ./.ideavimrc; - }; - }; -} diff --git a/home/default.nix b/home/default.nix index 3061381..bc13eca 100644 --- a/home/default.nix +++ b/home/default.nix @@ -13,8 +13,8 @@ in ./environments ./direnv.nix - ./config/ideavim ./secrets.nix + ./ideavimrc.nix ]; home = { diff --git a/home/ideavimrc.nix b/home/ideavimrc.nix new file mode 100644 index 0000000..84e43f3 --- /dev/null +++ b/home/ideavimrc.nix @@ -0,0 +1,38 @@ +{ ... }: +{ + home.file.".ideavimrc".text = + # vim + '' + set nrformats-=octal + set incsearch + set scrolloff=5 + set sidescrolloff=5 + set history=1000 + + set clipboard^=unnamedplus,unnamed + set hlsearch + set ignorecase + set smartcase + set visualbell + + set showmode + set number relativenumber + + " change leader key to space + nmap + let mapleader = " " + + " Smart join for + set ideajoin + " Map vim marks to IDEA global marks + set ideamarks + + " Mappings + nmap gd (GotoTypeDeclaration) + nmap gi (GotoImplementation) + nmap (RenameElement) + nmap K (ShowHoverInfo) + + nmap db (ToggleLineBreakpoint) + ''; +} diff --git a/home/programs/default.nix b/home/programs/default.nix index 22fb076..cbeeb76 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -13,6 +13,7 @@ ./github.nix ./go.nix ./jellyfin.nix + ./jetbrains-idea.nix ./kitty.nix ./microsoft-edge.nix ./mongodb-compass.nix diff --git a/home/programs/jetbrains-idea.nix b/home/programs/jetbrains-idea.nix new file mode 100644 index 0000000..b18158d --- /dev/null +++ b/home/programs/jetbrains-idea.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.profile.home.programs.jetbrains.idea; + inherit (lib) mkIf; +in +{ + config = mkIf cfg.enable { home.packages = with pkgs; [ jetbrains.idea-community-bin ]; }; +} diff --git a/options/programs.nix b/options/programs.nix index 9b64e54..f8e80ff 100644 --- a/options/programs.nix +++ b/options/programs.nix @@ -111,6 +111,7 @@ zoom.enable = lib.mkEnableOption "zoom"; elisa.enable = lib.mkEnableOption "elisa"; obsidian.enable = lib.mkEnableOption "obsidian"; + jetbrains.idea.enable = lib.mkEnableOption "jetbrains.idea"; }; programs = { diff --git a/profiles/castle.nix b/profiles/castle.nix index 58f594c..40727e1 100644 --- a/profiles/castle.nix +++ b/profiles/castle.nix @@ -112,6 +112,7 @@ in zoom.enable = true; elisa.enable = true; obsidian.enable = true; + jetbrains.idea.enable = true; }; programs.mongodb-compass.enable = true;