From ddb857e6acfead07a9bdbf591cac148f88e291b3 Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Fri, 27 Dec 2024 23:39:34 -0800 Subject: [PATCH] Switched from alejandra to nixfmt(-rfc-style) Also re-formatted nix files --- config/default.nix | 11 +++--- config/plugins/cmp.nix | 16 ++++---- config/plugins/lsp.nix | 5 ++- config/plugins/rhubarb.nix | 9 +++-- config/plugins/telescope.nix | 8 +++- config/plugins/vim-obsession.nix | 3 +- flake.nix | 66 +++++++++++++++++--------------- 7 files changed, 66 insertions(+), 52 deletions(-) diff --git a/config/default.nix b/config/default.nix index 08f8e69..a2b89ad 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ # Import all your configuration modules here # imports = [./bufferline.nix]; imports = [ @@ -44,13 +45,13 @@ autoCmd = [ { - event = ["BufEnter"]; - pattern = ["*"]; + event = [ "BufEnter" ]; + pattern = [ "*" ]; command = "setlocal cursorline"; } { - event = ["BufLeave"]; - pattern = ["*"]; + event = [ "BufLeave" ]; + pattern = [ "*" ]; command = "setlocal nocursorline"; } ]; diff --git a/config/plugins/cmp.nix b/config/plugins/cmp.nix index 6073086..ea7b08b 100644 --- a/config/plugins/cmp.nix +++ b/config/plugins/cmp.nix @@ -2,7 +2,9 @@ plugins.cmp = { enable = true; settings = { - completion = {keyword_length = 2;}; + completion = { + keyword_length = 2; + }; mapping = { "" = "cmp.mapping.select_next_item()"; @@ -22,12 +24,12 @@ ''; sources = [ - {name = "nvim_lsp";} - {name = "buffer";} - {name = "cmdline";} - {name = "cmp-clippy";} - {name = "luasnip";} - {name = "path";} + { name = "nvim_lsp"; } + { name = "buffer"; } + { name = "cmdline"; } + { name = "cmp-clippy"; } + { name = "luasnip"; } + { name = "path"; } ]; }; }; diff --git a/config/plugins/lsp.nix b/config/plugins/lsp.nix index 608b15f..5781845 100644 --- a/config/plugins/lsp.nix +++ b/config/plugins/lsp.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ plugins.lsp = { enable = true; @@ -74,7 +75,7 @@ # nix nixd = { enable = true; - settings.formatting.command = ["${pkgs.alejandra}/bin/alejandra"]; + settings.formatting.command = [ "${pkgs.nixfmt-rfc-style}/bin/nixfmt" ]; }; }; }; diff --git a/config/plugins/rhubarb.nix b/config/plugins/rhubarb.nix index 2d72bb8..55029e0 100644 --- a/config/plugins/rhubarb.nix +++ b/config/plugins/rhubarb.nix @@ -1,16 +1,17 @@ -{pkgs, ...}: { - extraPlugins = with pkgs.vimPlugins; [rhubarb]; +{ pkgs, ... }: +{ + extraPlugins = with pkgs.vimPlugins; [ rhubarb ]; keymaps = [ { action = "GBrowse"; key = "bro"; - mode = ["n"]; + mode = [ "n" ]; } { action = ":GBrowse"; key = "bro"; - mode = ["v"]; + mode = [ "v" ]; } ]; } diff --git a/config/plugins/telescope.nix b/config/plugins/telescope.nix index eb9eed8..b23e558 100644 --- a/config/plugins/telescope.nix +++ b/config/plugins/telescope.nix @@ -11,8 +11,12 @@ }; settings.defaults.mappings = { "i" = { - "" = {__raw = "require('telescope.actions').cycle_history_next";}; - "" = {__raw = "require('telescope.actions').cycle_history_prev";}; + "" = { + __raw = "require('telescope.actions').cycle_history_next"; + }; + "" = { + __raw = "require('telescope.actions').cycle_history_prev"; + }; }; }; }; diff --git a/config/plugins/vim-obsession.nix b/config/plugins/vim-obsession.nix index 115d5aa..58cf01f 100644 --- a/config/plugins/vim-obsession.nix +++ b/config/plugins/vim-obsession.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ extraPlugins = [ (pkgs.vimUtils.buildVimPlugin { name = "vim-obsession"; diff --git a/flake.nix b/flake.nix index cdfc0ef..96b69c9 100644 --- a/flake.nix +++ b/flake.nix @@ -7,12 +7,13 @@ flake-parts.url = "github:hercules-ci/flake-parts"; }; - outputs = { - nixvim, - flake-parts, - ... - } @ inputs: - flake-parts.lib.mkFlake {inherit inputs;} { + outputs = + { + nixvim, + flake-parts, + ... + }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" "aarch64-linux" @@ -20,33 +21,36 @@ "aarch64-darwin" ]; - perSystem = { - pkgs, - system, - ... - }: let - nixvimLib = nixvim.lib.${system}; - nixvim' = nixvim.legacyPackages.${system}; - nixvimModule = { - inherit pkgs; - module = import ./config; # import the module directly - # You can use `extraSpecialArgs` to pass additional arguments to your module files - extraSpecialArgs = { - # inherit (inputs) foo; + perSystem = + { + pkgs, + system, + ... + }: + let + nixvimLib = nixvim.lib.${system}; + nixvim' = nixvim.legacyPackages.${system}; + nixvimModule = { + inherit pkgs; + module = import ./config; # import the module directly + # You can use `extraSpecialArgs` to pass additional arguments to your module files + extraSpecialArgs = { + # inherit (inputs) foo; + }; + }; + nvim = nixvim'.makeNixvimWithModule nixvimModule; + in + { + checks = { + # Run `nix flake check .` to verify that your config is not broken + default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; + }; + + packages = { + # Lets you run `nix run .` to start nixvim + default = nvim; }; }; - nvim = nixvim'.makeNixvimWithModule nixvimModule; - in { - checks = { - # Run `nix flake check .` to verify that your config is not broken - default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; - }; - - packages = { - # Lets you run `nix run .` to start nixvim - default = nvim; - }; - }; } // { hydraJobs = {