Skip to content

Commit

Permalink
feat(flake): update 'stylix' input and use new 'stylix.enable' option
Browse files Browse the repository at this point in the history
Update the 'sytlix' input, use its new 'stylix.enable' option, and
conditionally set the 'stylix.image' and 'programs.mpv.scriptOpts.uosc'
options based on 'stylix.enable'.

Addresses:

- 25e5229
- 30231a3
- danth/stylix#244
  • Loading branch information
trueNAHO committed Jun 10, 2024
1 parent 21104e6 commit 390d626
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 61 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions modules/homeManager/programs/mpv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ in {

uosc = let
colors = config.lib.stylix.colors;
in {
background = colors.base00;
background_text = colors.base05;
curtain = colors.base0D;
error = colors.base0F;
foreground = colors.base05;
foreground_text = colors.base00;
success = colors.base0A;
top_bar_controls = "no";
};
in
lib.mkIf config.stylix.enable {
background = colors.base00;
background_text = colors.base05;
curtain = colors.base0D;
error = colors.base0F;
foreground = colors.base05;
foreground_text = colors.base00;
success = colors.base0A;
top_bar_controls = "no";
};
};

scripts = with pkgs.mpvScripts; [mpv-playlistmanager thumbfast uosc];
Expand Down
87 changes: 39 additions & 48 deletions modules/stylix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,52 @@ in {
imports = [inputs.stylix.homeManagerModules.stylix];
options.dotfiles.stylix.enable = lib.mkEnableOption module;

config = lib.mkMerge [
# TODO: Patch an upstream 'stylix.enable' option [1] to merge the
# unconditional 'stylix.image' option with the conditional 'lib.mkIf
# config.dotfiles.stylix.enable' attribute set.
#
# [1]: https://github.com/danth/stylix/issues/216
{
stylix.image = pkgs.fetchurl {
url = "https://www.pixelstalk.net/wp-content/uploads/2016/05/Epic-Anime-Awesome-Wallpapers.jpg";
sha256 = "enQo3wqhgf0FEPHj2coOCvo7DuZv+x5rL/WIo4qPI50=";
config = lib.mkIf config.dotfiles.stylix.enable {
home.activation.${module} =
lib.dotfiles.lib.hm.dag.entryBefore.writeBoundary.systemRequirement
module
"programs.dconf.enable = true;"
"";

stylix = {
cursor = {
name = "Bibata-Modern-Amber";
package = pkgs.bibata-cursors;
size = 22;
};
}

(
lib.mkIf config.dotfiles.stylix.enable {
home.activation.${module} =
lib.dotfiles.lib.hm.dag.entryBefore.writeBoundary.systemRequirement
module
"programs.dconf.enable = true;"
"";
enable = true;

stylix = {
cursor = {
name = "Bibata-Modern-Amber";
package = pkgs.bibata-cursors;
size = 22;
};
fonts = {
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};

fonts = {
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
monospace = {
package = pkgs.nerdfonts.override {fonts = ["FiraCode"];};
name = "FiraCodeNerdFont";
};

monospace = {
package = pkgs.nerdfonts.override {fonts = ["FiraCode"];};
name = "FiraCodeNerdFont";
};
sansSerif = {
package = pkgs.ibm-plex;
name = "IBMPlexSans";
};

sansSerif = {
package = pkgs.ibm-plex;
name = "IBMPlexSans";
};
serif = {
package = pkgs.crimson;
name = "Crimson";
};

serif = {
package = pkgs.crimson;
name = "Crimson";
};
sizes.terminal = 7;
};

sizes.terminal = 7;
};
image = pkgs.fetchurl {
url = "https://www.pixelstalk.net/wp-content/uploads/2016/05/Epic-Anime-Awesome-Wallpapers.jpg";
sha256 = "enQo3wqhgf0FEPHj2coOCvo7DuZv+x5rL/WIo4qPI50=";
};

polarity = "dark";
};
}
)
];
polarity = "dark";
};
};
}

0 comments on commit 390d626

Please sign in to comment.