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 = {
|
nixosModules = {
|
||||||
ezpassthru = import ./modules/ezpassthru.nix;
|
ezpassthru = import ./modules/ezpassthru.nix;
|
||||||
ezpc = import ./modules/ezpc.nix;
|
ezpc = import ./modules/ezpc.nix;
|
||||||
@ -13,7 +24,11 @@
|
|||||||
|
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
ezpcusr = import ./home-manager/modules/ezpcusr.nix;
|
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
|
# Not really modules? but eh
|
||||||
@ -22,7 +37,7 @@
|
|||||||
nixosModules.common-glooder = import ./users/glooder.nix;
|
nixosModules.common-glooder = import ./users/glooder.nix;
|
||||||
nixosModules.common-chekkie = import ./users/chekkie.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 = import ./home-manager/users/notgne2.nix;
|
||||||
homeManagerModules.common-notgne2_pc = import ./home-manager/users/notgne2_pc.nix;
|
homeManagerModules.common-notgne2_pc = import ./home-manager/users/notgne2_pc.nix;
|
||||||
homeManagerModules.common-glooder = import ./home-manager/users/glooder.nix;
|
homeManagerModules.common-glooder = import ./home-manager/users/glooder.nix;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
inputs:
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ./modules ];
|
imports = [ (import ./modules inputs) ];
|
||||||
|
|
||||||
programs.vim = {
|
programs.vim = {
|
||||||
enable = true;
|
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, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
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);
|
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)));
|
calc = s: add (builtins.map fin (builtins.filter (x: builtins.isString x && builtins.stringLength x == 1) (builtins.split "" s)));
|
||||||
|
|
||||||
hexToRgb = c:
|
splitHex = c:
|
||||||
let
|
let
|
||||||
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
|
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
|
||||||
ss = builtins.elemAt s';
|
ss = builtins.elemAt s';
|
||||||
o = if ss 0 == null then 3 else 0;
|
o = if ss 0 == null then 3 else 0;
|
||||||
in
|
in {
|
||||||
builtins.mapAttrs (_: calc) {
|
r = ss (0 + o);
|
||||||
r = ss (0 + o);
|
g = ss (1 + o);
|
||||||
g = ss (1 + o);
|
b = ss (2 + 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
|
in
|
||||||
{
|
{
|
||||||
options.colors = {
|
options.colors = {
|
||||||
@ -29,7 +61,7 @@ in
|
|||||||
|
|
||||||
i3BarColors = mkOption {
|
i3BarColors = mkOption {
|
||||||
description = "Exported color attrset for i3bar/swaybar";
|
description = "Exported color attrset for i3bar/swaybar";
|
||||||
default = { };
|
default = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
waybarCss = mkOption {
|
waybarCss = mkOption {
|
||||||
@ -49,7 +81,7 @@ in
|
|||||||
|
|
||||||
favColors = mkOption {
|
favColors = mkOption {
|
||||||
description = "Your favourite color scheme";
|
description = "Your favourite color scheme";
|
||||||
default = { };
|
default = {};
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
@ -161,210 +193,192 @@ in
|
|||||||
showLabsSettings = true;
|
showLabsSettings = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
# Read only utility attributes
|
# Read only utility attributes
|
||||||
colors.base16 = cfg.favColors.base16;
|
colors.base16 = cfg.favColors.base16;
|
||||||
colors.base16Rgb = builtins.map hexToRgb cfg.favColors.base16;
|
colors.base16Rgb = builtins.mapAttrs hexToRgb cfg.favColors.base16;
|
||||||
|
|
||||||
# Element
|
# Element
|
||||||
xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig;
|
xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig;
|
||||||
xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig;
|
xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig;
|
||||||
xdg.configFile."element_theme.json".text = builtins.toJSON elementTheme;
|
xdg.configFile."element_theme.json".text = builtins.toJSON elementTheme;
|
||||||
|
|
||||||
# Mako
|
# Mako
|
||||||
programs.mako = {
|
programs.mako = {
|
||||||
backgroundColor = "#${cfg.favColors.base16.base00}";
|
backgroundColor = "#${cfg.favColors.base16.base00}";
|
||||||
textColor = "#${cfg.favColors.base16.base07}";
|
textColor = "#${cfg.favColors.base16.base07}";
|
||||||
borderColor = "#${cfg.favColors.base16.base08}";
|
borderColor = "#${cfg.favColors.base16.base08}";
|
||||||
progressColor = "over #${cfg.favColors.base16.base0D}";
|
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}";
|
|
||||||
};
|
};
|
||||||
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
|
# I3/sway
|
||||||
colors.waybarCss =
|
wayland.windowManager.sway = i3config;
|
||||||
"\n" + (
|
xsession.windowManager.i3 = i3config;
|
||||||
(import ../data/waybar-base16.nix)
|
colors.i3BarColors = {
|
||||||
cfg.favColors.name
|
background = "#${cfg.favColors.base16.base00}";
|
||||||
cfg.base16
|
separator = "#${cfg.favColors.base16.base01}";
|
||||||
);
|
statusline = "#${cfg.favColors.base16.base04}";
|
||||||
|
|
||||||
# Dunst
|
focusedWorkspace = {
|
||||||
services.dunst = {
|
border = "#${cfg.favColors.base16.base05}";
|
||||||
settings = {
|
background = "#${cfg.favColors.base16.base0D}";
|
||||||
global = {
|
text = "#${cfg.favColors.base16.base00}";
|
||||||
frame_color = "#${cfg.favColors.base16.base09}";
|
|
||||||
separator_color = "#${cfg.favColors.base16.base05}";
|
|
||||||
};
|
};
|
||||||
|
activeWorkspace = {
|
||||||
urgency_low = {
|
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}";
|
background = "#${cfg.favColors.base16.base01}";
|
||||||
foreground = "#${cfg.favColors.base16.base03}";
|
text = "#${cfg.favColors.base16.base05}";
|
||||||
};
|
};
|
||||||
|
urgentWorkspace = {
|
||||||
urgency_normal = {
|
border = "#${cfg.favColors.base16.base08}";
|
||||||
background = "#${cfg.favColors.base16.base02}";
|
|
||||||
foreground = "#${cfg.favColors.base16.base05}";
|
|
||||||
};
|
|
||||||
|
|
||||||
urgency_critical = {
|
|
||||||
background = "#${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
|
# Waybar
|
||||||
programs.rofi = {
|
colors.waybarCss =
|
||||||
theme = (
|
"\n" + (
|
||||||
pkgs.writeText "rofi-base16-config"
|
(import ../data/waybar-base16.nix)
|
||||||
(
|
cfg.favColors.name
|
||||||
(import ../data/rofi-base16.nix)
|
cfg.base16
|
||||||
cfg.favColors.name
|
);
|
||||||
cfg.favColors.base16
|
|
||||||
)
|
|
||||||
).outPath;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Kitty
|
# Dunst
|
||||||
programs.kitty.extraConfig =
|
services.dunst = {
|
||||||
let
|
settings = {
|
||||||
kittyColors =
|
global = {
|
||||||
pkgs.writeText
|
frame_color = "#${cfg.favColors.base16.base09}";
|
||||||
"favcolors-kitty-${cfg.favColors.name}.conf"
|
separator_color = "#${cfg.favColors.base16.base05}";
|
||||||
(
|
};
|
||||||
(import ../data/kitty-base16.nix)
|
|
||||||
cfg.favColors.name
|
urgency_low = {
|
||||||
cfg.favColors.base16
|
background = "#${cfg.favColors.base16.base01}";
|
||||||
);
|
foreground = "#${cfg.favColors.base16.base03}";
|
||||||
in
|
};
|
||||||
''
|
|
||||||
include ${kittyColors}
|
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
|
# neovim
|
||||||
xdg.configFile."nvim/colors/base16.vim".text = import ../data/vim-base16.nix cfg.favColors.name cfg.favColors.base16;
|
xdg.configFile."nvim/colors/base16.vim".text = import ../data/vim-base16.nix cfg.favColors.name cfg.favColors.base16;
|
||||||
programs.neovim.extraConfig = ''
|
programs.neovim.extraConfig = ''
|
||||||
colorscheme base16
|
colorscheme base16
|
||||||
set termguicolors
|
set termguicolors
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# GTK
|
# GTK
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
theme =
|
theme =
|
||||||
let
|
let
|
||||||
materia_colors = pkgs.writeText "gtk-generated-colors" ''
|
materia_colors = pkgs.writeText "gtk-generated-colors" ''
|
||||||
BG=${cfg.favColors.base16.base00}
|
BG=${cfg.favColors.base16.base00}
|
||||||
FG=${cfg.favColors.base16.base07}
|
FG=${cfg.favColors.base16.base07}
|
||||||
BTN_BG=${cfg.favColors.base16.base00}
|
BTN_BG=${cfg.favColors.base16.base00}
|
||||||
BTN_FG=${cfg.favColors.base16.base07}
|
BTN_FG=${cfg.favColors.base16.base07}
|
||||||
MENU_BG=${cfg.favColors.base16.base00}
|
MENU_BG=${cfg.favColors.base16.base00}
|
||||||
MENU_FG=${cfg.favColors.base16.base07}
|
MENU_FG=${cfg.favColors.base16.base07}
|
||||||
ACCENT_BG=${cfg.favColors.base16.base02}
|
ACCENT_BG=${cfg.favColors.base16.base02}
|
||||||
SEL_BG=${cfg.favColors.base16.base0D}
|
SEL_BG=${cfg.favColors.base16.base0D}
|
||||||
SEL_FG=${cfg.favColors.base16.base00}
|
SEL_FG=${cfg.favColors.base16.base00}
|
||||||
TXT_BG=${cfg.favColors.base16.base00}
|
TXT_BG=${cfg.favColors.base16.base00}
|
||||||
TXT_FG=${cfg.favColors.base16.base07}
|
TXT_FG=${cfg.favColors.base16.base07}
|
||||||
HDR_BTN_BG=${cfg.favColors.base16.base00}
|
HDR_BTN_BG=${cfg.favColors.base16.base00}
|
||||||
HDR_BTN_FG=${cfg.favColors.base16.base07}
|
HDR_BTN_FG=${cfg.favColors.base16.base07}
|
||||||
WM_BORDER_FOCUS=${cfg.favColors.base16.base02}
|
WM_BORDER_FOCUS=${cfg.favColors.base16.base02}
|
||||||
WM_BORDER_UNFOCUS=${cfg.favColors.base16.base01}
|
WM_BORDER_UNFOCUS=${cfg.favColors.base16.base01}
|
||||||
MATERIA_STYLE_COMPACT=True
|
MATERIA_STYLE_COMPACT=True
|
||||||
MATERIA_COLOR_VARIANT=dark
|
MATERIA_COLOR_VARIANT=dark
|
||||||
UNITY_DEFAULT_LAUNCHER_STYLE=False
|
UNITY_DEFAULT_LAUNCHER_STYLE=False
|
||||||
NAME=generated
|
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 .
|
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
name = "Generated";
|
|
||||||
package = generated-gtk-theme;
|
|
||||||
};
|
|
||||||
gtk2.extraConfig = (
|
|
||||||
(import ../data/gtk2-base16.nix)
|
|
||||||
cfg.favColors.name
|
|
||||||
cfg.favColors.base16
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
# Codium/VSCODE
|
generated-gtk-theme = pkgs.stdenv.mkDerivation {
|
||||||
programs.vscode.userSettings = {
|
name = "generated-gtk-theme";
|
||||||
"workbench.colorTheme" = "nix colors";
|
src = pkgs.materia-theme.src;
|
||||||
};
|
buildInputs = with pkgs; [ sassc bc which inkscape optipng ];
|
||||||
|
installPhase = ''
|
||||||
home.file = lib.mkMerge
|
HOME=/build
|
||||||
[
|
chmod 777 -R .
|
||||||
(mkIf config.programs.vscode.enable {
|
patchShebangs .
|
||||||
".vscode-oss/extensions/base16-1.0.0/themes/nix-colors.json".text = (import ../data/codium-base16.nix) cfg.favColors.name cfg.favColors.base16;
|
mkdir -p $out/share/themes
|
||||||
".vscode-oss/extensions/base16-1.0.0/package.json".text = builtins.toJSON {
|
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
|
||||||
name = "nix colors";
|
echo "Changing colours:"
|
||||||
displayName = "Automatic Nix-generated base16 colors";
|
./change_color.sh -o Generated ${materia_colors}
|
||||||
version = "1.0.0";
|
chmod 555 -R .
|
||||||
publisher = "colors";
|
'';
|
||||||
author = {
|
|
||||||
name = "ezpc usr";
|
|
||||||
email = "usr@ezpc";
|
|
||||||
};
|
};
|
||||||
engines.vscode = "^1.11.1";
|
in
|
||||||
categories = "Themes";
|
{
|
||||||
contributes.themes = [
|
name = "Generated";
|
||||||
{
|
package = generated-gtk-theme;
|
||||||
label = "nix colors";
|
};
|
||||||
uiTheme = "vs-dark";
|
gtk2.extraConfig = (
|
||||||
path = "./themes/nix-colors.json";
|
(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, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -9,7 +10,7 @@
|
|||||||
./ezpcusr.nix
|
./ezpcusr.nix
|
||||||
./ezchromium.nix
|
./ezchromium.nix
|
||||||
./ezcodium.nix
|
./ezcodium.nix
|
||||||
./colors.nix
|
(import ./colors.nix inputs)
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user