From 6d93ed03c446265e080afedd16fc2e8e7de54388 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Mon, 8 Jul 2024 17:08:13 -0400 Subject: [PATCH] statix, deadnix, alejandra --- flake/packages.nix | 1 - lib/binds.nix | 2 +- lib/dag.nix | 3 +-- lib/types/plugins.nix | 2 +- modules/plugins/assistant/copilot/config.nix | 4 ++-- modules/plugins/dashboard/startify/startify.nix | 6 +----- modules/plugins/lsp/config.nix | 4 ++-- modules/plugins/projects/project-nvim/project-nvim.nix | 6 +----- modules/plugins/statusline/lualine/config.nix | 6 +++--- modules/plugins/theme/supported_themes.nix | 10 ++-------- modules/plugins/ui/colorizer/colorizer.nix | 6 +----- modules/plugins/ui/smartcolumn/smartcolumn.nix | 2 +- .../plugins/utility/binds/cheatsheet/cheatsheet.nix | 6 +----- modules/plugins/utility/binds/cheatsheet/config.nix | 2 +- modules/plugins/utility/binds/which-key/config.nix | 4 ++-- modules/plugins/utility/binds/which-key/which-key.nix | 6 +----- modules/plugins/utility/ccc/config.nix | 2 +- modules/plugins/utility/diffview/config.nix | 2 +- modules/plugins/utility/icon-picker/config.nix | 2 +- modules/plugins/utility/images/image-nvim/config.nix | 1 - .../plugins/utility/images/image-nvim/image-nvim.nix | 6 +----- modules/plugins/utility/preview/glow/config.nix | 2 +- modules/plugins/utility/telescope/config.nix | 2 +- modules/plugins/utility/wakatime/config.nix | 2 +- 24 files changed, 28 insertions(+), 61 deletions(-) diff --git a/flake/packages.nix b/flake/packages.nix index 3724905a..36f660af 100644 --- a/flake/packages.nix +++ b/flake/packages.nix @@ -1,6 +1,5 @@ {inputs, ...}: { perSystem = { - system, config, pkgs, ... diff --git a/lib/binds.nix b/lib/binds.nix index d42a4142..8c9e9a62 100644 --- a/lib/binds.nix +++ b/lib/binds.nix @@ -66,7 +66,7 @@ mkSetLuaBinding = binding: action: mkLuaBinding binding.value action binding.description; - pushDownDefault = attr: mapAttrs (_: value: mkDefault value) attr; + pushDownDefault = attr: mapAttrs (_: mkDefault) attr; }; in binds diff --git a/lib/dag.nix b/lib/dag.nix index ccb2a61c..d740f6ab 100644 --- a/lib/dag.nix +++ b/lib/dag.nix @@ -84,7 +84,7 @@ in { normalizedDag = mapAttrs (n: v: { name = n; - data = v.data; + inherit (v) data; after = v.after ++ dagBefore dag n; }) dag; @@ -117,7 +117,6 @@ in { entriesBetween = tag: let go = i: before: after: entries: let name = "${tag}-${toString i}"; - i' = i + 1; in if entries == [] then empty diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index d9cc5f2b..e10547fb 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -5,7 +5,7 @@ }: let inherit (lib.options) mkOption; inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair; - inherit (lib.strings) hasPrefix removePrefix isString; + inherit (lib.strings) hasPrefix removePrefix; inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr; # Get the names of all flake inputs that start with the given prefix. diff --git a/modules/plugins/assistant/copilot/config.nix b/modules/plugins/assistant/copilot/config.nix index 0d3ee284..b7adc82a 100644 --- a/modules/plugins/assistant/copilot/config.nix +++ b/modules/plugins/assistant/copilot/config.nix @@ -30,14 +30,14 @@ in { "copilot-lua" # cfg.copilotNodePackage ] - ++ optionals (cfg.cmp.enable) [ + ++ optionals cfg.cmp.enable [ "copilot-cmp" ]; vim.luaConfigRC.copilot = entryAnywhere '' require("copilot").setup(${toLuaObject cfg.setupOpts}) - ${lib.optionalString (cfg.cmp.enable) '' + ${lib.optionalString cfg.cmp.enable '' require("copilot_cmp").setup() ''} ''; diff --git a/modules/plugins/dashboard/startify/startify.nix b/modules/plugins/dashboard/startify/startify.nix index fa70a4dd..02ee9161 100644 --- a/modules/plugins/dashboard/startify/startify.nix +++ b/modules/plugins/dashboard/startify/startify.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let inherit (lib.options) mkEnableOption mkOption; inherit (lib.types) listOf attrs bool enum str oneOf int; in { diff --git a/modules/plugins/lsp/config.nix b/modules/plugins/lsp/config.nix index d91a4fb7..93e3da63 100644 --- a/modules/plugins/lsp/config.nix +++ b/modules/plugins/lsp/config.nix @@ -103,11 +103,11 @@ in { end end - ${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''} + ${optionalString config.vim.ui.breadcrumbs.enable ''local navic = require("nvim-navic")''} default_on_attach = function(client, bufnr) attach_keymaps(client, bufnr) format_callback(client, bufnr) - ${optionalString (config.vim.ui.breadcrumbs.enable) '' + ${optionalString config.vim.ui.breadcrumbs.enable '' -- let navic attach to buffers if client.server_capabilities.documentSymbolProvider then navic.attach(client, bufnr) diff --git a/modules/plugins/projects/project-nvim/project-nvim.nix b/modules/plugins/projects/project-nvim/project-nvim.nix index b9a9eff1..91128daf 100644 --- a/modules/plugins/projects/project-nvim/project-nvim.nix +++ b/modules/plugins/projects/project-nvim/project-nvim.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let inherit (lib.options) mkEnableOption mkOption; inherit (lib.modules) mkRenamedOptionModule; inherit (lib.types) bool listOf str enum; diff --git a/modules/plugins/statusline/lualine/config.nix b/modules/plugins/statusline/lualine/config.nix index 54795959..08b1e08c 100644 --- a/modules/plugins/statusline/lualine/config.nix +++ b/modules/plugins/statusline/lualine/config.nix @@ -15,7 +15,7 @@ in { config = mkMerge [ # TODO: move into nvim-tree file - (mkIf (config.vim.filetree.nvimTree.enable) { + (mkIf config.vim.filetree.nvimTree.enable { vim.statusline.lualine.setupOpts = { extensions = ["nvim-tree"]; }; @@ -44,11 +44,11 @@ in { statusline.lualine.setupOpts = { options = { icons_enabled = cfg.icons.enable; - theme = cfg.theme; + inherit (cfg) theme; component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right]; section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right]; globalstatus = cfg.globalStatus; - refresh = cfg.refresh; + inherit (cfg) refresh; }; sections = { diff --git a/modules/plugins/theme/supported_themes.nix b/modules/plugins/theme/supported_themes.nix index f28905d7..6d992c4a 100644 --- a/modules/plugins/theme/supported_themes.nix +++ b/modules/plugins/theme/supported_themes.nix @@ -6,10 +6,7 @@ inherit (lib.trivial) boolToString warnIf; in { onedark = { - setup = { - style ? "dark", - transparent, - }: '' + setup = {style ? "dark"}: '' -- OneDark theme require('onedark').setup { style = "${style}" @@ -33,10 +30,7 @@ in { }; dracula = { - setup = { - style ? null, - transparent, - }: '' + setup = {transparent}: '' require('dracula').setup({ transparent_bg = ${boolToString transparent}, }); diff --git a/modules/plugins/ui/colorizer/colorizer.nix b/modules/plugins/ui/colorizer/colorizer.nix index 02ab9674..313097e7 100644 --- a/modules/plugins/ui/colorizer/colorizer.nix +++ b/modules/plugins/ui/colorizer/colorizer.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) attrsOf enum nullOr submodule bool str; inherit (lib.modules) mkRenamedOptionModule; diff --git a/modules/plugins/ui/smartcolumn/smartcolumn.nix b/modules/plugins/ui/smartcolumn/smartcolumn.nix index 48bf549b..8e73a1f3 100644 --- a/modules/plugins/ui/smartcolumn/smartcolumn.nix +++ b/modules/plugins/ui/smartcolumn/smartcolumn.nix @@ -1,6 +1,6 @@ {lib, ...}: let inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) nullOr int str attrsOf either listOf; + inherit (lib.types) nullOr str attrsOf either listOf; inherit (lib.modules) mkRenamedOptionModule; inherit (lib.nvim.types) mkPluginSetupOption; in { diff --git a/modules/plugins/utility/binds/cheatsheet/cheatsheet.nix b/modules/plugins/utility/binds/cheatsheet/cheatsheet.nix index cddc6a52..d410fbc2 100644 --- a/modules/plugins/utility/binds/cheatsheet/cheatsheet.nix +++ b/modules/plugins/utility/binds/cheatsheet/cheatsheet.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let inherit (lib.options) mkEnableOption; in { options.vim.binds.cheatsheet = { diff --git a/modules/plugins/utility/binds/cheatsheet/config.nix b/modules/plugins/utility/binds/cheatsheet/config.nix index d0edf100..05b78873 100644 --- a/modules/plugins/utility/binds/cheatsheet/config.nix +++ b/modules/plugins/utility/binds/cheatsheet/config.nix @@ -8,7 +8,7 @@ cfg = config.vim.binds.cheatsheet; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { vim.startPlugins = ["cheatsheet-nvim"]; vim.luaConfigRC.cheaetsheet-nvim = entryAnywhere '' diff --git a/modules/plugins/utility/binds/which-key/config.nix b/modules/plugins/utility/binds/which-key/config.nix index 238d8888..e6aa2d91 100644 --- a/modules/plugins/utility/binds/which-key/config.nix +++ b/modules/plugins/utility/binds/which-key/config.nix @@ -10,7 +10,7 @@ cfg = config.vim.binds.whichKey; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { vim.startPlugins = ["which-key"]; vim.luaConfigRC.whichkey = entryAnywhere '' @@ -23,7 +23,7 @@ in { [""] = "TAB", }, - ${optionalString (config.vim.ui.borders.plugins.which-key.enable) '' + ${optionalString config.vim.ui.borders.plugins.which-key.enable '' window = { border = "${config.vim.ui.borders.plugins.which-key.style}", }, diff --git a/modules/plugins/utility/binds/which-key/which-key.nix b/modules/plugins/utility/binds/which-key/which-key.nix index feb8d76b..3851cd9b 100644 --- a/modules/plugins/utility/binds/which-key/which-key.nix +++ b/modules/plugins/utility/binds/which-key/which-key.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let inherit (lib.options) mkEnableOption mkOption; inherit (lib.types) attrsOf nullOr str; in { diff --git a/modules/plugins/utility/ccc/config.nix b/modules/plugins/utility/ccc/config.nix index a9589bb7..b8c43157 100644 --- a/modules/plugins/utility/ccc/config.nix +++ b/modules/plugins/utility/ccc/config.nix @@ -8,7 +8,7 @@ cfg = config.vim.utility.ccc; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { vim.startPlugins = [ "ccc" ]; diff --git a/modules/plugins/utility/diffview/config.nix b/modules/plugins/utility/diffview/config.nix index ffe8a580..681a3053 100644 --- a/modules/plugins/utility/diffview/config.nix +++ b/modules/plugins/utility/diffview/config.nix @@ -7,7 +7,7 @@ cfg = config.vim.utility.diffview-nvim; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { vim.startPlugins = [ "diffview-nvim" "plenary-nvim" diff --git a/modules/plugins/utility/icon-picker/config.nix b/modules/plugins/utility/icon-picker/config.nix index 79cd3769..aa61d045 100644 --- a/modules/plugins/utility/icon-picker/config.nix +++ b/modules/plugins/utility/icon-picker/config.nix @@ -8,7 +8,7 @@ cfg = config.vim.utility.icon-picker; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { vim.startPlugins = [ "icon-picker-nvim" "dressing-nvim" diff --git a/modules/plugins/utility/images/image-nvim/config.nix b/modules/plugins/utility/images/image-nvim/config.nix index cd188acc..52666d35 100644 --- a/modules/plugins/utility/images/image-nvim/config.nix +++ b/modules/plugins/utility/images/image-nvim/config.nix @@ -1,7 +1,6 @@ { config, lib, - pkgs, ... }: let inherit (lib.modules) mkIf; diff --git a/modules/plugins/utility/images/image-nvim/image-nvim.nix b/modules/plugins/utility/images/image-nvim/image-nvim.nix index 6433e50e..5fa7fdb9 100644 --- a/modules/plugins/utility/images/image-nvim/image-nvim.nix +++ b/modules/plugins/utility/images/image-nvim/image-nvim.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let inherit (lib.options) mkEnableOption mkOption; inherit (lib.types) enum listOf str nullOr int; diff --git a/modules/plugins/utility/preview/glow/config.nix b/modules/plugins/utility/preview/glow/config.nix index 1f95f895..04e8aa04 100644 --- a/modules/plugins/utility/preview/glow/config.nix +++ b/modules/plugins/utility/preview/glow/config.nix @@ -12,7 +12,7 @@ self = import ./glow.nix { inherit lib config pkgs; }; - mappings = self.options.vim.utility.preview.glow.mappings; + inherit (self.options.vim.utility.preview.glow) mappings; in { config = mkIf cfg.enable { vim.startPlugins = ["glow-nvim"]; diff --git a/modules/plugins/utility/telescope/config.nix b/modules/plugins/utility/telescope/config.nix index 0ed553aa..f59f8161 100644 --- a/modules/plugins/utility/telescope/config.nix +++ b/modules/plugins/utility/telescope/config.nix @@ -16,7 +16,7 @@ mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { vim.startPlugins = [ "telescope" "plenary-nvim" diff --git a/modules/plugins/utility/wakatime/config.nix b/modules/plugins/utility/wakatime/config.nix index e6332d5d..1185db54 100644 --- a/modules/plugins/utility/wakatime/config.nix +++ b/modules/plugins/utility/wakatime/config.nix @@ -9,7 +9,7 @@ cfg = config.vim.utility.vim-wakatime; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { vim.startPlugins = [ pkgs.vimPlugins.vim-wakatime ];