diff --git a/nix/README.md b/nix/README.md index 6fb8868..01722a1 100644 --- a/nix/README.md +++ b/nix/README.md @@ -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 nix-darwin](https://github.com/LnL7/nix-darwin#install) and symlink the `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. -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. diff --git a/nix/home/programs/helix/default.nix b/nix/home/programs/helix/default.nix new file mode 100644 index 0000000..5d3fca8 --- /dev/null +++ b/nix/home/programs/helix/default.nix @@ -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 + }; + }; + + }; + }; +} diff --git a/nix/home/programs/nvim/default.nix b/nix/home/programs/nvim/default.nix index 268e5a3..b20c250 100644 --- a/nix/home/programs/nvim/default.nix +++ b/nix/home/programs/nvim/default.nix @@ -103,6 +103,10 @@ with builtins; plugin = neogit; config = '' noremap g :Neogit + lua << EOF + local neogit = require('neogit') + neogit.setup {} + EOF ''; } vinegar diff --git a/nix/home/universal.nix b/nix/home/universal.nix index a1e82ec..8f849e4 100644 --- a/nix/home/universal.nix +++ b/nix/home/universal.nix @@ -45,6 +45,7 @@ with builtins; (import ./programs/zsh) (import ./programs/tmux) (import ./programs/nvim) + (import ./programs/helix) ]; home.packages = defaultPkgs; diff --git a/nix/system/worktop/darwin-configuration.nix b/nix/system/worktop/darwin-configuration.nix index 166bf17..7fa4211 100644 --- a/nix/system/worktop/darwin-configuration.nix +++ b/nix/system/worktop/darwin-configuration.nix @@ -41,6 +41,7 @@ let }; in { + imports = [ ]; nixpkgs.config.allowUnfree = true; # 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: # 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. 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="Discord" app="^Discord$" 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 ''; };