statix, deadnix, alejandra

This commit is contained in:
Gerg-L 2024-07-08 17:08:13 -04:00
commit 6d93ed03c4
No known key found for this signature in database
24 changed files with 28 additions and 61 deletions

View file

@ -1,6 +1,5 @@
{inputs, ...}: { {inputs, ...}: {
perSystem = { perSystem = {
system,
config, config,
pkgs, pkgs,
... ...

View file

@ -66,7 +66,7 @@
mkSetLuaBinding = binding: action: mkSetLuaBinding = binding: action:
mkLuaBinding binding.value action binding.description; mkLuaBinding binding.value action binding.description;
pushDownDefault = attr: mapAttrs (_: value: mkDefault value) attr; pushDownDefault = attr: mapAttrs (_: mkDefault) attr;
}; };
in in
binds binds

View file

@ -84,7 +84,7 @@ in {
normalizedDag = normalizedDag =
mapAttrs (n: v: { mapAttrs (n: v: {
name = n; name = n;
data = v.data; inherit (v) data;
after = v.after ++ dagBefore dag n; after = v.after ++ dagBefore dag n;
}) })
dag; dag;
@ -117,7 +117,6 @@ in {
entriesBetween = tag: let entriesBetween = tag: let
go = i: before: after: entries: let go = i: before: after: entries: let
name = "${tag}-${toString i}"; name = "${tag}-${toString i}";
i' = i + 1;
in in
if entries == [] if entries == []
then empty then empty

View file

@ -5,7 +5,7 @@
}: let }: let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair; 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; 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. # Get the names of all flake inputs that start with the given prefix.

View file

@ -30,14 +30,14 @@ in {
"copilot-lua" "copilot-lua"
# cfg.copilotNodePackage # cfg.copilotNodePackage
] ]
++ optionals (cfg.cmp.enable) [ ++ optionals cfg.cmp.enable [
"copilot-cmp" "copilot-cmp"
]; ];
vim.luaConfigRC.copilot = entryAnywhere '' vim.luaConfigRC.copilot = entryAnywhere ''
require("copilot").setup(${toLuaObject cfg.setupOpts}) require("copilot").setup(${toLuaObject cfg.setupOpts})
${lib.optionalString (cfg.cmp.enable) '' ${lib.optionalString cfg.cmp.enable ''
require("copilot_cmp").setup() require("copilot_cmp").setup()
''} ''}
''; '';

View file

@ -1,8 +1,4 @@
{ {lib, ...}: let
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) listOf attrs bool enum str oneOf int; inherit (lib.types) listOf attrs bool enum str oneOf int;
in { in {

View file

@ -103,11 +103,11 @@ in {
end end
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) default_on_attach = function(client, bufnr)
attach_keymaps(client, bufnr) attach_keymaps(client, bufnr)
format_callback(client, bufnr) format_callback(client, bufnr)
${optionalString (config.vim.ui.breadcrumbs.enable) '' ${optionalString config.vim.ui.breadcrumbs.enable ''
-- let navic attach to buffers -- let navic attach to buffers
if client.server_capabilities.documentSymbolProvider then if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr) navic.attach(client, bufnr)

View file

@ -1,8 +1,4 @@
{ {lib, ...}: let
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkRenamedOptionModule; inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.types) bool listOf str enum; inherit (lib.types) bool listOf str enum;

View file

@ -15,7 +15,7 @@
in { in {
config = mkMerge [ config = mkMerge [
# TODO: move into nvim-tree file # TODO: move into nvim-tree file
(mkIf (config.vim.filetree.nvimTree.enable) { (mkIf config.vim.filetree.nvimTree.enable {
vim.statusline.lualine.setupOpts = { vim.statusline.lualine.setupOpts = {
extensions = ["nvim-tree"]; extensions = ["nvim-tree"];
}; };
@ -44,11 +44,11 @@ in {
statusline.lualine.setupOpts = { statusline.lualine.setupOpts = {
options = { options = {
icons_enabled = cfg.icons.enable; icons_enabled = cfg.icons.enable;
theme = cfg.theme; inherit (cfg) theme;
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right]; component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right]; section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
globalstatus = cfg.globalStatus; globalstatus = cfg.globalStatus;
refresh = cfg.refresh; inherit (cfg) refresh;
}; };
sections = { sections = {

View file

@ -6,10 +6,7 @@
inherit (lib.trivial) boolToString warnIf; inherit (lib.trivial) boolToString warnIf;
in { in {
onedark = { onedark = {
setup = { setup = {style ? "dark"}: ''
style ? "dark",
transparent,
}: ''
-- OneDark theme -- OneDark theme
require('onedark').setup { require('onedark').setup {
style = "${style}" style = "${style}"
@ -33,10 +30,7 @@ in {
}; };
dracula = { dracula = {
setup = { setup = {transparent}: ''
style ? null,
transparent,
}: ''
require('dracula').setup({ require('dracula').setup({
transparent_bg = ${boolToString transparent}, transparent_bg = ${boolToString transparent},
}); });

View file

@ -1,8 +1,4 @@
{ {lib, ...}: let
config,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrsOf enum nullOr submodule bool str; inherit (lib.types) attrsOf enum nullOr submodule bool str;
inherit (lib.modules) mkRenamedOptionModule; inherit (lib.modules) mkRenamedOptionModule;

View file

@ -1,6 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkOption mkEnableOption literalExpression; 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.modules) mkRenamedOptionModule;
inherit (lib.nvim.types) mkPluginSetupOption; inherit (lib.nvim.types) mkPluginSetupOption;
in { in {

View file

@ -1,8 +1,4 @@
{ {lib, ...}: let
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in {
options.vim.binds.cheatsheet = { options.vim.binds.cheatsheet = {

View file

@ -8,7 +8,7 @@
cfg = config.vim.binds.cheatsheet; cfg = config.vim.binds.cheatsheet;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = ["cheatsheet-nvim"]; vim.startPlugins = ["cheatsheet-nvim"];
vim.luaConfigRC.cheaetsheet-nvim = entryAnywhere '' vim.luaConfigRC.cheaetsheet-nvim = entryAnywhere ''

View file

@ -10,7 +10,7 @@
cfg = config.vim.binds.whichKey; cfg = config.vim.binds.whichKey;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = ["which-key"]; vim.startPlugins = ["which-key"];
vim.luaConfigRC.whichkey = entryAnywhere '' vim.luaConfigRC.whichkey = entryAnywhere ''
@ -23,7 +23,7 @@ in {
["<tab>"] = "TAB", ["<tab>"] = "TAB",
}, },
${optionalString (config.vim.ui.borders.plugins.which-key.enable) '' ${optionalString config.vim.ui.borders.plugins.which-key.enable ''
window = { window = {
border = "${config.vim.ui.borders.plugins.which-key.style}", border = "${config.vim.ui.borders.plugins.which-key.style}",
}, },

View file

@ -1,8 +1,4 @@
{ {lib, ...}: let
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) attrsOf nullOr str; inherit (lib.types) attrsOf nullOr str;
in { in {

View file

@ -8,7 +8,7 @@
cfg = config.vim.utility.ccc; cfg = config.vim.utility.ccc;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim.startPlugins = [
"ccc" "ccc"
]; ];

View file

@ -7,7 +7,7 @@
cfg = config.vim.utility.diffview-nvim; cfg = config.vim.utility.diffview-nvim;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim.startPlugins = [
"diffview-nvim" "diffview-nvim"
"plenary-nvim" "plenary-nvim"

View file

@ -8,7 +8,7 @@
cfg = config.vim.utility.icon-picker; cfg = config.vim.utility.icon-picker;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim.startPlugins = [
"icon-picker-nvim" "icon-picker-nvim"
"dressing-nvim" "dressing-nvim"

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;

View file

@ -1,8 +1,4 @@
{ {lib, ...}: let
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) enum listOf str nullOr int; inherit (lib.types) enum listOf str nullOr int;

View file

@ -12,7 +12,7 @@
self = import ./glow.nix { self = import ./glow.nix {
inherit lib config pkgs; inherit lib config pkgs;
}; };
mappings = self.options.vim.utility.preview.glow.mappings; inherit (self.options.vim.utility.preview.glow) mappings;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = ["glow-nvim"]; vim.startPlugins = ["glow-nvim"];

View file

@ -16,7 +16,7 @@
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim.startPlugins = [
"telescope" "telescope"
"plenary-nvim" "plenary-nvim"

View file

@ -9,7 +9,7 @@
cfg = config.vim.utility.vim-wakatime; cfg = config.vim.utility.vim-wakatime;
in { in {
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
vim.startPlugins = [ vim.startPlugins = [
pkgs.vimPlugins.vim-wakatime pkgs.vimPlugins.vim-wakatime
]; ];