-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
executable file
·53 lines (49 loc) · 1.17 KB
/
default.nix
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
{
config,
lib,
...
}: let
# Read all files in the current directory and the 'plug' directory
files = builtins.readDir ./.;
plugFiles = builtins.readDir ./plug;
# Filter out default.nix and non-.nix files from both directories
nixFiles =
builtins.filter
(name: name != "default.nix" && builtins.match ".*\\.nix" name != null)
(builtins.attrNames files ++ builtins.attrNames plugFiles);
# Create a list of import statements for both directories
imports = map (name:
if builtins.elem name (builtins.attrNames files)
then ./. + "/${name}"
else ./plug + "/${name}")
nixFiles;
in {
# Import all configuration modules automatically
inherit imports;
# Theme options
options = {
theme = lib.mkOption {
default = lib.mkDefault "tokyonight";
type = lib.types.enum [
"paradise"
"decay"
"blueberry"
"edge-dark"
"mountain"
"tokyonight"
"everforest"
"everblush"
"jellybeans"
"aquarium"
"gruvbox"
];
};
};
# Configuration
config = {
theme = "blueberry";
extraConfigLua = ''
_G.theme = "${config.theme}"
'';
};
}