🚀 add editors module

nixos
Moritz Böhme 2022-03-23 12:41:04 +01:00
parent e972d70a1b
commit b280bf2b6e
No known key found for this signature in database
GPG Key ID: 213820E2795F5CF5
6 changed files with 130 additions and 95 deletions

25
modules/editors/code.nix Normal file
View File

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
let cfg = config.modules.editors;
in {
config = lib.mkIf cfg.code {
home-manager.users.moritz = {
programs.vscode = {
enable = true;
package = pkgs.vscode-fhsWithPackages (ps: with ps; [ git ]);
extensions = with pkgs.vscode-extensions;
[
vscodevim.vim
dracula-theme.theme-dracula
esbenp.prettier-vscode
pkief.material-icon-theme
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [{
name = "copilot";
publisher = "GitHub";
version = "1.7.3689";
sha256 = "16zrrymxfymc0039zf48vm22rxjs22mh9zkvkpg45grx2a2m19zh";
}];
};
};
};
}

View File

@ -1,5 +1,28 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ with lib; {
imports = [ ./emacs.nix ./idea.nix ./vim.nix ./vscode.nix ]; imports = [ ./emacs.nix ./idea.nix ./vim.nix ./code.nix ];
options.modules.editors = {
emacs = mkOption {
default = true;
type = types.bool;
example = false;
};
idea = mkOption {
default = false;
type = types.bool;
example = true;
};
vim = mkOption {
default = true;
type = types.bool;
example = false;
};
code = mkOption {
default = false;
type = types.bool;
example = true;
};
};
} }

View File

@ -4,7 +4,9 @@ let
emacs = with pkgs; emacs = with pkgs;
((emacsPackagesFor emacsGcc).emacsWithPackages ((emacsPackagesFor emacsGcc).emacsWithPackages
(epkgs: [ epkgs.vterm epkgs.emacsql-sqlite3 ])); (epkgs: [ epkgs.vterm epkgs.emacsql-sqlite3 ]));
cfg = config.modules.editors;
in { in {
config = lib.mkIf cfg.emacs {
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ]; fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
home-manager.users.moritz = { home-manager.users.moritz = {
@ -71,4 +73,5 @@ in {
isync isync
]; ];
}; };
};
} }

View File

@ -1,7 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ let cfg = config.modules.editors;
in {
config = lib.mkIf cfg.idea {
home-manager.users.moritz = { home-manager.users.moritz = {
home.packages = with pkgs; [ jdk jetbrains.idea-ultimate ]; home.packages = with pkgs; [ jdk jetbrains.idea-ultimate ];
}; };
};
} }

View File

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ let cfg = config.modules.editors;
in {
config = lib.mkIf cfg.vim {
home-manager.users.moritz.programs.neovim = { home-manager.users.moritz.programs.neovim = {
enable = true; enable = true;
vimAlias = true; vimAlias = true;
vimdiffAlias = true; vimdiffAlias = true;
}; };
};
} }

View File

@ -1,22 +0,0 @@
{ config, lib, pkgs, ... }:
{
home-manager.users.moritz = {
programs.vscode = {
enable = true;
package = pkgs.vscode-fhsWithPackages (ps: with ps; [ git ]);
extensions = with pkgs.vscode-extensions;
[
vscodevim.vim
dracula-theme.theme-dracula
esbenp.prettier-vscode
pkief.material-icon-theme
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [{
name = "copilot";
publisher = "GitHub";
version = "1.7.3689";
sha256 = "16zrrymxfymc0039zf48vm22rxjs22mh9zkvkpg45grx2a2m19zh";
}];
};
};
}