basic support for base16 templates
This commit is contained in:
parent
d78da97be7
commit
df75571c56
21
flake.nix
21
flake.nix
@ -1,5 +1,16 @@
|
||||
{
|
||||
outputs = { self, nixpkgs }: {
|
||||
inputs = {
|
||||
base16-rofi = {
|
||||
url = "git+ssh://git@gitlab.com/0xdec/base16-rofi.git";
|
||||
flake = false;
|
||||
};
|
||||
base16-kitty = {
|
||||
url = "github:kdrag0n/base16-kitty";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }@inputs: {
|
||||
nixosModules = {
|
||||
ezpassthru = import ./modules/ezpassthru.nix;
|
||||
ezpc = import ./modules/ezpc.nix;
|
||||
@ -13,7 +24,11 @@
|
||||
|
||||
homeManagerModules = {
|
||||
ezpcusr = import ./home-manager/modules/ezpcusr.nix;
|
||||
all = import ./home-manager/modules/default.nix;
|
||||
ezchromium = import ./home-manager/modules/ezchromium.nix;
|
||||
ezcodium = import ./home-manager/modules/ezcodium.nix;
|
||||
colors = import ./home-manager/modules/colors.nix inputs;
|
||||
fonts = import ./home-manager/modules/fonts.nix;
|
||||
all = import ./home-manager/modules/default.nix inputs;
|
||||
};
|
||||
|
||||
# Not really modules? but eh
|
||||
@ -22,7 +37,7 @@
|
||||
nixosModules.common-glooder = import ./users/glooder.nix;
|
||||
nixosModules.common-chekkie = import ./users/chekkie.nix;
|
||||
|
||||
homeManagerModules.common = import ./home-manager/common.nix;
|
||||
homeManagerModules.common = import ./home-manager/common.nix inputs;
|
||||
homeManagerModules.common-notgne2 = import ./home-manager/users/notgne2.nix;
|
||||
homeManagerModules.common-notgne2_pc = import ./home-manager/users/notgne2_pc.nix;
|
||||
homeManagerModules.common-glooder = import ./home-manager/users/glooder.nix;
|
||||
|
@ -1,7 +1,8 @@
|
||||
inputs:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./modules ];
|
||||
imports = [ (import ./modules inputs) ];
|
||||
|
||||
programs.vim = {
|
||||
enable = true;
|
||||
|
@ -1,38 +0,0 @@
|
||||
name: base16:
|
||||
|
||||
''
|
||||
# Base16 ${name} - kitty color config
|
||||
# Scheme generated by ezpcusr in Nix
|
||||
background #${base16."base00"}
|
||||
foreground #${base16."base05"}
|
||||
selection_background #${base16."base05"}
|
||||
selection_foreground #${base16."base00"}
|
||||
url_color #${base16."base04"}
|
||||
cursor #${base16."base05"}
|
||||
active_border_color #${base16."base03"}
|
||||
inactive_border_color #${base16."base01"}
|
||||
active_tab_background #${base16."base00"}
|
||||
active_tab_foreground #${base16."base05"}
|
||||
inactive_tab_background #${base16."base01"}
|
||||
inactive_tab_foreground #${base16."base04"}
|
||||
|
||||
# normal
|
||||
color0 #${base16."base00"}
|
||||
color1 #${base16."base08"}
|
||||
color2 #${base16."base0B"}
|
||||
color3 #${base16."base0A"}
|
||||
color4 #${base16."base0D"}
|
||||
color5 #${base16."base0E"}
|
||||
color6 #${base16."base0C"}
|
||||
color7 #${base16."base05"}
|
||||
|
||||
# bright
|
||||
color8 #${base16."base03"}
|
||||
color9 #${base16."base09"}
|
||||
color10 #${base16."base01"}
|
||||
color11 #${base16."base02"}
|
||||
color12 #${base16."base04"}
|
||||
color13 #${base16."base06"}
|
||||
color14 #${base16."base0F"}
|
||||
color15 #${base16."base05"}
|
||||
''
|
@ -1,150 +0,0 @@
|
||||
name: base16:
|
||||
|
||||
''
|
||||
/**
|
||||
* Base16 {{scheme-name}} ROFI Color theme
|
||||
*
|
||||
* Authors
|
||||
* Scheme: {{scheme-author}}
|
||||
* Template: Jordi Pakey-Rodriguez (https://github.com/0xdec), Andrea Scarpino (https://github.com/ilpianista)
|
||||
*/
|
||||
|
||||
* {
|
||||
red: #${base16."base08"};
|
||||
blue: #${base16."base0D"};
|
||||
lightfg: #${base16."base06"};
|
||||
lightbg: #${base16."base01"};
|
||||
foreground: #${base16."base05"};
|
||||
background: #${base16."base00"};
|
||||
background-color: #${base16."base00"};
|
||||
separatorcolor: @foreground;
|
||||
border-color: @foreground;
|
||||
selected-normal-foreground: @lightbg;
|
||||
selected-normal-background: @lightfg;
|
||||
selected-active-foreground: @background;
|
||||
selected-active-background: @blue;
|
||||
selected-urgent-foreground: @background;
|
||||
selected-urgent-background: @red;
|
||||
normal-foreground: @foreground;
|
||||
normal-background: @background;
|
||||
active-foreground: @blue;
|
||||
active-background: @background;
|
||||
urgent-foreground: @red;
|
||||
urgent-background: @background;
|
||||
alternate-normal-foreground: @foreground;
|
||||
alternate-normal-background: @lightbg;
|
||||
alternate-active-foreground: @blue;
|
||||
alternate-active-background: @lightbg;
|
||||
alternate-urgent-foreground: @red;
|
||||
alternate-urgent-background: @lightbg;
|
||||
spacing: 2;
|
||||
}
|
||||
window {
|
||||
background-color: @background;
|
||||
border: 1;
|
||||
padding: 5;
|
||||
}
|
||||
mainbox {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
message {
|
||||
border: 1px dash 0px 0px ;
|
||||
border-color: @separatorcolor;
|
||||
padding: 1px ;
|
||||
}
|
||||
textbox {
|
||||
text-color: @foreground;
|
||||
}
|
||||
listview {
|
||||
fixed-height: 0;
|
||||
border: 2px dash 0px 0px ;
|
||||
border-color: @separatorcolor;
|
||||
spacing: 2px ;
|
||||
scrollbar: true;
|
||||
padding: 2px 0px 0px ;
|
||||
}
|
||||
element {
|
||||
border: 0;
|
||||
padding: 1px ;
|
||||
}
|
||||
element normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
element normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
element normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
element selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
element selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
element selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
element alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
element alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
element alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
||||
scrollbar {
|
||||
width: 4px ;
|
||||
border: 0;
|
||||
handle-color: @normal-foreground;
|
||||
handle-width: 8px ;
|
||||
padding: 0;
|
||||
}
|
||||
sidebar {
|
||||
border: 2px dash 0px 0px ;
|
||||
border-color: @separatorcolor;
|
||||
}
|
||||
button {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
button selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
spacing: 0px;
|
||||
text-color: @normal-foreground;
|
||||
padding: 1px ;
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
}
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
prompt {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: ":";
|
||||
margin: 0px 0.3000em 0.0000em 0.0000em ;
|
||||
text-color: inherit;
|
||||
}
|
||||
''
|
@ -1,3 +1,4 @@
|
||||
inputs:
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
@ -11,17 +12,48 @@ let
|
||||
add = l: lib.foldr ({ n, x }: c: (x * (pow 16 n)) + c) 0 (lib.imap0 (n: x: { inherit n x; }) l);
|
||||
calc = s: add (builtins.map fin (builtins.filter (x: builtins.isString x && builtins.stringLength x == 1) (builtins.split "" s)));
|
||||
|
||||
hexToRgb = c:
|
||||
splitHex = c:
|
||||
let
|
||||
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
|
||||
ss = builtins.elemAt s';
|
||||
o = if ss 0 == null then 3 else 0;
|
||||
in
|
||||
builtins.mapAttrs (_: calc) {
|
||||
r = ss (0 + o);
|
||||
g = ss (1 + o);
|
||||
b = ss (2 + o);
|
||||
};
|
||||
in {
|
||||
r = ss (0 + o);
|
||||
g = ss (1 + o);
|
||||
b = ss (2 + o);
|
||||
};
|
||||
|
||||
hexToRgb = c: builtins.mapAttrs (_: calc) (splitHex c);
|
||||
|
||||
hexToAlphaCss = c: a: with hexToRgb c; "rgba(${r}, ${g}, ${b}, ${a})";
|
||||
|
||||
makeScheme = base16: lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex" v) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-r" (splitHex v).r) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-g" (splitHex v).g) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-b" (splitHex v).b) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-r" (hexToRgb v).r) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-g" (hexToRgb v).g) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-b" (hexToRgb v).b) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-r" ((hexToRgb v).r / 255.0)) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-g" ((hexToRgb v).g / 255.0)) base16 //
|
||||
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-b" ((hexToRgb v).b / 255.0)) base16;
|
||||
|
||||
mustache = scheme: name: src:
|
||||
pkgs.stdenv.mkDerivation (
|
||||
{
|
||||
name = lib.strings.sanitizeDerivationName name;
|
||||
inherit src;
|
||||
data = pkgs.writeText "${name}-data" (builtins.toJSON scheme);
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = "${pkgs.mustache-go}/bin/mustache $data $src > $out";
|
||||
}
|
||||
);
|
||||
|
||||
genTheme = repo: mustache (makeScheme cfg.base16 // {
|
||||
scheme-name = cfg.favColors.name;
|
||||
scheme-slug = "idk";
|
||||
scheme-author = "nixos";
|
||||
}) cfg.favColors.name "${repo}/templates/default.mustache";
|
||||
in
|
||||
{
|
||||
options.colors = {
|
||||
@ -29,7 +61,7 @@ in
|
||||
|
||||
i3BarColors = mkOption {
|
||||
description = "Exported color attrset for i3bar/swaybar";
|
||||
default = { };
|
||||
default = {};
|
||||
};
|
||||
|
||||
waybarCss = mkOption {
|
||||
@ -49,7 +81,7 @@ in
|
||||
|
||||
favColors = mkOption {
|
||||
description = "Your favourite color scheme";
|
||||
default = { };
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
@ -161,210 +193,192 @@ in
|
||||
showLabsSettings = true;
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
# Read only utility attributes
|
||||
colors.base16 = cfg.favColors.base16;
|
||||
colors.base16Rgb = builtins.map hexToRgb cfg.favColors.base16;
|
||||
mkIf cfg.enable {
|
||||
# Read only utility attributes
|
||||
colors.base16 = cfg.favColors.base16;
|
||||
colors.base16Rgb = builtins.mapAttrs hexToRgb cfg.favColors.base16;
|
||||
|
||||
# Element
|
||||
xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig;
|
||||
xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig;
|
||||
xdg.configFile."element_theme.json".text = builtins.toJSON elementTheme;
|
||||
# Element
|
||||
xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig;
|
||||
xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig;
|
||||
xdg.configFile."element_theme.json".text = builtins.toJSON elementTheme;
|
||||
|
||||
# Mako
|
||||
programs.mako = {
|
||||
backgroundColor = "#${cfg.favColors.base16.base00}";
|
||||
textColor = "#${cfg.favColors.base16.base07}";
|
||||
borderColor = "#${cfg.favColors.base16.base08}";
|
||||
progressColor = "over #${cfg.favColors.base16.base0D}";
|
||||
};
|
||||
|
||||
# I3/sway
|
||||
wayland.windowManager.sway = i3config;
|
||||
xsession.windowManager.i3 = i3config;
|
||||
colors.i3BarColors = {
|
||||
background = "#${cfg.favColors.base16.base00}";
|
||||
separator = "#${cfg.favColors.base16.base01}";
|
||||
statusline = "#${cfg.favColors.base16.base04}";
|
||||
|
||||
focusedWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base05}";
|
||||
background = "#${cfg.favColors.base16.base0D}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
# Mako
|
||||
programs.mako = {
|
||||
backgroundColor = "#${cfg.favColors.base16.base00}";
|
||||
textColor = "#${cfg.favColors.base16.base07}";
|
||||
borderColor = "#${cfg.favColors.base16.base08}";
|
||||
progressColor = "over #${cfg.favColors.base16.base0D}";
|
||||
};
|
||||
activeWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base05}";
|
||||
background = "#${cfg.favColors.base16.base03}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
inactiveWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base03}";
|
||||
background = "#${cfg.favColors.base16.base01}";
|
||||
text = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
urgentWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base08}";
|
||||
background = "#${cfg.favColors.base16.base08}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
bindingMode = {
|
||||
border = "#${cfg.favColors.base16.base00}";
|
||||
background = "#${cfg.favColors.base16.base0A}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
};
|
||||
|
||||
# Waybar
|
||||
colors.waybarCss =
|
||||
"\n" + (
|
||||
(import ../data/waybar-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.base16
|
||||
);
|
||||
# I3/sway
|
||||
wayland.windowManager.sway = i3config;
|
||||
xsession.windowManager.i3 = i3config;
|
||||
colors.i3BarColors = {
|
||||
background = "#${cfg.favColors.base16.base00}";
|
||||
separator = "#${cfg.favColors.base16.base01}";
|
||||
statusline = "#${cfg.favColors.base16.base04}";
|
||||
|
||||
# Dunst
|
||||
services.dunst = {
|
||||
settings = {
|
||||
global = {
|
||||
frame_color = "#${cfg.favColors.base16.base09}";
|
||||
separator_color = "#${cfg.favColors.base16.base05}";
|
||||
focusedWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base05}";
|
||||
background = "#${cfg.favColors.base16.base0D}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
|
||||
urgency_low = {
|
||||
activeWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base05}";
|
||||
background = "#${cfg.favColors.base16.base03}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
inactiveWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base03}";
|
||||
background = "#${cfg.favColors.base16.base01}";
|
||||
foreground = "#${cfg.favColors.base16.base03}";
|
||||
text = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
|
||||
urgency_normal = {
|
||||
background = "#${cfg.favColors.base16.base02}";
|
||||
foreground = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
|
||||
urgency_critical = {
|
||||
urgentWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base08}";
|
||||
background = "#${cfg.favColors.base16.base08}";
|
||||
foreground = "#${cfg.favColors.base16.base06}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
bindingMode = {
|
||||
border = "#${cfg.favColors.base16.base00}";
|
||||
background = "#${cfg.favColors.base16.base0A}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Rofi
|
||||
programs.rofi = {
|
||||
theme = (
|
||||
pkgs.writeText "rofi-base16-config"
|
||||
(
|
||||
(import ../data/rofi-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.favColors.base16
|
||||
)
|
||||
).outPath;
|
||||
};
|
||||
# Waybar
|
||||
colors.waybarCss =
|
||||
"\n" + (
|
||||
(import ../data/waybar-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.base16
|
||||
);
|
||||
|
||||
# Kitty
|
||||
programs.kitty.extraConfig =
|
||||
let
|
||||
kittyColors =
|
||||
pkgs.writeText
|
||||
"favcolors-kitty-${cfg.favColors.name}.conf"
|
||||
(
|
||||
(import ../data/kitty-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.favColors.base16
|
||||
);
|
||||
in
|
||||
''
|
||||
include ${kittyColors}
|
||||
# Dunst
|
||||
services.dunst = {
|
||||
settings = {
|
||||
global = {
|
||||
frame_color = "#${cfg.favColors.base16.base09}";
|
||||
separator_color = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
|
||||
urgency_low = {
|
||||
background = "#${cfg.favColors.base16.base01}";
|
||||
foreground = "#${cfg.favColors.base16.base03}";
|
||||
};
|
||||
|
||||
urgency_normal = {
|
||||
background = "#${cfg.favColors.base16.base02}";
|
||||
foreground = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
|
||||
urgency_critical = {
|
||||
background = "#${cfg.favColors.base16.base08}";
|
||||
foreground = "#${cfg.favColors.base16.base06}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Rofi
|
||||
programs.rofi.theme = "${genTheme inputs.base16-rofi}";
|
||||
|
||||
# Kitty
|
||||
programs.kitty.extraConfig = ''
|
||||
include ${genTheme inputs.base16-kitty}
|
||||
'';
|
||||
|
||||
# neovim
|
||||
xdg.configFile."nvim/colors/base16.vim".text = import ../data/vim-base16.nix cfg.favColors.name cfg.favColors.base16;
|
||||
programs.neovim.extraConfig = ''
|
||||
colorscheme base16
|
||||
set termguicolors
|
||||
'';
|
||||
# neovim
|
||||
xdg.configFile."nvim/colors/base16.vim".text = import ../data/vim-base16.nix cfg.favColors.name cfg.favColors.base16;
|
||||
programs.neovim.extraConfig = ''
|
||||
colorscheme base16
|
||||
set termguicolors
|
||||
'';
|
||||
|
||||
# GTK
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme =
|
||||
let
|
||||
materia_colors = pkgs.writeText "gtk-generated-colors" ''
|
||||
BG=${cfg.favColors.base16.base00}
|
||||
FG=${cfg.favColors.base16.base07}
|
||||
BTN_BG=${cfg.favColors.base16.base00}
|
||||
BTN_FG=${cfg.favColors.base16.base07}
|
||||
MENU_BG=${cfg.favColors.base16.base00}
|
||||
MENU_FG=${cfg.favColors.base16.base07}
|
||||
ACCENT_BG=${cfg.favColors.base16.base02}
|
||||
SEL_BG=${cfg.favColors.base16.base0D}
|
||||
SEL_FG=${cfg.favColors.base16.base00}
|
||||
TXT_BG=${cfg.favColors.base16.base00}
|
||||
TXT_FG=${cfg.favColors.base16.base07}
|
||||
HDR_BTN_BG=${cfg.favColors.base16.base00}
|
||||
HDR_BTN_FG=${cfg.favColors.base16.base07}
|
||||
WM_BORDER_FOCUS=${cfg.favColors.base16.base02}
|
||||
WM_BORDER_UNFOCUS=${cfg.favColors.base16.base01}
|
||||
MATERIA_STYLE_COMPACT=True
|
||||
MATERIA_COLOR_VARIANT=dark
|
||||
UNITY_DEFAULT_LAUNCHER_STYLE=False
|
||||
NAME=generated
|
||||
'';
|
||||
|
||||
generated-gtk-theme = pkgs.stdenv.mkDerivation {
|
||||
name = "generated-gtk-theme";
|
||||
src = pkgs.materia-theme.src;
|
||||
buildInputs = with pkgs; [ sassc bc which inkscape optipng ];
|
||||
installPhase = ''
|
||||
HOME=/build
|
||||
chmod 777 -R .
|
||||
patchShebangs .
|
||||
mkdir -p $out/share/themes
|
||||
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
|
||||
echo "Changing colours:"
|
||||
./change_color.sh -o Generated ${materia_colors}
|
||||
chmod 555 -R .
|
||||
# GTK
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme =
|
||||
let
|
||||
materia_colors = pkgs.writeText "gtk-generated-colors" ''
|
||||
BG=${cfg.favColors.base16.base00}
|
||||
FG=${cfg.favColors.base16.base07}
|
||||
BTN_BG=${cfg.favColors.base16.base00}
|
||||
BTN_FG=${cfg.favColors.base16.base07}
|
||||
MENU_BG=${cfg.favColors.base16.base00}
|
||||
MENU_FG=${cfg.favColors.base16.base07}
|
||||
ACCENT_BG=${cfg.favColors.base16.base02}
|
||||
SEL_BG=${cfg.favColors.base16.base0D}
|
||||
SEL_FG=${cfg.favColors.base16.base00}
|
||||
TXT_BG=${cfg.favColors.base16.base00}
|
||||
TXT_FG=${cfg.favColors.base16.base07}
|
||||
HDR_BTN_BG=${cfg.favColors.base16.base00}
|
||||
HDR_BTN_FG=${cfg.favColors.base16.base07}
|
||||
WM_BORDER_FOCUS=${cfg.favColors.base16.base02}
|
||||
WM_BORDER_UNFOCUS=${cfg.favColors.base16.base01}
|
||||
MATERIA_STYLE_COMPACT=True
|
||||
MATERIA_COLOR_VARIANT=dark
|
||||
UNITY_DEFAULT_LAUNCHER_STYLE=False
|
||||
NAME=generated
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
name = "Generated";
|
||||
package = generated-gtk-theme;
|
||||
};
|
||||
gtk2.extraConfig = (
|
||||
(import ../data/gtk2-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.favColors.base16
|
||||
);
|
||||
};
|
||||
|
||||
# Codium/VSCODE
|
||||
programs.vscode.userSettings = {
|
||||
"workbench.colorTheme" = "nix colors";
|
||||
};
|
||||
|
||||
home.file = lib.mkMerge
|
||||
[
|
||||
(mkIf config.programs.vscode.enable {
|
||||
".vscode-oss/extensions/base16-1.0.0/themes/nix-colors.json".text = (import ../data/codium-base16.nix) cfg.favColors.name cfg.favColors.base16;
|
||||
".vscode-oss/extensions/base16-1.0.0/package.json".text = builtins.toJSON {
|
||||
name = "nix colors";
|
||||
displayName = "Automatic Nix-generated base16 colors";
|
||||
version = "1.0.0";
|
||||
publisher = "colors";
|
||||
author = {
|
||||
name = "ezpc usr";
|
||||
email = "usr@ezpc";
|
||||
generated-gtk-theme = pkgs.stdenv.mkDerivation {
|
||||
name = "generated-gtk-theme";
|
||||
src = pkgs.materia-theme.src;
|
||||
buildInputs = with pkgs; [ sassc bc which inkscape optipng ];
|
||||
installPhase = ''
|
||||
HOME=/build
|
||||
chmod 777 -R .
|
||||
patchShebangs .
|
||||
mkdir -p $out/share/themes
|
||||
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
|
||||
echo "Changing colours:"
|
||||
./change_color.sh -o Generated ${materia_colors}
|
||||
chmod 555 -R .
|
||||
'';
|
||||
};
|
||||
engines.vscode = "^1.11.1";
|
||||
categories = "Themes";
|
||||
contributes.themes = [
|
||||
{
|
||||
label = "nix colors";
|
||||
uiTheme = "vs-dark";
|
||||
path = "./themes/nix-colors.json";
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
name = "Generated";
|
||||
package = generated-gtk-theme;
|
||||
};
|
||||
gtk2.extraConfig = (
|
||||
(import ../data/gtk2-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.favColors.base16
|
||||
);
|
||||
};
|
||||
|
||||
# Codium/VSCODE
|
||||
programs.vscode.userSettings = {
|
||||
"workbench.colorTheme" = "nix colors";
|
||||
};
|
||||
|
||||
home.file = lib.mkMerge
|
||||
[
|
||||
(
|
||||
mkIf config.programs.vscode.enable {
|
||||
".vscode-oss/extensions/base16-1.0.0/themes/nix-colors.json".text = (import ../data/codium-base16.nix) cfg.favColors.name cfg.favColors.base16;
|
||||
".vscode-oss/extensions/base16-1.0.0/package.json".text = builtins.toJSON {
|
||||
name = "nix colors";
|
||||
displayName = "Automatic Nix-generated base16 colors";
|
||||
version = "1.0.0";
|
||||
publisher = "colors";
|
||||
author = {
|
||||
name = "ezpc usr";
|
||||
email = "usr@ezpc";
|
||||
};
|
||||
engines.vscode = "^1.11.1";
|
||||
categories = "Themes";
|
||||
contributes.themes = [
|
||||
{
|
||||
label = "nix colors";
|
||||
uiTheme = "vs-dark";
|
||||
path = "./themes/nix-colors.json";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
inputs:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
@ -9,7 +10,7 @@
|
||||
./ezpcusr.nix
|
||||
./ezchromium.nix
|
||||
./ezcodium.nix
|
||||
./colors.nix
|
||||
(import ./colors.nix inputs)
|
||||
./fonts.nix
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user