Reformatted to alejandra style

This commit is contained in:
Fred Drake
2024-10-03 21:33:17 -04:00
parent ced6c4d36e
commit 53e75b11ce
11 changed files with 405 additions and 382 deletions
+3 -6
View File
@@ -70,8 +70,7 @@
{ {
type = "button"; type = "button";
val = " Find File "; val = " Find File ";
on_press.__raw = on_press.__raw = "function() require('telescope.builtin').find_files() end";
"function() require('telescope.builtin').find_files() end";
opts = { opts = {
shortcut = "f"; shortcut = "f";
keymap = [ keymap = [
@@ -97,8 +96,7 @@
{ {
type = "button"; type = "button";
val = " Recent Files "; val = " Recent Files ";
on_press.__raw = on_press.__raw = "function() require('telescope.builtin').oldfiles() end";
"function() require('telescope.builtin').oldfiles() end";
opts = { opts = {
shortcut = "r"; shortcut = "r";
keymap = [ keymap = [
@@ -124,8 +122,7 @@
{ {
type = "button"; type = "button";
val = " Find Text "; val = " Find Text ";
on_press.__raw = on_press.__raw = "function() require('telescope.builtin').live_grep() end";
"function() require('telescope.builtin').live_grep() end";
opts = { opts = {
shortcut = "g"; shortcut = "g";
keymap = [ keymap = [
+2 -4
View File
@@ -31,8 +31,7 @@
{ {
mode = "n"; mode = "n";
key = "<leader>dB"; key = "<leader>dB";
action = action = "\n <cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<cr>\n ";
"\n <cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<cr>\n ";
options = { options = {
silent = true; silent = true;
desc = "Breakpoint Condition"; desc = "Breakpoint Condition";
@@ -203,8 +202,7 @@
{ {
mode = "n"; mode = "n";
key = "<leader>df"; key = "<leader>df";
action = action = "<CMD>lua require('dap.ext.vscode').load_launchjs()<CR><CMD>Telescope dap configurations<CR>";
"<CMD>lua require('dap.ext.vscode').load_launchjs()<CR><CMD>Telescope dap configurations<CR>";
options = {desc = "Debug Configurations";}; options = {desc = "Debug Configurations";};
} }
]; ];
+1 -2
View File
@@ -7,8 +7,7 @@ let
# Create a list of import statements # Create a list of import statements
imports = map (name: ./. + "/${name}") nixFiles; imports = map (name: ./. + "/${name}") nixFiles;
in in {
{
# Import all configuration modules automatically # Import all configuration modules automatically
imports = imports; imports = imports;
} }
-2
View File
@@ -64,6 +64,4 @@
}; };
}; };
}; };
} }
+4 -8
View File
@@ -118,29 +118,25 @@
{ {
mode = "n"; mode = "n";
key = "gd"; key = "gd";
action = action = "<CMD>FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true<CR>";
"<CMD>FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true<CR>";
options = {desc = "Goto Definition";}; options = {desc = "Goto Definition";};
} }
{ {
mode = "n"; mode = "n";
key = "gr"; key = "gr";
action = action = "<CMD>FzfLua lsp_references jump_to_single_result=true ignore_current_line=true<CR>";
"<CMD>FzfLua lsp_references jump_to_single_result=true ignore_current_line=true<CR>";
options = {desc = "References";}; options = {desc = "References";};
} }
{ {
mode = "n"; mode = "n";
key = "gI"; key = "gI";
action = action = "<CMD>FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true<CR>";
"<CMD>FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true<CR>";
options = {desc = "Goto Implementation";}; options = {desc = "Goto Implementation";};
} }
{ {
mode = "n"; mode = "n";
key = "gy"; key = "gy";
action = action = "<CMD>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<CR>";
"<CMD>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<CR>";
options = {desc = "Goto T[y]pe Definition";}; options = {desc = "Goto T[y]pe Definition";};
} }
{ {
+3 -4
View File
@@ -1,8 +1,7 @@
let let
selectOpts = "{behavior = cmp.SelectBehavior.Select}"; selectOpts = "{behavior = cmp.SelectBehavior.Select}";
in in
{ pkgs, ... }: {pkgs, ...}: {
{
plugins = { plugins = {
cmp = { cmp = {
enable = true; enable = true;
@@ -150,7 +149,8 @@ in
prettier.enable = true; prettier.enable = true;
# rubyfmt is broken on darwin-based systems # rubyfmt is broken on darwin-based systems
rubyfmt.enable = ( rubyfmt.enable = (
pkgs.stdenv.hostPlatform.system != "x86_64-darwin" pkgs.stdenv.hostPlatform.system
!= "x86_64-darwin"
&& pkgs.stdenv.hostPlatform.system != "aarch64-darwin" && pkgs.stdenv.hostPlatform.system != "aarch64-darwin"
); );
sqlformat.enable = true; sqlformat.enable = true;
@@ -258,6 +258,5 @@ in
use_diagnostic_signs = true; use_diagnostic_signs = true;
}; };
}; };
}; };
} }
+4 -2
View File
@@ -6,12 +6,14 @@
options = { options = {
always_show_bufferline = false; always_show_bufferline = false;
buffer_close_icon = ""; buffer_close_icon = "";
offsets = [{ offsets = [
{
filetype = "neo-tree"; filetype = "neo-tree";
text = "Neo-tree"; text = "Neo-tree";
highlight = "Directory"; highlight = "Directory";
text_align = "left"; text_align = "left";
}]; }
];
diagnostics = "nvim_lsp"; diagnostics = "nvim_lsp";
}; };
}; };
+2 -1
View File
@@ -26,7 +26,8 @@ let
"FloatBorder" "FloatBorder"
]; ];
# "Buffer" + status + part # "Buffer" + status + part
buffer_status = builtins.foldl' (acc: elem: acc ++ elem) [ ] buffer_status =
builtins.foldl' (acc: elem: acc ++ elem) []
(builtins.map (status: builtins.map (part: "Buffer" + status + part) part) (builtins.map (status: builtins.map (part: "Buffer" + status + part) part)
status); status);
in { in {
+49 -16
View File
@@ -6,18 +6,31 @@
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay"; rust-overlay.url = "github:oxalica/rust-overlay";
}; };
outputs = { nixvim, flake-parts, rust-overlay, ... }@inputs: outputs =
{
nixvim,
flake-parts,
rust-overlay,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
systems = systems = [
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; "x86_64-linux"
perSystem = { system, ... }: "aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{ system, ... }:
let let
overlays = [ (import rust-overlay) ]; overlays = [ (import rust-overlay) ];
nixvimLib = nixvim.lib.${system}; nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system}; nixvim' = nixvim.legacyPackages.${system};
baseNixvimModule = { baseNixvimModule = {
inherit pkgs; inherit pkgs;
module = { pkgs, ... }: { module =
{ pkgs, ... }:
{
imports = [ ./config ]; imports = [ ./config ];
extraPackages = with pkgs; [ sops ]; extraPackages = with pkgs; [ sops ];
}; };
@@ -25,8 +38,13 @@
}; };
rustNixvimModule = { rustNixvimModule = {
inherit pkgs; inherit pkgs;
module = { pkgs, ... }: { module =
imports = [ ./config ./config/rust ]; { pkgs, ... }:
{
imports = [
./config
./config/rust
];
extraPackages = with pkgs; [ extraPackages = with pkgs; [
sops sops
rust-bin.stable.latest.default rust-bin.stable.latest.default
@@ -36,24 +54,39 @@
}; };
csharpNixvimModule = { csharpNixvimModule = {
inherit pkgs; inherit pkgs;
module = { pkgs, ... }: { module =
imports = [ ./config ./config/csharp ]; { pkgs, ... }:
{
imports = [
./config
./config/csharp
];
extraPackages = with pkgs; [ sops ]; extraPackages = with pkgs; [ sops ];
}; };
extraSpecialArgs = { }; extraSpecialArgs = { };
}; };
goNixvimModule = { goNixvimModule = {
inherit pkgs; inherit pkgs;
module = { pkgs, ... }: { module =
imports = [ ./config ./config/golang ]; { pkgs, ... }:
{
imports = [
./config
./config/golang
];
extraPackages = with pkgs; [ sops ]; extraPackages = with pkgs; [ sops ];
}; };
extraSpecialArgs = { }; extraSpecialArgs = { };
}; };
pythonNixvimModule = { pythonNixvimModule = {
inherit pkgs; inherit pkgs;
module = { pkgs, ... }: { module =
imports = [ ./config ./config/python ]; { pkgs, ... }:
{
imports = [
./config
./config/python
];
extraPackages = with pkgs; [ sops ]; extraPackages = with pkgs; [ sops ];
}; };
extraSpecialArgs = { }; extraSpecialArgs = { };
@@ -67,11 +100,11 @@
csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule; csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule;
goNvim = nixvim'.makeNixvimWithModule goNixvimModule; goNvim = nixvim'.makeNixvimWithModule goNixvimModule;
pythonNvim = nixvim'.makeNixvimWithModule pythonNixvimModule; pythonNvim = nixvim'.makeNixvimWithModule pythonNixvimModule;
in { in
{
checks = { checks = {
# Run `nix flake check .` to verify that your config is not broken # Run `nix flake check .` to verify that your config is not broken
default = default = nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule;
nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule;
}; };
packages = { packages = {
# Lets you run `nix run .` to start nixvim # Lets you run `nix run .` to start nixvim