Skip to content

Commit 0f02754

Browse files
committed
modules: add new theme module
Old one was upstreamed to Matugen. Also remove lib/default as it was kinda junk.
1 parent 483680e commit 0f02754

File tree

26 files changed

+80
-230
lines changed

26 files changed

+80
-230
lines changed

Diff for: home/editors/helix/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
theme =
3333
"catppuccin_"
3434
+ (
35-
if config.programs.matugen.variant == "light"
35+
if config.theme.name == "light"
3636
then "latte"
3737
else "mocha"
3838
);

Diff for: home/profiles/default.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
self,
33
inputs,
4-
default,
54
withSystem,
65
...
76
}: let
87
# get these into the module system
9-
specialArgs = {inherit inputs self default;};
8+
specialArgs = {inherit inputs self;};
109

1110
sharedModules = [
1211
../.
1312
{_module.args = specialArgs;}
1413
inputs.ags.homeManagerModules.default
1514
inputs.anyrun.homeManagerModules.default
15+
inputs.hyprland.homeManagerModules.default
16+
inputs.matugen.nixosModules.default
1617
inputs.nix-index-db.hmModules.nix-index
1718
inputs.spicetify-nix.homeManagerModule
18-
inputs.hyprland.homeManagerModules.default
1919
self.nixosModules.theme
2020
];
2121

Diff for: home/programs/anyrun/default.nix

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
pkgs,
3-
default,
43
inputs,
54
config,
65
...
@@ -23,13 +22,13 @@
2322
closeOnClick = true;
2423
};
2524

26-
extraCss = builtins.readFile (./. + "/style-${config.programs.matugen.variant}.css");
25+
extraCss = builtins.readFile (./. + "/style-${config.theme.name}.css");
2726

2827
extraConfigFiles."applications.ron".text = ''
2928
Config(
3029
desktop_actions: false,
3130
max_entries: 5,
32-
terminal: Some("${default.terminal.name}"),
31+
terminal: Some("wezterm"),
3332
)
3433
'';
3534
};

Diff for: home/programs/gtk.nix

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
pkgs,
33
config,
44
...
5-
}: let
6-
inherit (config.programs.matugen) variant;
7-
in {
5+
}: {
86
home.pointerCursor = {
97
package = pkgs.bibata-cursors;
108
name = "Bibata-Modern-Classic";
@@ -31,7 +29,7 @@ in {
3129

3230
theme = {
3331
name =
34-
if variant == "light"
32+
if config.theme.name == "light"
3533
then "adw-gtk3"
3634
else "adw-gtk3-dark";
3735
package = pkgs.adw-gtk3;

Diff for: home/programs/media/spicetify.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
programs.spicetify = let
99
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default;
1010
variant =
11-
if config.programs.matugen.variant == "light"
11+
if config.theme.name == "light"
1212
then "latte"
1313
else "mocha";
1414
in {

Diff for: home/programs/office/zathura.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
extraConfig =
2525
"include catppuccin-"
2626
+ (
27-
if config.programs.matugen.variant == "light"
27+
if config.theme.name == "light"
2828
then "latte"
2929
else "mocha"
3030
);

Diff for: home/programs/wayland/hyprland/binds.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{default, ...}: let
1+
let
22
screenshotarea = "hyprctl keyword animation 'fadeOut,0,0,default'; grimblast --notify copysave area; hyprctl keyword animation 'fadeOut,1,4,default'";
33

44
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
@@ -45,7 +45,7 @@ in {
4545

4646
# utility
4747
# terminal
48-
"$mod, Return, exec, run-as-service ${default.terminal.name}"
48+
"$mod, Return, exec, run-as-service wezterm"
4949
# logout menu
5050
"$mod, Escape, exec, wlogout -p layer-shell"
5151
# lock screen
@@ -86,7 +86,7 @@ in {
8686

8787
bindr = [
8888
# launcher
89-
"$mod, SUPER_L, exec, pkill .${default.launcher}-wrapped || run-as-service ${default.launcher}"
89+
"$mod, SUPER_L, exec, pkill .anyrun-wrapped || run-as-service anyrun"
9090
];
9191

9292
bindl = [

Diff for: home/programs/wayland/hyprland/rules.nix

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{config, ...}: let
2-
inherit (config.programs.matugen) variant;
3-
in {
1+
{
42
wayland.windowManager.hyprland.settings = {
53
# layer rules
64
layerrule = let
@@ -10,11 +8,6 @@ in {
108
"xray 1, ^(bar|gtk-layer-shell)$"
119
"ignorealpha 0.2, ${layers}"
1210
"ignorealpha 0.5, ^(music|calendar|system-menu|anyrun)$"
13-
# "ignorealpha 0${
14-
# if variant == "dark"
15-
# then ".5"
16-
# else ""
17-
# }, ^(anyrun)$"
1811
];
1912

2013
# window rules

Diff for: home/programs/wayland/hyprland/settings.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{config, ...}: let
2-
inherit (config.programs.matugen) variant;
2+
variant = config.theme.name;
33
c = config.programs.matugen.theme.colors.colors_android.${variant};
44
pointer = config.home.pointerCursor;
55
in {

Diff for: home/programs/wayland/swaylock.nix

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
22
config,
3-
default,
43
pkgs,
54
...
65
}: {
76
programs.swaylock = {
87
enable = true;
98
package = pkgs.swaylock-effects;
109
settings = let
11-
c = config.programs.matugen.theme.colors.colors.dark;
10+
c = config.programs.matugen.theme.colors.colors.${config.theme.name};
1211
in {
1312
clock = true;
1413
font = "Inter";
15-
image = default.wallpaper;
14+
image = config.theme.wallpaper;
1615
indicator = true;
1716

1817
bs-hl-color = c.error;

Diff for: home/services/system/dunst.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# notification daemon
77
services.dunst = let
88
xcolors = pkgs.lib.colors.xcolors config.programs.matugen.theme.colors;
9-
inherit (config.programs.matugen) variant;
9+
variant = config.theme.name;
1010
c = xcolors.colors.${variant};
1111
in {
1212
enable = true;

Diff for: home/services/wayland/hyprpaper.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
pkgs,
33
inputs,
44
lib,
5-
default,
5+
config,
66
...
77
}: {
88
xdg.configFile."hypr/hyprpaper.conf".text = ''
9-
preload = ${default.wallpaper}
10-
wallpaper = , ${default.wallpaper}
9+
preload = ${config.theme.wallpaper}
10+
wallpaper = , ${config.theme.wallpaper}
1111
'';
1212

1313
systemd.user.services.hyprpaper = {

Diff for: home/specialisations.nix

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
pkgs,
3-
# default,
43
lib,
4+
config,
55
...
66
}: {
77
# light/dark specialisations
@@ -17,17 +17,31 @@
1717
'';
1818
in {
1919
light.configuration = {
20-
programs.matugen.variant = "light";
20+
theme.name = "light";
2121
home.activation = {inherit dconfLight;};
2222
};
2323
dark.configuration = {
24-
programs.matugen.variant = "dark";
24+
theme.name = "dark";
2525
home.activation = {inherit dconfDark;};
2626
};
2727
};
2828

29-
# programs.matugen = {
30-
# enable = false;
31-
# wallpaper = default.wallpaper;
32-
# };
29+
theme = {
30+
# specific to unsplash
31+
wallpaper = let
32+
params = "?q=85&fm=jpg&crop=fit&cs=srgb&w=2560";
33+
url = "https://images.unsplash.com/photo-1608507974219-2df72d775da0${params}.jpg";
34+
sha256 = "0dr4svc3sbygkxyrjxillrdx4940rvw0avf2grrrx2l88z64srmq";
35+
ext = lib.last (lib.splitString "." url);
36+
in
37+
builtins.fetchurl {
38+
name = "wallpaper-${sha256}.${ext}";
39+
inherit url sha256;
40+
};
41+
};
42+
43+
programs.matugen = {
44+
enable = false;
45+
wallpaper = config.theme.wallpaper;
46+
};
3347
}

Diff for: home/terminal/emulators/alacritty.nix

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
{
2-
pkgs,
3-
default,
4-
...
5-
}: let
6-
inherit (default.terminal) font size opacity;
7-
in {
1+
{pkgs, ...}: {
82
programs.alacritty = {
93
enable = true;
104
settings = {
@@ -21,14 +15,14 @@ in {
2115
scrolling.history = 10000;
2216

2317
font = {
24-
normal.family = font;
25-
bold.family = font;
26-
italic.family = font;
27-
inherit size;
18+
normal.family = "JetBrains Mono";
19+
bold.family = "JetBrains Mono";
20+
italic.family = "JetBrains Mono";
21+
size = 10;
2822
};
2923

3024
draw_bold_text_with_bright_colors = true;
31-
window.opacity = opacity;
25+
window.opacity = 0.9;
3226

3327
imports = [
3428
(pkgs.fetchurl {

Diff for: home/terminal/emulators/foot.nix

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
{
2-
default,
3-
config,
4-
...
5-
}: let
1+
{config, ...}: let
62
colors = {
73
dark = {
84
foreground = "cdd6f4"; # Text
@@ -52,7 +48,7 @@ in {
5248

5349
settings = {
5450
main = {
55-
font = "${default.terminal.font}:size=${toString default.terminal.size}";
51+
font = "JetBrains Mono:size=10";
5652
box-drawings-uses-font-glyphs = "yes";
5753
pad = "0x0 center";
5854
notify = "notify-send -a \${app-id} -i \${app-id} \${title} \${body}";
@@ -79,9 +75,9 @@ in {
7975

8076
colors =
8177
{
82-
alpha = default.terminal.opacity;
78+
alpha = 0.9;
8379
}
84-
// colors.${config.programs.matugen.variant};
80+
// colors.${config.theme.name};
8581
};
8682
};
8783
}

Diff for: home/terminal/emulators/kitty.nix

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{default, ...}: {
1+
{
22
programs.kitty = {
33
enable = true;
44
font = {
5-
inherit (default.terminal) size;
6-
name = default.terminal.font;
5+
size = 10;
6+
name = "JetBrains Mono";
77
};
88

99
settings = {
@@ -20,7 +20,7 @@
2020
selection_background = "none";
2121

2222
# colors
23-
background_opacity = toString default.terminal.opacity;
23+
background_opacity = "0.9";
2424
};
2525

2626
theme = "Catppuccin-Mocha";

Diff for: home/terminal/emulators/wezterm.nix

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
default,
32
inputs,
43
pkgs,
54
...
@@ -34,10 +33,10 @@
3433
color_scheme = scheme_for_appearance(get_appearance()),
3534
default_cursor_style = 'SteadyBar',
3635
enable_scroll_bar = true,
37-
font_size = ${toString default.terminal.size},
36+
font_size = 10,
3837
hide_tab_bar_if_only_one_tab = true,
3938
scrollback_lines = 10000,
40-
window_background_opacity = ${toString default.terminal.opacity},
39+
window_background_opacity = 0.9,
4140
}
4241
'';
4342
};

Diff for: home/terminal/programs/bat.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
...
55
}: let
66
variant =
7-
if config.programs.matugen.variant == "light"
7+
if config.theme.name == "light"
88
then "latte"
99
else "mocha";
1010
in {

Diff for: home/terminal/programs/btop.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
...
55
}: let
66
variant =
7-
if config.programs.matugen.variant == "light"
7+
if config.theme.name == "light"
88
then "latte"
99
else "mocha";
1010
in {

Diff for: home/terminal/programs/git.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
delta = {
1515
enable = true;
16-
options.${config.programs.matugen.variant} = true;
16+
options.${config.theme.name} = true;
1717
};
1818

1919
extraConfig = {

Diff for: home/terminal/programs/xdg.nix

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
config,
33
pkgs,
4-
default,
54
...
65
}: let
76
browser = ["firefox"];
@@ -69,7 +68,7 @@ in {
6968
home.packages = [
7069
# used by `gio open` and xdp-gtk
7170
(pkgs.writeShellScriptBin "xdg-terminal-exec" ''
72-
${default.terminal.name} ${default.terminal.exec} "$@"
71+
wezterm start "$@"
7372
'')
7473
pkgs.xdg-utils
7574
];

0 commit comments

Comments
 (0)