formatting alejandra
This commit is contained in:
parent
72f087c33d
commit
7e2b6e5906
11 changed files with 88 additions and 79 deletions
|
|
@ -1 +1 @@
|
|||
{ colorschemes = { gruvbox.enable = true; }; }
|
||||
{colorschemes = {gruvbox.enable = true;};}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{ lib, ... }:
|
||||
|
||||
let
|
||||
{lib, ...}: let
|
||||
definitions = lib.attrNames (lib.filterAttrs (filename: kind:
|
||||
filename != "default.nix" && (kind == "regular" || kind == "directory"))
|
||||
(builtins.readDir ./.));
|
||||
in lib.mkMerge (map (file: import ./${file}) definitions)
|
||||
(builtins.readDir ./.));
|
||||
in
|
||||
lib.mkMerge (map (file: import ./${file}) definitions)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,5 @@
|
|||
autoindent = true; # Do clever autoindenting
|
||||
# TODO: i want to see 4 spaces when i press tab in python and 2 spaces in nix using setlocal
|
||||
# is it possible for me to set this per language?
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./config ./plugins ];
|
||||
{pkgs, ...}: {
|
||||
imports = [./config ./plugins];
|
||||
|
||||
config = {
|
||||
# Use <Space> as leader key
|
||||
|
|
|
|||
79
flake.nix
79
flake.nix
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
description =
|
||||
"My custom neovim configuration that has been mixed and matched from various sources";
|
||||
description = "My custom neovim configuration that has been mixed and matched from various sources";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
|
@ -12,43 +11,47 @@
|
|||
nixvim.url = "github:nix-community/nixvim";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, nixvim, nix-formatter-pack, ... }:
|
||||
let
|
||||
forAllSystems = nixpkgs.lib.genAttrs [
|
||||
"aarch64-linux"
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
in {
|
||||
formatter = forAllSystems (system:
|
||||
nix-formatter-pack.lib.mkFormatter {
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
config.tools = {
|
||||
deadnix.enable = true;
|
||||
nixfmt.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
});
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
nixvim,
|
||||
nix-formatter-pack,
|
||||
...
|
||||
}: let
|
||||
forAllSystems = nixpkgs.lib.genAttrs [
|
||||
"aarch64-linux"
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
in {
|
||||
formatter = forAllSystems (system:
|
||||
nix-formatter-pack.lib.mkFormatter {
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
config.tools = {
|
||||
deadnix.enable = true;
|
||||
alejandra.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
});
|
||||
|
||||
packages = forAllSystems (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
mkNixvim = specialArgs:
|
||||
nixvim.legacyPackages.${system}.makeNixvimWithModule {
|
||||
packages = forAllSystems (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
mkNixvim = specialArgs:
|
||||
nixvim.legacyPackages.${system}.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
|
||||
module = ./.;
|
||||
|
||||
extraSpecialArgs =
|
||||
specialArgs
|
||||
// {
|
||||
inherit pkgs;
|
||||
|
||||
module = ./.;
|
||||
|
||||
extraSpecialArgs = specialArgs // {
|
||||
inherit pkgs;
|
||||
|
||||
};
|
||||
};
|
||||
in {
|
||||
default = mkNixvim { };
|
||||
lite = mkNixvim { withLSP = false; };
|
||||
});
|
||||
};
|
||||
};
|
||||
in {
|
||||
default = mkNixvim {};
|
||||
lite = mkNixvim {withLSP = false;};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
keyword_length = 5;
|
||||
}
|
||||
# For command line completion
|
||||
{ name = "cmdline"; }
|
||||
{name = "cmdline";}
|
||||
];
|
||||
mapping = {
|
||||
# <CR> means enter
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
# settings of these plugins live in their respective files
|
||||
imports = [ ./cmp.nix ./lsp.nix ./mini.nix ./oil.nix ./treesitter.nix ];
|
||||
imports = [./cmp.nix ./lsp.nix ./mini.nix ./oil.nix ./treesitter.nix];
|
||||
|
||||
plugins = {
|
||||
# todo comments highlighter
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
{ lib, pkgs, self, ... }: {
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
plugins.lsp.servers = {
|
||||
astro.enable = true;
|
||||
dockerls.enable = true;
|
||||
nixd = {
|
||||
enable = true;
|
||||
settings = let flake = ''(builtins.getFlake "${self}")'';
|
||||
settings = let
|
||||
flake = ''(builtins.getFlake "${self}")'';
|
||||
in {
|
||||
nixpkgs.expr = "import ${flake}.inputs.nixpkgs { }";
|
||||
formatting.command = [ "${lib.getExe pkgs.nixfmt-rfc-style}" ];
|
||||
formatting.command = ["${lib.getExe pkgs.nixfmt-rfc-style}"];
|
||||
};
|
||||
};
|
||||
pyright.enable = true;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{ config, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
plugins.mini = {
|
||||
modules = {
|
||||
starter = {
|
||||
|
|
@ -12,15 +16,12 @@
|
|||
# this items and content_hooks are copied from khanelivim config
|
||||
# but i want to understand them
|
||||
items = {
|
||||
"__unkeyed-1.builtin_actions".__raw =
|
||||
"require('mini.starter').sections.builtin_actions()";
|
||||
"__unkeyed-2.recent_files_current_directory".__raw =
|
||||
"require('mini.starter').sections.recent_files(10, true)";
|
||||
"__unkeyed-3.recent_files".__raw =
|
||||
"require('mini.starter').sections.recent_files(10, false)";
|
||||
"__unkeyed-1.builtin_actions".__raw = "require('mini.starter').sections.builtin_actions()";
|
||||
"__unkeyed-2.recent_files_current_directory".__raw = "require('mini.starter').sections.recent_files(10, true)";
|
||||
"__unkeyed-3.recent_files".__raw = "require('mini.starter').sections.recent_files(10, false)";
|
||||
"__unkeyed-4.sessions".__raw = lib.mkIf (config.plugins.mini.enable
|
||||
&& lib.hasAttr "sessions" config.plugins.mini.modules)
|
||||
"require('mini.starter').sections.sessions(5, true)";
|
||||
"require('mini.starter').sections.sessions(5, true)";
|
||||
__unkeyed-5 = lib.mkIf config.plugins.persistence.enable {
|
||||
name = "Restore session";
|
||||
action.__raw = "[[lua require('persistence').load()]]";
|
||||
|
|
@ -29,12 +30,9 @@
|
|||
};
|
||||
|
||||
content_hooks = {
|
||||
"__unkeyed-1.adding_bullet".__raw =
|
||||
"require('mini.starter').gen_hook.adding_bullet()";
|
||||
"__unkeyed-2.indexing".__raw =
|
||||
"require('mini.starter').gen_hook.indexing('all', { 'Builtin actions' })";
|
||||
"__unkeyed-3.padding".__raw =
|
||||
"require('mini.starter').gen_hook.aligning('center', 'center')";
|
||||
"__unkeyed-1.adding_bullet".__raw = "require('mini.starter').gen_hook.adding_bullet()";
|
||||
"__unkeyed-2.indexing".__raw = "require('mini.starter').gen_hook.indexing('all', { 'Builtin actions' })";
|
||||
"__unkeyed-3.padding".__raw = "require('mini.starter').gen_hook.aligning('center', 'center')";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
{ config, lib, ... }: {
|
||||
plugins.oil = { };
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
plugins.oil = {};
|
||||
# add this keymaps only if oil plugin is enabled
|
||||
keymaps = lib.mkIf config.plugins.oil.enable [{
|
||||
action = "<cmd>Oil<CR>";
|
||||
key = "-";
|
||||
options = {
|
||||
silent = true;
|
||||
# TODO what does silent do?
|
||||
};
|
||||
}];
|
||||
keymaps = lib.mkIf config.plugins.oil.enable [
|
||||
{
|
||||
action = "<cmd>Oil<CR>";
|
||||
key = "-";
|
||||
options = {
|
||||
silent = true;
|
||||
# TODO what does silent do?
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"c"
|
||||
"markdown"
|
||||
];
|
||||
highlight = { enable = true; };
|
||||
highlight = {enable = true;};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue