mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
Migrate to centralised SASS templating, remove headers
This commit is contained in:
parent
68594e6282
commit
a1e69ae88d
16 changed files with 41 additions and 198 deletions
|
|
@ -35,6 +35,14 @@ let cfg = config.kw.theme; in
|
|||
default = "${toString (cfg.font.size + 3)}px";
|
||||
};
|
||||
};
|
||||
variables = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = (cfg.base16 // {
|
||||
font = cfg.font.name;
|
||||
font_size = cfg.font.size_css;
|
||||
inherit (cfg) alpha;
|
||||
});
|
||||
};
|
||||
};
|
||||
config = mkIf (cfg.enable) {
|
||||
kw.theme = {
|
||||
|
|
@ -43,19 +51,22 @@ let cfg = config.kw.theme; in
|
|||
alpha = "80";
|
||||
};
|
||||
|
||||
lib.kw.sassTemplate = pkgs.callPackage ({ sass, stdenv }: { name, src }: stdenv.mkDerivation ({
|
||||
inherit name src;
|
||||
nativeBuildInputs = lib.singleton sass;
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = ''
|
||||
substituteAll $src sub.sass
|
||||
sass sub.sass $out --sourcemap=none --style=${cfg.css_style}
|
||||
lib.kw.sassTemplate = { name, src }: let
|
||||
variables = pkgs.writeText "base-variables.sass" ''
|
||||
${(concatStringsSep "\n" (mapAttrsToList(var: con: "\$${var}: ${con}") cfg.variables))}
|
||||
'';
|
||||
} // cfg.base16 // {
|
||||
font = cfg.font.name;
|
||||
font_size = cfg.font.size_css;
|
||||
inherit (cfg) alpha;
|
||||
})) {};
|
||||
source = pkgs.callPackage ({ sass, stdenv }: stdenv.mkDerivation ({
|
||||
inherit name src variables;
|
||||
nativeBuildInputs = lib.singleton sass;
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = ''
|
||||
cat $variables $src > src-mut.sass
|
||||
sass src-mut.sass $out --sourcemap=none --style=${cfg.css_style}
|
||||
'';
|
||||
} // cfg.variables)) {}; in {
|
||||
inherit source;
|
||||
text = builtins.readFile source;
|
||||
};
|
||||
_module.args = { inherit (config.lib) kw; };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./firefox.nix ./packages.nix ./gtk.nix ./foot.nix ./xdg.nix ./ranger.nix ./fonts.nix ./qt.nix ];
|
||||
imports = [ ./firefox ./packages.nix ./gtk.nix ./foot.nix ./xdg.nix ./ranger.nix ./fonts.nix ./qt.nix ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, nixos, ... }:
|
||||
{ config, lib, pkgs, nixos, kw, ... }:
|
||||
|
||||
let
|
||||
commonSettings = {
|
||||
|
|
@ -13,7 +13,7 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
home.file.".mozilla/tst.css".source = pkgs.firefox-tst { inherit (config.kw.theme) base16; };
|
||||
home.file.".mozilla/tst.css" = { inherit (kw.sassTemplate { name = "tst"; src = ./tst.sass; }) source; };
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
ff-pm = "firefox --ProfileManager";
|
||||
|
|
@ -65,7 +65,7 @@ in
|
|||
id = 0;
|
||||
isDefault = true;
|
||||
settings = commonSettings;
|
||||
userChrome = builtins.readFile (pkgs.firefox-uc { inherit (config.kw.theme) base16; });
|
||||
userChrome = (kw.sassTemplate { name = "userChrome"; src = ./userChrome.sass; }).text;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -1,24 +1,5 @@
|
|||
$base00: @base00@
|
||||
$base01: @base01@
|
||||
$base02: @base02@
|
||||
$base03: @base03@
|
||||
$base04: @base04@
|
||||
$base05: @base05@
|
||||
$base06: @base06@
|
||||
$base07: @base07@
|
||||
$base08: @base08@
|
||||
$base09: @base09@
|
||||
$base0A: @base0A@
|
||||
$base0B: @base0B@
|
||||
$base0C: @base0C@
|
||||
$base0D: @base0D@
|
||||
$base0E: @base0E@
|
||||
$base0F: @base0F@
|
||||
$font_0: "Cozette"
|
||||
$font_1: "monospace !important"
|
||||
|
||||
*
|
||||
font-family: $font_0, $font_1
|
||||
font-family: $font !important
|
||||
|
||||
#tabbar
|
||||
margin-top: calc(var(--pinned-tabs-area-size) - .15em)
|
||||
|
|
@ -1,22 +1,3 @@
|
|||
$base00: @base00@
|
||||
$base01: @base01@
|
||||
$base02: @base02@
|
||||
$base03: @base03@
|
||||
$base04: @base04@
|
||||
$base05: @base05@
|
||||
$base06: @base06@
|
||||
$base07: @base07@
|
||||
$base08: @base08@
|
||||
$base09: @base09@
|
||||
$base0A: @base0A@
|
||||
$base0B: @base0B@
|
||||
$base0C: @base0C@
|
||||
$base0D: @base0D@
|
||||
$base0E: @base0E@
|
||||
$base0F: @base0F@
|
||||
$font_0: "Cozette"
|
||||
$font_1: "monospace !important"
|
||||
|
||||
$animations: "toolbarbutton", ".toolbarbutton-icon", ".subviewbutton", "#urlbar-background", ".urlbar-icon", "#userContext-indicator", "#userContext-label", ".urlbar-input-box", "#identity-box", "#tracking-protection-icon-container", "[anonid=urlbar-go-button]", ".urlbar-icon-wrapper", "#tracking-protection-icon", "#identity-box image", "stack", "vbox", "tab:not(:active) .tab-background", "tab:not([beforeselected-visible])::after", "tab[visuallyselected] .tab-background::before", "tab[visuallyselected] .tab-background::before", ".tab-close-button"
|
||||
$base00_backgrounds: "#nav-bar", "toolbar-menubar", "#menubar-items", "#main-menubar"
|
||||
$extendables: ".urlbar-icon", "#userContext-indicator", "#userContext-label"
|
||||
|
|
@ -34,7 +15,7 @@ $extendables: ".urlbar-icon", "#userContext-indicator", "#userContext-label"
|
|||
--animationSpeed: 0.15s
|
||||
|
||||
*
|
||||
font-family: $font_0, $font_1
|
||||
font-family: $font !important
|
||||
|
||||
#TabsToolbar
|
||||
visibility: collapse
|
||||
|
|
@ -62,7 +43,7 @@ $extendables: ".urlbar-icon", "#userContext-indicator", "#userContext-label"
|
|||
|
||||
&:not(:hover):not([breakout][breakout-extend]) > #urlbar-background
|
||||
box-shadow: none !important
|
||||
background: @base01@ !important
|
||||
background: $base01 !important
|
||||
|
||||
&:hover .urlbar-icon
|
||||
fill: var(--toolbar-color) !important
|
||||
|
|
@ -72,10 +53,10 @@ $extendables: ".urlbar-icon", "#userContext-indicator", "#userContext-label"
|
|||
|
||||
@each $selector in $base00_backgrounds
|
||||
#{$selector}
|
||||
background: @base00@ !important
|
||||
background: $base00 !important
|
||||
|
||||
#urlbar-background
|
||||
background: @base01@ !important
|
||||
background: $base01 !important
|
||||
|
||||
#star-button
|
||||
display: none
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
{
|
||||
imports = [
|
||||
./xkb.nix
|
||||
./waybar.nix
|
||||
./wofi.nix
|
||||
./waybar
|
||||
./wofi
|
||||
./mako.nix
|
||||
./sway.nix
|
||||
./gammastep.nix
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, kw, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."waybar/style.css".source = pkgs.waybar-style { inherit (config.kw.theme) base16; };
|
||||
xdg.configFile."waybar/style.css" = { inherit (kw.sassTemplate { name = "waybar-style"; src = ./waybar.sass; }) source; };
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
|
|
@ -1,23 +1,3 @@
|
|||
$base00: @base00@
|
||||
$base01: @base01@
|
||||
$base02: @base02@
|
||||
$base03: @base03@
|
||||
$base04: @base04@
|
||||
$base05: @base05@
|
||||
$base06: @base06@
|
||||
$base07: @base07@
|
||||
$base08: @base08@
|
||||
$base09: @base09@
|
||||
$base0A: @base0A@
|
||||
$base0B: @base0B@
|
||||
$base0C: @base0C@
|
||||
$base0D: @base0D@
|
||||
$base0E: @base0E@
|
||||
$base0F: @base0F@
|
||||
$alpha: @alpha@
|
||||
$font: "Cozette"
|
||||
$font_size: 12px
|
||||
|
||||
%extend_1
|
||||
padding: 0 8px
|
||||
transition: none
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."wofi/wofi.css".source = pkgs.wofi-style { inherit (config.kw.theme) base16; };
|
||||
}
|
||||
5
config/users/kat/sway/wofi/default.nix
Normal file
5
config/users/kat/sway/wofi/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, kw, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."wofi/wofi.css" = { inherit (kw.sassTemplate { name = "wofi-style"; src = ./wofi.sass; }) source; };
|
||||
}
|
||||
|
|
@ -1,23 +1,3 @@
|
|||
$base00: @base00@
|
||||
$base01: @base01@
|
||||
$base02: @base02@
|
||||
$base03: @base03@
|
||||
$base04: @base04@
|
||||
$base05: @base05@
|
||||
$base06: @base06@
|
||||
$base07: @base07@
|
||||
$base08: @base08@
|
||||
$base09: @base09@
|
||||
$base0A: @base0A@
|
||||
$base0B: @base0B@
|
||||
$base0C: @base0C@
|
||||
$base0D: @base0D@
|
||||
$base0E: @base0E@
|
||||
$base0F: @base0F@
|
||||
$alpha: @alpha@
|
||||
$font: "Cozette"
|
||||
$font_size: 12px
|
||||
|
||||
#scroll
|
||||
background: $base01
|
||||
border: 1px solid $base03
|
||||
|
|
@ -6,10 +6,6 @@ let
|
|||
(import ./nur { inherit sources; })
|
||||
(import sources.emacs-overlay)
|
||||
(import ./rustfmt)
|
||||
(import ./ff-tst-style)
|
||||
(import ./ff-uc-style)
|
||||
(import ./waybar-style)
|
||||
(import ./wofi-style)
|
||||
/* # TODO: implement these
|
||||
(import ./vimrc)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
final: prev: {
|
||||
firefox-tst = final.callPackage ({ stdenv, sass }: { base16 }:
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
pname = "ff-tst-style";
|
||||
version = "0.0.1";
|
||||
|
||||
phases = [ "buildPhase" ];
|
||||
|
||||
src = ./tst.sass;
|
||||
|
||||
nativeBuildInputs = [
|
||||
sass
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
substituteAll $src tst-sub.sass
|
||||
sass tst-sub.sass $out --sourcemap=none --style expanded
|
||||
'';
|
||||
} // base16)) {};
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
final: prev: {
|
||||
firefox-uc = final.callPackage ({ stdenv, sass }: { base16 }:
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
pname = "ff-uc-style";
|
||||
version = "0.0.1";
|
||||
|
||||
phases = [ "buildPhase" ];
|
||||
|
||||
src = ./userChrome.sass;
|
||||
|
||||
nativeBuildInputs = [
|
||||
sass
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
substituteAll $src userChrome-sub.sass
|
||||
sass userChrome-sub.sass $out --sourcemap=none --style expanded
|
||||
'';
|
||||
} // base16)) {};
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
final: prev: {
|
||||
waybar-style = final.callPackage ({ stdenv, sass }: { base16 }:
|
||||
stdenv.mkDerivation ({
|
||||
pname = "waybar-style";
|
||||
version = "0.0.1";
|
||||
|
||||
phases = [ "buildPhase" ];
|
||||
|
||||
src = ./waybar.sass;
|
||||
|
||||
nativeBuildInputs = [
|
||||
sass
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
substituteAll $src waybar-sub.sass
|
||||
sass waybar-sub.sass $out --sourcemap=none --style expanded
|
||||
'';
|
||||
|
||||
alpha = "80";
|
||||
} // base16)) {};
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
final: prev: {
|
||||
wofi-style = final.callPackage ({ stdenv, sass }: { base16 }:
|
||||
stdenv.mkDerivation ({
|
||||
pname = "wofi-style";
|
||||
version = "0.0.1";
|
||||
|
||||
phases = [ "buildPhase" ];
|
||||
|
||||
src = ./wofi.sass;
|
||||
|
||||
nativeBuildInputs = [
|
||||
sass
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
substituteAll $src wofi-sub.sass
|
||||
sass wofi-sub.sass $out --sourcemap=none --style expanded
|
||||
'';
|
||||
|
||||
alpha = "80";
|
||||
} // base16)) {};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue