diff --git a/config/colorscheme.nix b/config/colorscheme.nix index 0ae6765..f124d28 100644 --- a/config/colorscheme.nix +++ b/config/colorscheme.nix @@ -1 +1 @@ -{ colorschemes = { gruvbox.enable = true; }; } +{colorschemes = {gruvbox.enable = true;};} diff --git a/config/default.nix b/config/default.nix index 7890c95..c8b1cd7 100644 --- a/config/default.nix +++ b/config/default.nix @@ -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) diff --git a/config/options.nix b/config/options.nix index 8556e51..1c33d6f 100644 --- a/config/options.nix +++ b/config/options.nix @@ -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? - }; } diff --git a/default.nix b/default.nix index d4cf777..ab57f39 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,5 @@ -{ pkgs, ... }: - -{ - imports = [ ./config ./plugins ]; +{pkgs, ...}: { + imports = [./config ./plugins]; config = { # Use as leader key diff --git a/flake.nix b/flake.nix index 6693dd9..4382f92 100644 --- a/flake.nix +++ b/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;}; + }); + }; } diff --git a/plugins/cmp.nix b/plugins/cmp.nix index 8cfb197..e9eacab 100644 --- a/plugins/cmp.nix +++ b/plugins/cmp.nix @@ -17,7 +17,7 @@ keyword_length = 5; } # For command line completion - { name = "cmdline"; } + {name = "cmdline";} ]; mapping = { # means enter diff --git a/plugins/default.nix b/plugins/default.nix index 0639d6f..7292825 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -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 diff --git a/plugins/lsp.nix b/plugins/lsp.nix index 94a3103..e545733 100644 --- a/plugins/lsp.nix +++ b/plugins/lsp.nix @@ -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; diff --git a/plugins/mini.nix b/plugins/mini.nix index d50c80a..7875b5e 100644 --- a/plugins/mini.nix +++ b/plugins/mini.nix @@ -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')"; }; }; }; diff --git a/plugins/oil.nix b/plugins/oil.nix index 44fe414..755d47c 100644 --- a/plugins/oil.nix +++ b/plugins/oil.nix @@ -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 = "Oil"; - key = "-"; - options = { - silent = true; - # TODO what does silent do? - }; - }]; + keymaps = lib.mkIf config.plugins.oil.enable [ + { + action = "Oil"; + key = "-"; + options = { + silent = true; + # TODO what does silent do? + }; + } + ]; } diff --git a/plugins/treesitter.nix b/plugins/treesitter.nix index adf95e5..8489715 100644 --- a/plugins/treesitter.nix +++ b/plugins/treesitter.nix @@ -14,7 +14,7 @@ "c" "markdown" ]; - highlight = { enable = true; }; + highlight = {enable = true;}; }; }; }