Skip to content

Commit

Permalink
Merge pull request #1 from danth/master
Browse files Browse the repository at this point in the history
:3
  • Loading branch information
TotalChaos05 authored Oct 25, 2023
2 parents 5f7b55c + 91e46de commit 622fb60
Show file tree
Hide file tree
Showing 23 changed files with 271 additions and 125 deletions.
131 changes: 125 additions & 6 deletions flake.lock

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

36 changes: 33 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,36 @@
url = "github:edolstra/flake-compat";
flake = false;
};

# Templates
base16-alacritty = {
url = "github:aarowill/base16-alacritty";
flake = false;
};
base16-fish = {
url = "github:tomyun/base16-fish";
flake = false;
};
base16-foot = {
url = "github:tinted-theming/base16-foot";
flake = false;
};
base16-helix = {
url = "github:tinted-theming/base16-helix";
flake = false;
};
base16-kitty = {
url = "github:kdrag0n/base16-kitty";
flake = false;
};
base16-tmux = {
url = "github:tinted-theming/base16-tmux";
flake = false;
};
base16-vim = {
url = "github:chriskempson/base16-vim";
flake = false;
};
};

outputs =
Expand All @@ -39,7 +69,7 @@

nixosModules.stylix = { pkgs, ... }@args: {
imports = [
(import ./stylix/nixos {
(import ./stylix/nixos inputs {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
homeManagerModule = self.homeManagerModules.stylix;
Expand All @@ -49,7 +79,7 @@

homeManagerModules.stylix = { pkgs, ... }@args: {
imports = [
(import ./stylix/hm {
(import ./stylix/hm inputs {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
})
Expand All @@ -58,7 +88,7 @@

darwinModules.stylix = { pkgs, ... }@args: {
imports = [
(import ./stylix/darwin {
(import ./stylix/darwin inputs {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
homeManagerModule = self.homeManagerModules.stylix;
Expand Down
7 changes: 1 addition & 6 deletions modules/alacritty/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ with config.stylix.fonts;

let
themeFile = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "aarowill";
repo = "base16-alacritty";
rev = "914727e48ebf3eab1574e23ca0db0ecd0e5fe9d0";
sha256 = "sha256-oDsuiKx8gt+Ov7hZ9PibIQtE81IRSLO+n5N99WeiK34=";
};
templateRepo = config.lib.stylix.templates.base16-alacritty;
};
in
{
Expand Down
11 changes: 4 additions & 7 deletions modules/bat/hm.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{ pkgs, config, lib, ... }:

let
themeFile = config.lib.stylix.colors {
template = ./base16-stylix.mustache;
extension = ".tmTheme";
};
in
{
options.stylix.targets.bat.enable =
config.lib.stylix.mkEnableTarget "Bat" config.programs.bat.enable;

config = lib.mkIf config.stylix.targets.bat.enable {
programs.bat.themes."base16-stylix" = builtins.readFile themeFile;
programs.bat.themes."base16-stylix".src = config.lib.stylix.colors {
template = ./base16-stylix.mustache;
extension = ".tmTheme";
};
home.sessionVariables.BAT_THEME = "base16-stylix";
};
}
1 change: 1 addition & 0 deletions modules/emacs/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ in
[
(epkgs.trivialBuild {
pname = "base16-stylix-theme";
version = "0.1.0";
src = pkgs.writeText "base16-stylix-theme.el" ''
(require 'base16-theme)
Expand Down
7 changes: 1 addition & 6 deletions modules/fish/prompt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

let
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tomyun";
repo = "base16-fish";
rev = "7f647967fddedaf803191bc9113b13d2071dc3cf";
sha256 = "IGUbLjsmmAvB9UKGkR7oqdpjeVEfzt83GpyBkrZf2O4=";
};
templateRepo = config.lib.stylix.templates.base16-fish;
};
in ''
source ${theme}
Expand Down
7 changes: 1 addition & 6 deletions modules/foot/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ let
cfg = config.stylix.targets.foot;

theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-foot";
rev = "22579065fbe21361b64d80bae798666efaa85ce0";
sha256 = "gb43UufuN6iRu6MfTZP+a3GUUQ+hKa5e6G4IiWEc68A=";
};
templateRepo = config.lib.stylix.templates.base16-foot;
};

in {
Expand Down
2 changes: 1 addition & 1 deletion modules/gtk/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ let
};

finalCss = pkgs.runCommandLocal "gtk.css" {} ''
echo ${escapeShellArg cfg.extraCss} >>$out
cat ${baseCss} >>$out
echo ${escapeShellArg cfg.extraCss} >>$out
'';

in {
Expand Down
7 changes: 1 addition & 6 deletions modules/helix/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

let
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-helix";
rev = "3e391da3aaf2fa43dc9cfb67e4e6216c7ce163dc";
sha256 = "elhPirlFx9UaZGTht9jFl8lLfT4Af38ITTPJT90yrHs=";
};
templateRepo = config.lib.stylix.templates.base16-helix;
};

# Removing the background exposes transparency from the terminal. The
Expand Down
27 changes: 27 additions & 0 deletions modules/hyprland/hm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ config, lib, ... }:

with config.lib.stylix.colors;

let
rgb = color: "rgb(${color})";
rgba = color: alpha: "rgba(${color}${alpha})";

settings = {
decoration."col.shadow" = rgba base00 "99";
general = {
"col.active_border" = rgb base0A;
"col.inactive_border" = rgb base03;
"col.group_border" = rgb base0D;
"col.group_border_active" = rgb base06;
"col.group_border_locked_active" = rgb base06;
};
misc.background_color = rgb base00;
};

in {
options.stylix.targets.hyprland.enable =
config.lib.stylix.mkEnableTarget "Hyprland" true;

config.wayland.windowManager.hyprland.settings =
lib.mkIf config.stylix.targets.hyprland.enable settings;
}
11 changes: 4 additions & 7 deletions modules/kitty/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
let
cfg = config.stylix.targets.kitty;
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "kdrag0n";
repo = "base16-kitty";
rev = "06bb401fa9a0ffb84365905ffbb959ae5bf40805";
sha256 = "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=";
};
templateRepo = config.lib.stylix.templates.base16-kitty;
target = if cfg.variant256Colors then "default-256" else "default";
};
in {
Expand All @@ -32,7 +27,9 @@ in {
size = config.stylix.fonts.sizes.terminal;
};
settings.background_opacity = with config.stylix.opacity; "${builtins.toString terminal}";
extraConfig = builtins.readFile theme;
extraConfig = ''
include ${theme}
'';
};
};
}
7 changes: 7 additions & 0 deletions modules/qutebrowser/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ in {
};
};
};
webpage = let
isDark = config.stylix.polarity == "dark";
in {
darkmode.enabled = lib.mkIf isDark (lib.mkDefault true);
preferred_color_scheme = lib.mkIf
isDark (lib.mkDefault config.stylix.polarity);
};
};

fonts = let
Expand Down
Loading

0 comments on commit 622fb60

Please sign in to comment.