-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathglobal.nix
More file actions
66 lines (55 loc) · 1.66 KB
/
global.nix
File metadata and controls
66 lines (55 loc) · 1.66 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
{ catppuccinModules }:
{
config,
lib,
pkgs,
...
}:
let
catppuccinLib = import ./lib { inherit config lib pkgs; };
in
{
config = {
assertions = [ (catppuccinLib.assertMinimumVersion "25.05") ];
};
imports = catppuccinLib.applyToModules catppuccinModules;
options.catppuccin = {
enable = lib.mkEnableOption "Catppuccin globally";
flavor = lib.mkOption {
type = catppuccinLib.types.flavor;
default = "mocha";
description = "Global Catppuccin flavor";
};
accent = lib.mkOption {
type = catppuccinLib.types.accent;
default = "mauve";
description = "Global Catppuccin accent";
};
sources =
let
defaultSources = (import ../default.nix { inherit pkgs; }).packages;
in
lib.mkOption {
type = lib.types.lazyAttrsOf lib.types.raw;
default = defaultSources;
defaultText = "{ ... }";
# HACK!
# without this, overriding one source will delete all others. -@getchoo
apply = lib.recursiveUpdate defaultSources;
description = "Port sources used across all options";
};
palette = lib.mkOption {
type = (import ./palette/type.nix) lib;
readOnly = true;
description = "Global Catppuccin palette";
};
cache.enable = lib.mkEnableOption "the usage of Catppuccin's binary cache";
};
config = {
nix.settings = lib.mkIf config.catppuccin.cache.enable {
substituters = [ "https://catppuccin.cachix.org" ];
trusted-public-keys = [ "catppuccin.cachix.org-1:noG/4HkbhJb+lUAdKrph6LaozJvAeEEZj4N732IysmU=" ];
};
catppuccin.palette = (import ./palette/data.nix).${config.catppuccin.flavor};
};
}