add vim module
This commit is contained in:
parent
e7352f9530
commit
dc8a2322fc
5 changed files with 96 additions and 71 deletions
|
@ -48,7 +48,6 @@ with config;
|
|||
python3
|
||||
fzf
|
||||
ripgrep
|
||||
vim
|
||||
lsd
|
||||
unstable.atuin
|
||||
|
||||
|
@ -89,12 +88,6 @@ with config;
|
|||
# nix tools
|
||||
nvd
|
||||
];
|
||||
|
||||
sessionVariables = {
|
||||
EDITOR = "vim";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,66 +1,6 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.mySystem.editor.vscode;
|
||||
# VSCode Community Extensions. These are updated daily.
|
||||
vscodeCommunityExtensions = [
|
||||
"dracula-theme.theme-dracula"
|
||||
"esbenp.prettier-vscode"
|
||||
"jnoortheen.nix-ide"
|
||||
"mikestead.dotenv"
|
||||
"ms-azuretools.vscode-docker"
|
||||
# Python extensions *required* for redhat.ansible/vscode-yaml
|
||||
"ms-python.python"
|
||||
"ms-python.vscode-pylance"
|
||||
"ms-vscode-remote.remote-ssh"
|
||||
"ms-vscode-remote.remote-ssh-edit"
|
||||
"pkief.material-icon-theme"
|
||||
"redhat.ansible"
|
||||
"redhat.vscode-yaml"
|
||||
"signageos.signageos-vscode-sops"
|
||||
"tamasfe.even-better-toml"
|
||||
"tyriar.sort-lines"
|
||||
"yzhang.markdown-all-in-one"
|
||||
"mrmlnc.vscode-json5"
|
||||
"editorconfig.editorconfig"
|
||||
];
|
||||
# Nixpkgs Extensions. These are updated whenver they get around to it.
|
||||
vscodeNixpkgsExtensions = [
|
||||
# Continue ships with a binary that requires the patchelf fix which is done by default in nixpkgs.
|
||||
"continue.continue"
|
||||
];
|
||||
# Straight from the VSCode marketplace.
|
||||
marketplaceExtensions = [
|
||||
{
|
||||
name = "copilot";
|
||||
publisher = "github";
|
||||
version = "1.219.0";
|
||||
sha256 = "Y/l59JsmAKtENhBBf965brSwSkTjSOEuxc3tlWI88sY=";
|
||||
}
|
||||
{
|
||||
name = "copilot-chat";
|
||||
publisher = "github";
|
||||
version = "0.17.1";
|
||||
sha256 = "Aa4gmHJCveP18v6CAvmkxmqf1JV1LygyQFNpzDz64Gw=";
|
||||
}
|
||||
];
|
||||
# Extract extension strings and coerce them to a list of valid attribute paths.
|
||||
vscodeCommunityExtensionsPackages = map (ext: getAttrFromPath (splitString "." ext) pkgs.vscode-marketplace) vscodeCommunityExtensions;
|
||||
nixpkgsExtensionsPackages = map (ext: getAttrFromPath (splitString "." ext) pkgs.vscode-extensions) vscodeNixpkgsExtensions;
|
||||
marketplaceExtensionsPackages = pkgs.vscode-utils.extensionsFromVscodeMarketplace marketplaceExtensions;
|
||||
in
|
||||
{
|
||||
options.mySystem.editor.vscode.enable = mkEnableOption "vscode";
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# Enable vscode & addons
|
||||
environment.systemPackages = with pkgs; [
|
||||
(vscode-with-extensions.override {
|
||||
inherit (unstable) vscode;
|
||||
# Merge all the extension packages together.
|
||||
vscodeExtensions =
|
||||
vscodeCommunityExtensionsPackages ++ nixpkgsExtensionsPackages ++ marketplaceExtensionsPackages;
|
||||
})
|
||||
];
|
||||
};
|
||||
imports = [
|
||||
./vim.nix
|
||||
./vscode.nix
|
||||
];
|
||||
}
|
||||
|
|
25
nixos/modules/nixos/editor/vim.nix
Normal file
25
nixos/modules/nixos/editor/vim.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
# /home/jahanson/projects/mochi/nixos/modules/nixos/editor/vim.nix
|
||||
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.mySystem.editor.vim;
|
||||
users = [ "jahanson" ];
|
||||
in
|
||||
{
|
||||
options.mySystem.editor.vim.enable = mkEnableOption "vim";
|
||||
config = mkIf cfg.enable {
|
||||
# Enable vim and set as default editor
|
||||
programs.vim.defaultEditor = true;
|
||||
|
||||
# Visual mode off and syntax highlighting on
|
||||
home-manager.users = mapAttrs
|
||||
(user: _: {
|
||||
home.file.".vimrc".text = ''
|
||||
set mouse-=a
|
||||
syntax on
|
||||
'';
|
||||
})
|
||||
(listToAttrs (map (u: { name = u; value = { }; }) users));
|
||||
};
|
||||
}
|
66
nixos/modules/nixos/editor/vscode.nix
Normal file
66
nixos/modules/nixos/editor/vscode.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.mySystem.editor.vscode;
|
||||
# VSCode Community Extensions. These are updated daily.
|
||||
vscodeCommunityExtensions = [
|
||||
"dracula-theme.theme-dracula"
|
||||
"esbenp.prettier-vscode"
|
||||
"jnoortheen.nix-ide"
|
||||
"mikestead.dotenv"
|
||||
"ms-azuretools.vscode-docker"
|
||||
# Python extensions *required* for redhat.ansible/vscode-yaml
|
||||
"ms-python.python"
|
||||
"ms-python.vscode-pylance"
|
||||
"ms-vscode-remote.remote-ssh"
|
||||
"ms-vscode-remote.remote-ssh-edit"
|
||||
"pkief.material-icon-theme"
|
||||
"redhat.ansible"
|
||||
"redhat.vscode-yaml"
|
||||
"signageos.signageos-vscode-sops"
|
||||
"tamasfe.even-better-toml"
|
||||
"tyriar.sort-lines"
|
||||
"yzhang.markdown-all-in-one"
|
||||
"mrmlnc.vscode-json5"
|
||||
"editorconfig.editorconfig"
|
||||
];
|
||||
# Nixpkgs Extensions. These are updated whenver they get around to it.
|
||||
vscodeNixpkgsExtensions = [
|
||||
# Continue ships with a binary that requires the patchelf fix which is done by default in nixpkgs.
|
||||
"continue.continue"
|
||||
];
|
||||
# Straight from the VSCode marketplace.
|
||||
marketplaceExtensions = [
|
||||
{
|
||||
name = "copilot";
|
||||
publisher = "github";
|
||||
version = "1.219.0";
|
||||
sha256 = "Y/l59JsmAKtENhBBf965brSwSkTjSOEuxc3tlWI88sY=";
|
||||
}
|
||||
{
|
||||
name = "copilot-chat";
|
||||
publisher = "github";
|
||||
version = "0.17.1";
|
||||
sha256 = "Aa4gmHJCveP18v6CAvmkxmqf1JV1LygyQFNpzDz64Gw=";
|
||||
}
|
||||
];
|
||||
# Extract extension strings and coerce them to a list of valid attribute paths.
|
||||
vscodeCommunityExtensionsPackages = map (ext: getAttrFromPath (splitString "." ext) pkgs.vscode-marketplace) vscodeCommunityExtensions;
|
||||
nixpkgsExtensionsPackages = map (ext: getAttrFromPath (splitString "." ext) pkgs.vscode-extensions) vscodeNixpkgsExtensions;
|
||||
marketplaceExtensionsPackages = pkgs.vscode-utils.extensionsFromVscodeMarketplace marketplaceExtensions;
|
||||
in
|
||||
{
|
||||
options.mySystem.editor.vscode.enable = mkEnableOption "vscode";
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# Enable vscode & addons
|
||||
environment.systemPackages = with pkgs; [
|
||||
(vscode-with-extensions.override {
|
||||
inherit (unstable) vscode;
|
||||
# Merge all the extension packages together.
|
||||
vscodeExtensions =
|
||||
vscodeCommunityExtensionsPackages ++ nixpkgsExtensionsPackages ++ marketplaceExtensionsPackages;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
|
@ -18,6 +18,7 @@ with lib;
|
|||
boot.tmp.cleanOnBoot = true;
|
||||
mySystem = {
|
||||
# basics for all devices
|
||||
editor.vim.enable = true;
|
||||
time.timeZone = "America/Chicago";
|
||||
security.increaseWheelLoginLimits = true;
|
||||
system.packages = [ pkgs.bat ];
|
||||
|
|
Loading…
Reference in a new issue