updates to nvim config, helix initial setup

This commit is contained in:
Haak Saxberg 2023-11-03 11:07:59 -07:00
parent 8600e668c5
commit 396fcf26ac
5 changed files with 63 additions and 3 deletions

View file

@ -1,8 +1,13 @@
The install script is only for linux machines at the moment. The install script (`build.sh`) is only for linux machines at the moment.
For Apple machines, [install For Apple machines, [install
nix-darwin](https://github.com/LnL7/nix-darwin#install) and symlink the nix-darwin](https://github.com/LnL7/nix-darwin#install) and symlink the
`darwin-configuration.nix` file (probably in `worktop`? why else would you have `darwin-configuration.nix` file (probably in `worktop`? why else would you have
an OSX machine?) to wherever it needs to go for that version of nix-darwin. an OSX machine?) to wherever it needs to go for that version of nix-darwin.
Home-manager is installed separately and not currently managed by any of the nix configurations. ## Home-manager
On darwin machines, home-manager is incorporated as a nix-darwin module; you
will need to add its (master) channel before the system rebuild will work.
On other systems, ome-manager is installed separately and not currently managed
by any of the nix configurations.

View file

@ -0,0 +1,47 @@
{ pkgs, ... }:
{
programs.helix = {
enable = true;
languages = {
language-server.rnix-lsp = {
command = "${pkgs.rnix-lsp}/bin/rnix-lsp";
};
language = [
{
name = "nix";
auto-format = true;
language-servers = [
{ name = "rnix-lsp"; }
];
}
];
};
settings = {
theme = "catppuccin_mocha";
editor = {
line-number = "relative";
lsp.display-messages = true;
cursor-shape = {
insert = "underline";
normal = "block";
select = "block";
};
};
keys = {
normal = {
g = { a = "code_action"; }; # Maps `ga` to show possible code actions
"ret" = [ "move_line_down" "goto_first_nonwhitespace" ]; # Maps the enter key to move to start of next line
X = "extend_line_above";
D = "delete_char_backward";
";" = "command_mode";
"S-ret" = [ "move_line_up" "goto_first_nonwhitespace" ];
};
insert = {
j = { j = "normal_mode"; }; # Maps `jk` to exit insert mode
};
};
};
};
}

View file

@ -103,6 +103,10 @@ with builtins;
plugin = neogit; plugin = neogit;
config = '' config = ''
noremap <leader>g :Neogit<CR> noremap <leader>g :Neogit<CR>
lua << EOF
local neogit = require('neogit')
neogit.setup {}
EOF
''; '';
} }
vinegar vinegar

View file

@ -45,6 +45,7 @@ with builtins;
(import ./programs/zsh) (import ./programs/zsh)
(import ./programs/tmux) (import ./programs/tmux)
(import ./programs/nvim) (import ./programs/nvim)
(import ./programs/helix)
]; ];
home.packages = defaultPkgs; home.packages = defaultPkgs;

View file

@ -41,6 +41,7 @@ let
}; };
in in
{ {
imports = [ <home-manager/nix-darwin> ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search by name, run: # List packages installed in system profile. To search by name, run:
@ -73,7 +74,8 @@ in
# have to do this to play nicely with home-manager: # have to do this to play nicely with home-manager:
# https://github.com/nix-community/home-manager/issues/4026 # https://github.com/nix-community/home-manager/issues/4026
users.users.haak.home = "/Users/haak"; users.users.haak.home = "/Users/haak/";
home-manager.users.haak.imports = [ ../../home/commandline.nix ];
# Auto upgrade nix package and the daemon service. # Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true; services.nix-daemon.enable = true;
@ -144,6 +146,7 @@ in
yabai -m rule --add label="VLC" app="^VLC media player$" title=".*" manage=off yabai -m rule --add label="VLC" app="^VLC media player$" title=".*" manage=off
yabai -m rule --add label="Discord" app="^Discord$" title=".*" manage=off yabai -m rule --add label="Discord" app="^Discord$" title=".*" manage=off
yabai -m rule --add label="1Password" app="^1Password.*$" title=".*" manage=off yabai -m rule --add label="1Password" app="^1Password.*$" title=".*" manage=off
yabai -m rule --add label="Cypress" app="^Cypress.*$" title=".*" manage=off
''; '';
}; };