fix: nix flake check and packages formatting

This commit is contained in:
Noah Masur
2025-06-21 23:38:37 -04:00
parent ae09296f36
commit 20fc80c259
10 changed files with 69 additions and 40 deletions

View File

@ -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;

View File

@ -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";
};
};

View File

@ -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 ""}
'';
}

View File

@ -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

View File

@ -1,7 +1,7 @@
{
lib,
fetchFromGitHub,
nodejs_18,
nodejs_20,
buildNpmPackage,
nodePackages,
python3,
@ -29,7 +29,7 @@ buildNpmPackage (finalAttrs: rec {
npmDepsHash = "sha256-N8xqRYFelolNGTEhG22M7KJ7B5U/uW7o+/XfLF8rHMg=";
nativeBuildInputs = [
nodejs_18
nodejs_20
nodePackages.typescript
python3
nodePackages.node-gyp
@ -64,7 +64,7 @@ buildNpmPackage (finalAttrs: rec {
installPhase = ''
mkdir -p $out/{bin,lib}
cp -r . $out/lib/prometheus-actual-exporter
makeWrapper ${lib.getExe nodejs_18} $out/bin/prometheus-actual-exporter \
makeWrapper ${lib.getExe nodejs_20} $out/bin/prometheus-actual-exporter \
--add-flags "$out/lib/prometheus-actual-exporter/dist/app.js"
'';