-
Notifications
You must be signed in to change notification settings - Fork 42
/
default.nix
80 lines (75 loc) · 2.95 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
74
75
76
77
78
79
80
{ pkgs ? (builtins.trace "nix-colors/lib-contrib: using <nixpkgs> as pkgs because the pkgs parameter was not provided" (import <nixpkgs> { })) }:
rec {
# Takes a scheme, resulting wallpaper height and width, plus logo scale, and ouputs the generated wallpaper path
# Example:
# wallpaper = nixWallpaperFromScheme {
# scheme = config.colorScheme;
# width = 2560;
# height = 1080;
# logoScale = 5.0;
# };
nixWallpaperFromScheme = import ./nix-wallpaper.nix { inherit pkgs; };
# Takes a picture path and a scheme variant ("dark" or "light"), and outputs a colorscheme based on it
# Please note the path must be accessible by your flake on pure mode
# Example:
# colorScheme = colorSchemeFromPicture {
# path = ./my/cool/wallpaper.png;
# variant = "dark";
# };
colorSchemeFromPicture = import ./from-picture.nix { inherit pkgs; };
# Alias for backwards compat
colorschemeFromPicture = colorSchemeFromPicture;
# Takes a scheme, ouputs a generated materia GTK theme
# Example:
# gtk.theme.package = gtkThemeFromScheme {
# scheme = config.colorScheme;
# };
gtkThemeFromScheme = import ./gtk-theme.nix { inherit pkgs; };
# Takes a scheme, ouputs a vim theme package.
#
# The output theme name will be "nix-" followed by the coloscheme's slug, and
# should be set, for example, by adding "colorscheme nix-${config.colorScheme.slug}"
# to your vimrc.
#
# Vim example:
# programs.vim = {
# plugins = [
# (vimThemeFromScheme { scheme = config.colorScheme; })
# ];
# extraConfig = "colorscheme nix-${config.colorScheme.slug}";
# };
#
# Neovim example:
# programs.neovim.plugins = [{
# plugin = vimThemeFromScheme { scheme = config.colorScheme; };
# config = "colorscheme nix-${config.colorScheme.slug}";
# }];
vimThemeFromScheme = import ./vim-theme.nix { inherit pkgs; };
# Takes a scheme, ouputs a script that applies this scheme to the current shell.
# It also runs on ttys, and clears the screen when doing it (to look better).
# If you'd rather not let it clean your screen, pass the argument { clearTty = false; }
#
# Example:
# programs.fish = {
# interactiveShellInit = ''
# sh ${shellThemeFromScheme { scheme = config.colorScheme; }}
# '';
# };
shellThemeFromScheme = import ./shell-theme.nix { inherit pkgs; };
# Takes a scheme, outputs a file containing a TextMate theme.
# Some other programs that use this format are SublimeText and bat.
#
# The file name is in the format "nix-${scheme.slug}.tmTheme".
#
# Optional parameters:
# extraConfig: Extra configs as a set (default: empty).
# extraXmlConfig: Extra XML configs as a string (default: empty).
# indentPattern: Pattern to use when indenting (default: " ").
#
# Example:
# programs.bat = {
# config.theme = "myTheme";
# themes.myTheme.src = textMateThemeFromScheme { scheme = config.colorScheme; };
# };
textMateThemeFromScheme = import ./textmate-theme.nix { inherit pkgs; };
}