Skip to content

Commit

Permalink
Settings schema test passing; all items have defaultValue + title
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Sep 27, 2024
1 parent a1da134 commit c548fb3
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 36 deletions.
4 changes: 2 additions & 2 deletions modules/kernels/bash/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ with lib;
options = {
kernels.bash = {
enable = mkOption {
description = "Enable Bash kernel";
example = "Enable Bash kernel";
type = types.bool;
default = false;
visible = false;
Expand All @@ -26,9 +26,9 @@ with lib;
};

lsp.bash-language-server.enable = mkOption {
example = "Enable Bash language server";
type = types.bool;
default = true;
description = "Enable Bash language server";
};
};
};
Expand Down
4 changes: 2 additions & 2 deletions modules/kernels/clojure/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ with lib;
options = {
kernels.clojure = {
enable = mkOption {
description = "Enable Clojure kernel";
example = "Enable Clojure kernel";
type = types.bool;
default = false;
visible = false;
Expand All @@ -26,9 +26,9 @@ with lib;
};

lsp.clojure-lsp.enable = mkOption {
example = "Enable clojure-lsp language server";
type = types.bool;
default = true;
description = "Enable clojure-lsp language server";
};
};
};
Expand Down
4 changes: 3 additions & 1 deletion modules/kernels/cpp/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ with lib;
options = {
kernels.cpp = {
enable = mkOption {
description = "Enable C++ kernel";
example = "Enable C++ kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};

flavor = mkOption {
example = "C++ flavor";
type = types.enum [
"c++11"
"c++14"
Expand Down
8 changes: 5 additions & 3 deletions modules/kernels/go/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ with lib;
options = {
kernels.go = {
enable = mkOption {
description = "Enable Go kernel";
example = "Enable Go kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};

goPackage = mkOption {
example = "Go version";
type = types.enum (
["go"]
++ (builtins.filter (name: builtins.substring 0 (builtins.stringLength "go_") name == "go_")
Expand All @@ -40,14 +42,14 @@ with lib;
};

lsp.gopls.enable = mkOption {
example = "Enable gopls language server";
type = types.bool;
description = "Enable gopls language server";
default = true;
};

go.gocache = mkOption {
example = "Value of GOCACHE environment variable";
type = types.str;
description = "Value of GOCACHE environment variable";
default = "/home/.gocache";
};
};
Expand Down
12 changes: 7 additions & 5 deletions modules/kernels/haskell/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ with lib;
options = {
kernels.haskell = {
enable = mkOption {
description = "Enable Haskell kernel";
example = "Enable Haskell kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};
ghcPackage = mkOption {
example = "GHC version";
type = types.enum ["ghc92" "ghc94" "ghc96" "ghc98"];
default = "ghc92";
};
Expand All @@ -35,23 +37,23 @@ with lib;
};

lsp.haskell-language-server.enable = mkOption {
description = "Enable haskell-language-server";
example = "Enable haskell-language-server";
type = types.bool;
default = true;
};
lsp.haskell-language-server.debug = mkOption {
description = "Haskell-language-server: enable debug output";
example = "Haskell-language-server: enable debug output";
type = types.bool;
default = false;
};
lsp.haskell-language-server.super-debug = mkOption {
description = "Haskell-language-server: enable verbose debug output";
example = "Haskell-language-server: enable verbose debug output";
type = types.bool;
default = false;
};

enableHlintOutput = mkOption {
description = "Enable hlint warnings in Jupyter kernel output. Normally you don't want this because it is provided by haskell-language-server.";
example = "Enable hlint warnings in Jupyter kernel output. Normally you don't want this because it is provided by haskell-language-server.";
type = types.bool;
default = false;
};
Expand Down
13 changes: 8 additions & 5 deletions modules/kernels/julia/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ with lib;
options = {
kernels.julia = {
enable = mkOption {
description = "Enable Haskell kernel";
example = "Enable Haskell kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};

juliaPackage = mkOption {
example = "Julia version";
type = types.enum (
["julia"]
++ (builtins.filter (n:
Expand All @@ -43,23 +45,24 @@ with lib;
};

precompile = mkOption {
description = "Precompile Julia environment for faster imports. In some cases, precompilation can make the build fail, so turning this off can help.";
example = "Precompile Julia environment for faster imports";
description = "In some cases, precompilation can make the build fail, so turning this off can help.";
type = types.bool;
default = true;
};

lsp.LanguageServer.enable = mkOption {
description = "Enable LanguageServer language server";
example = "Enable LanguageServer language server";
type = types.bool;
default = true;
};
lsp.LanguageServer.index = mkOption {
description = "LanguageServer: auto-index packages when building environment";
example = "Auto-index packages when building environment";
type = types.bool;
default = true;
};
lsp.LanguageServer.debug = mkOption {
description = "LanguageServer: log debug messages to stderr";
example = "Log debug messages to stderr";
type = types.bool;
default = false;
};
Expand Down
5 changes: 3 additions & 2 deletions modules/kernels/octave/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ with lib;
options = {
kernels.octave = {
enable = mkOption {
description = "Enable Octave kernel";
example = "Enable Octave kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};
Expand All @@ -31,9 +32,9 @@ with lib;
};

extraJupyterConfig = mkOption {
example = "Extra Jupyter configuration";
type = types.str;
default = "";
description = "Extra Jupyter configuration.";
};
};
};
Expand Down
2 changes: 2 additions & 0 deletions modules/kernels/postgres/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ with lib;
options = {
kernels.postgres = {
enable = mkOption {
example = "Enable PostgreSQL kernel";
type = types.bool;
default = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};
Expand Down
16 changes: 8 additions & 8 deletions modules/kernels/python/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ let
mkOptions = packageOption: {
enable = mkOption {
example = "Enable Python 3 kernel";
description = "Enable Python 3 kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};
Expand All @@ -38,37 +38,37 @@ let
default = true;
};
lsp.pyright.enable = mkOption {
description = "Enable Pyright language server";
example = "Enable Pyright language server";
type = types.bool;
default = false;
};
lsp.pylint.enable = mkOption {
description = "Enable Pylint language server";
example = "Enable Pylint language server";
type = types.bool;
default = false;
};
lsp.flake8.enable = mkOption {
description = "Enable Flake8 language server";
example = "Enable Flake8 language server";
type = types.bool;
default = false;
};
lsp.pycodestyle.enable = mkOption {
description = "Enable pycodestyle language server";
example = "Enable pycodestyle language server";
type = types.bool;
default = false;
};
lsp.microsoft.enable = mkOption {
description = "Enable Microsoft Python language server";
example = "Enable Microsoft Python language server";
type = types.bool;
default = false;
};
lsp.python-lsp-server.enable = mkOption {
description = "Enable python-lsp-server language server";
example = "Enable python-lsp-server language server";
type = types.bool;
default = false;
};
lsp.python-language-server.enable = mkOption {
description = "Enable python-language-server language server";
example = "Enable python-language-server language server";
type = types.bool;
default = false;
};
Expand Down
5 changes: 3 additions & 2 deletions modules/kernels/r/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ with lib;
options = {
kernels.R = {
enable = mkOption {
description = "Enable R kernel";
example = "Enable R kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};
Expand All @@ -31,9 +32,9 @@ with lib;
};

lsp.languageserver.enable = mkOption {
example = "Enable languageserver";
type = types.bool;
default = true;
description = "Enable languageserver";
};
};
};
Expand Down
4 changes: 3 additions & 1 deletion modules/kernels/ruby/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ in
options = {
kernels.ruby = {
enable = mkOption {
description = "Enable Ruby kernel";
example = "Enable Ruby kernel";
type = types.bool;
default = false;
visible = false;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str types.attrs);
default = [];
};

rubyPackage = mkOption {
example = "Ruby version";
type = types.enum (
["ruby"]
++ (builtins.filter (name: builtins.substring 0 (builtins.stringLength "ruby_") name == "ruby_")
Expand Down
11 changes: 6 additions & 5 deletions modules/kernels/rust/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@ with lib;
};

packages = mkOption {
example = "List of packages";
type = types.listOf (types.either types.str (types.submodule {
options = {
name = mkOption rec {
type = types.str;
description = "Package name";
type = types.str;
};
features = mkOption rec {
example = "Features to enable for the package";
type = types.listOf types.str;
description = "Features to enable for the package";
};
};
}));
default = [];
};

rustPackage = mkOption {
example = "Rust version";
type = types.enum (
["rust"]
++ (builtins.filter (name: builtins.substring 0 (builtins.stringLength "rust_") name == "rust_")
Expand All @@ -51,14 +53,13 @@ with lib;
};

lsp.rust-analyzer.enable = mkOption {
example = "Rust-analyzer: enable";
type = types.bool;
description = "Rust-analyzer: enable";
default = true;
};

lsp.rust-analyzer.debug = mkOption {
example = "Rust-analyzer: debug output";
type = types.bool;
description = "Rust-analyzer: debug output";
default = false;
};
};
Expand Down

0 comments on commit c548fb3

Please sign in to comment.