Switched from alejandra to nixfmt(-rfc-style)

Also re-formatted nix files
This commit is contained in:
alejandro-angulo 2024-12-27 23:39:34 -08:00
parent ea90b0356f
commit ddb857e6ac
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
7 changed files with 66 additions and 52 deletions

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
# Import all your configuration modules here # Import all your configuration modules here
# imports = [./bufferline.nix]; # imports = [./bufferline.nix];
imports = [ imports = [
@ -44,13 +45,13 @@
autoCmd = [ autoCmd = [
{ {
event = ["BufEnter"]; event = [ "BufEnter" ];
pattern = ["*"]; pattern = [ "*" ];
command = "setlocal cursorline"; command = "setlocal cursorline";
} }
{ {
event = ["BufLeave"]; event = [ "BufLeave" ];
pattern = ["*"]; pattern = [ "*" ];
command = "setlocal nocursorline"; command = "setlocal nocursorline";
} }
]; ];

View file

@ -2,7 +2,9 @@
plugins.cmp = { plugins.cmp = {
enable = true; enable = true;
settings = { settings = {
completion = {keyword_length = 2;}; completion = {
keyword_length = 2;
};
mapping = { mapping = {
"<C-n>" = "cmp.mapping.select_next_item()"; "<C-n>" = "cmp.mapping.select_next_item()";
@ -22,12 +24,12 @@
''; '';
sources = [ sources = [
{name = "nvim_lsp";} { name = "nvim_lsp"; }
{name = "buffer";} { name = "buffer"; }
{name = "cmdline";} { name = "cmdline"; }
{name = "cmp-clippy";} { name = "cmp-clippy"; }
{name = "luasnip";} { name = "luasnip"; }
{name = "path";} { name = "path"; }
]; ];
}; };
}; };

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
plugins.lsp = { plugins.lsp = {
enable = true; enable = true;
@ -74,7 +75,7 @@
# nix # nix
nixd = { nixd = {
enable = true; enable = true;
settings.formatting.command = ["${pkgs.alejandra}/bin/alejandra"]; settings.formatting.command = [ "${pkgs.nixfmt-rfc-style}/bin/nixfmt" ];
}; };
}; };
}; };

View file

@ -1,16 +1,17 @@
{pkgs, ...}: { { pkgs, ... }:
extraPlugins = with pkgs.vimPlugins; [rhubarb]; {
extraPlugins = with pkgs.vimPlugins; [ rhubarb ];
keymaps = [ keymaps = [
{ {
action = "<cmd>GBrowse<CR>"; action = "<cmd>GBrowse<CR>";
key = "<leader>bro"; key = "<leader>bro";
mode = ["n"]; mode = [ "n" ];
} }
{ {
action = ":GBrowse<CR>"; action = ":GBrowse<CR>";
key = "<leader>bro"; key = "<leader>bro";
mode = ["v"]; mode = [ "v" ];
} }
]; ];
} }

View file

@ -11,8 +11,12 @@
}; };
settings.defaults.mappings = { settings.defaults.mappings = {
"i" = { "i" = {
"<C-n>" = {__raw = "require('telescope.actions').cycle_history_next";}; "<C-n>" = {
"<C-p>" = {__raw = "require('telescope.actions').cycle_history_prev";}; __raw = "require('telescope.actions').cycle_history_next";
};
"<C-p>" = {
__raw = "require('telescope.actions').cycle_history_prev";
};
}; };
}; };
}; };

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
extraPlugins = [ extraPlugins = [
(pkgs.vimUtils.buildVimPlugin { (pkgs.vimUtils.buildVimPlugin {
name = "vim-obsession"; name = "vim-obsession";

View file

@ -7,12 +7,13 @@
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
}; };
outputs = { outputs =
nixvim, {
flake-parts, nixvim,
... flake-parts,
} @ inputs: ...
flake-parts.lib.mkFlake {inherit inputs;} { }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
@ -20,33 +21,36 @@
"aarch64-darwin" "aarch64-darwin"
]; ];
perSystem = { perSystem =
pkgs, {
system, pkgs,
... system,
}: let ...
nixvimLib = nixvim.lib.${system}; }:
nixvim' = nixvim.legacyPackages.${system}; let
nixvimModule = { nixvimLib = nixvim.lib.${system};
inherit pkgs; nixvim' = nixvim.legacyPackages.${system};
module = import ./config; # import the module directly nixvimModule = {
# You can use `extraSpecialArgs` to pass additional arguments to your module files inherit pkgs;
extraSpecialArgs = { module = import ./config; # import the module directly
# inherit (inputs) foo; # 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 = { hydraJobs = {