-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
73 lines (69 loc) · 1.81 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
lib,
writeText,
runCommand,
jc,
where-is-my-sddm-theme,
/*
Here is how you can define extra settings for the theme and the flavor to use:
environment.systemPackages = [
(pkgs.catppuccin-where-is-my-sddm-theme.override {
flavor = "macchiato";
settings = {
General = {
hideCursor = false;
};
};
})
];
*/
settings ? null,
flavor ? "mocha",
variants ? [ "qt6" ],
}:
let
theme = builtins.path {
name = "catppuccin-where-is-my-sddm-theme";
path = ./.;
};
validVariants = [
"qt5"
"qt6"
];
validFlavors = [
"frappe"
"latte"
"macchiato"
"mocha"
];
# Borrowed from catppuccin/nix
fromINI =
file:
let
json = runCommand "converted.json" { } ''${lib.getExe jc} --ini < ${file} > $out'';
in
builtins.fromJSON (builtins.readFile json);
themeContent = fromINI "${theme}/themes/catppuccin-${flavor}.conf";
customTheme = lib.recursiveUpdate themeContent (lib.optionalAttrs (settings != null) settings);
in
lib.throwIfNot (builtins.elem flavor validFlavors)
"catppuccin-where-is-my-sddm-theme: flavor ${flavor} is not valid. Valid flavors are: ${builtins.concatStringsSep ", " validFlavors}"
lib.checkListOfEnum
"catppuccin-where-is-my-sddm-theme: variant"
validVariants
variants
(where-is-my-sddm-theme.override {
inherit variants;
themeConfig = customTheme;
}).overrideAttrs
(oldAttrs: {
pname = "catppuccin-where-is-my-sddm-theme";
version = "1.0.0";
meta = {
description = "Soothing pastel theme for Where is my SDDM theme?";
homepage = "https://github.com/catppuccin/where-is-my-sddm-theme";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ HeitorAugustoLN ];
inherit (oldAttrs.meta) platforms;
};
})