mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 19:00:14 +00:00
fix: nix flake check and packages formatting
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
# Sets Neovim colors based on Nix colorscheme
|
||||
|
||||
options.colors = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
type = lib.types.nullOr (lib.types.attrsOf lib.types.str);
|
||||
description = "Attrset of base16 colorscheme key value pairs.";
|
||||
default = {
|
||||
# Nord
|
||||
@ -32,7 +32,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
config = lib.mkIf (config.colors != null) {
|
||||
plugins = [ pkgs.vimPlugins.base16-nvim ];
|
||||
setup.base16-colorscheme = config.colors;
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
{
|
||||
|
||||
# Terraform optional because non-free
|
||||
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
|
||||
options.github = lib.mkEnableOption "Whether to enable GitHub features";
|
||||
options.kubernetes = lib.mkEnableOption "Whether to enable Kubernetes features";
|
||||
options.enableTerraform = lib.mkEnableOption "Whether to enable Terraform LSP";
|
||||
options.enableGithub = lib.mkEnableOption "Whether to enable GitHub features";
|
||||
options.enableKubernetes = lib.mkEnableOption "Whether to enable Kubernetes features";
|
||||
|
||||
config = {
|
||||
plugins = [
|
||||
@ -54,7 +54,7 @@
|
||||
|
||||
use.lspconfig.terraformls.setup = dsl.callWith {
|
||||
cmd =
|
||||
if config.terraform then
|
||||
if config.enableTerraform then
|
||||
[
|
||||
"${pkgs.terraform-ls}/bin/terraform-ls"
|
||||
"serve"
|
||||
@ -93,7 +93,7 @@
|
||||
nix = [ "nixfmt" ];
|
||||
rust = [ "rustfmt" ];
|
||||
sh = [ "shfmt" ];
|
||||
terraform = if config.terraform then [ "terraform_fmt" ] else [ ];
|
||||
terraform = if config.enableTerraform then [ "terraform_fmt" ] else [ ];
|
||||
hcl = [ "hcl" ];
|
||||
};
|
||||
formatters = {
|
||||
@ -110,7 +110,7 @@
|
||||
"-ci"
|
||||
];
|
||||
};
|
||||
terraform_fmt.command = if config.terraform then "${pkgs.terraform}/bin/terraform" else "";
|
||||
terraform_fmt.command = if config.enableTerraform then "${pkgs.terraform}/bin/terraform" else "";
|
||||
hcl.command = "${pkgs.hclfmt}/bin/hclfmt";
|
||||
};
|
||||
};
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
lua = ''
|
||||
${builtins.readFile ./toggleterm.lua}
|
||||
${if config.github then (builtins.readFile ./github.lua) else ""}
|
||||
${if config.kubernetes then (builtins.readFile ./kubernetes.lua) else ""}
|
||||
${if config.enableGithub then (builtins.readFile ./github.lua) else ""}
|
||||
${if config.enableKubernetes then (builtins.readFile ./kubernetes.lua) else ""}
|
||||
'';
|
||||
}
|
||||
|
@ -29,9 +29,9 @@
|
||||
{
|
||||
pkgs,
|
||||
colors ? null,
|
||||
terraform ? false,
|
||||
github ? false,
|
||||
kubernetes ? false,
|
||||
enableTerraform ? false,
|
||||
enableGithub ? false,
|
||||
enableKubernetes ? false,
|
||||
...
|
||||
}:
|
||||
|
||||
@ -41,9 +41,9 @@ pkgs.neovimBuilder {
|
||||
package = pkgs.neovim-unwrapped;
|
||||
inherit
|
||||
colors
|
||||
terraform
|
||||
github
|
||||
kubernetes
|
||||
enableTerraform
|
||||
enableGithub
|
||||
enableKubernetes
|
||||
;
|
||||
imports = [
|
||||
./config/align.nix
|
||||
|
Reference in New Issue
Block a user