-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.nix
More file actions
85 lines (74 loc) · 1.96 KB
/
module.nix
File metadata and controls
85 lines (74 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{ config, options, lib, nixosOptionsToSettingsSchema, boilerplate, ... }:
with lib;
let
pkgsToUse = config.pkgsMaster;
in
{
options = {
kernels.cpp = {
enable = mkOption {
example = "Enable C++ kernel";
type = types.bool;
default = false;
visible = false;
};
packages = mkOption {
example = "List of packages";
type = types.listOf types.str;
default = [];
visible = false;
};
flavor = mkOption {
example = "C++ flavor";
type = types.enum [
# "c++11"
# "c++14"
"c++17"
"c++20"
"c++23"
"c++2c"
# "gnu++11"
# "gnu++14"
"gnu++17"
"gnu++20"
"gnu++23"
"gnu++2c"
];
default = "c++23";
};
interface.attrs = mkOption {
example = boilerplate.attrsTitle;
description = boilerplate.attrsDescription;
type = types.listOf types.str;
default = ["cpp"];
};
interface.extensions = mkOption {
example = boilerplate.extensionsTitle;
description = boilerplate.extensionsDescription;
type = types.listOf types.str;
default = ["cpp" "hpp" "cxx" "hxx" "c" "h"];
};
lsp.clangd.enable = mkOption {
example = "Enable clangd language server";
type = types.bool;
default = true;
};
lsp.clangd.debug = mkOption {
example = "Clangd: enable debug output";
type = types.bool;
default = false;
};
lsp.clangd.super-debug = mkOption {
example = "Clangd: enable verbose debug output";
type = types.bool;
default = false;
};
};
};
config = mkIf config.kernels.cpp.enable {
builtKernels.cpp = pkgsToUse.callPackage ./. {
settings = config.kernels.cpp;
settingsSchema = nixosOptionsToSettingsSchema { componentsToDrop = 2; } options.kernels.cpp;
};
};
}