restructure config

This commit is contained in:
atagen 2023-09-28 16:33:39 +10:00
parent 1c6a1a4305
commit ef0c9157f4
46 changed files with 656 additions and 716 deletions

65
util/gtk-theme.nix Normal file
View file

@ -0,0 +1,65 @@
{pkgs}: {palette}: let
rendersvg = pkgs.runCommand "rendersvg" {} ''
mkdir -p $out/bin
ln -s ${pkgs.resvg}/bin/resvg $out/bin/rendersvg
'';
in
pkgs.stdenv.mkDerivation rec {
name = "generated-gtk-theme-nix-rice";
src = pkgs.fetchFromGitHub {
owner = "nana-4";
repo = "materia-theme";
rev = "76cac96ca7fe45dc9e5b9822b0fbb5f4cad47984";
sha256 = "sha256-0eCAfm/MWXv6BbCl2vbVbvgv8DiUH09TAUhoKq7Ow0k=";
};
buildInputs = with pkgs; [
sassc
bc
which
rendersvg
meson
ninja
nodePackages.sass
gtk4.dev
optipng
];
phases = ["unpackPhase" "installPhase"];
installPhase = ''
HOME=/build
chmod 777 -R .
patchShebangs .
mkdir -p $out/share/themes
mkdir bin
sed -e 's/handle-horz-.*//' -e 's/handle-vert-.*//' -i ./src/gtk-2.0/assets.txt
cat > /build/gtk-colors << EOF
BTN_BG=${palette.util.bg}
BTN_FG=${palette.bright.yellow}
FG=${palette.util.fg}
BG=${palette.util.bg}
HDR_BTN_BG=${palette.util.bg}
HDR_BTN_FG=${palette.util.fg}
ACCENT_BG=${palette.normal.cyan}
ACCENT_FG=${palette.normal.yellow}
HDR_FG=${palette.bright.yellow}
HDR_BG=${palette.util.bg}
MATERIA_SURFACE=${palette.normal.black}
MATERIA_VIEW=${palette.bright.black}
MENU_BG=${palette.util.bg}
MENU_FG=${palette.util.fg}
SEL_BG=${palette.normal.yellow}
SEL_FG=${palette.normal.cyan}
TXT_BG=${palette.util.bg}
TXT_FG=${palette.util.fg}
WM_BORDER_FOCUS=${palette.normal.yellow}
WM_BORDER_UNFOCUS=${palette.normal.black}
UNITY_DEFAULT_LAUNCHER_STYLE=False
NAME="nix-rice"
MATERIA_STYLE_COMPACT=False
EOF
echo "Changing colours:"
./change_color.sh -o nix-rice /build/gtk-colors -i False -t "$out/share/themes"
chmod 555 -R .
'';
}

15
util/overlay.nix Normal file
View file

@ -0,0 +1,15 @@
{inputs, ...}: {
additions = final: _prev: import ../.old/pkgs {pkgs = final;};
pkg-sets = final: prev: {
unstable = import inputs.nixpkgs {
system = final.system;
config.allowUnfree = true;
};
stable = import inputs.nixpkgs-stable {
system = final.system;
config.allowUnfree = true;
};
};
rice = import ./rice.nix;
}

32
util/pal.conf Normal file
View file

@ -0,0 +1,32 @@
background #1b2021
foreground #cecbca
color0 #272a2a
color8 #202e2f
color1 #c43325
color9 #c46056
color2 #8cc992
color10 #c2dab0
color3 #ffb852
color11 #ffab5b
color4 #5299ff
color12 #92beff
color5 #645ac9
color13 #928cc9
color6 #5abfc9
color14 #8cc4c9
color7 #b0c2da
color15 #caccce
selection_background #202e2f
selection_foreground #5299ff
cursor #caccce
cursor_text_color #5299ff

107
util/rice.nix Normal file
View file

@ -0,0 +1,107 @@
final: prev:
with prev.lib.nix-rice; let
# theme = kitty-themes.parseTheme ./op.pal;
theme = kitty-themes.parseTheme ./pal.conf;
# theme = kitty-themes.getThemeByName "everforest_dark_hard";
in rec {
rice = {
palette =
rec {
normal =
palette.defaultPalette
// {
black = theme.color0;
red = theme.color1;
green = theme.color2;
yellow = theme.color3;
blue = theme.color4;
magenta = theme.color5;
cyan = theme.color6;
white = theme.color7;
};
bright =
palette.defaultPalette
// {
black = theme.color8;
red = theme.color9;
green = theme.color10;
yellow = theme.color11;
blue = theme.color12;
magenta = theme.color13;
cyan = theme.color14;
white = theme.color15;
};
util =
palette.defaultPalette
// {
fg = theme.foreground;
bg = theme.background;
fg_sel = theme.selection_foreground;
bg_sel = theme.selection_background;
cursor = theme.cursor;
# url = theme.url_color;
};
}
// theme;
fonts = rec {
sans = {
name = "Inria Sans";
size = 12;
package = final.inriafonts;
};
serif = {
name = "Inria Serif";
size = 12;
package = final.inriafonts;
};
monospace = {
name = "Fira Code";
size = 10;
package = final.fira-code;
};
emoji = {
name = "Twitter Color Emoji";
size = 12;
package = final.twemoji-color-font;
};
pkgs = with final; [
sans.package
serif.package
monospace.package
emoji.package
meslo-lgs-nf
];
};
icons = rec {
name = "Papirus-Dark";
package = final.papirus-icon-theme;
pkgs = with final; [
package
# material-icons
# material-design-icons
];
};
gtk-theme = {
name = "nix-rice";
package = prev.callPackage ./gtk-theme.nix {} {palette = palette.toRGBShortHex final.rice.palette;};
};
borders = {
thickness = 2;
rounding = 0;
gaps_in = 6;
gaps_out = 6;
};
bg = {
image = builtins.path {
name = "wallpaper";
path = ./wallpaper.png;
sha256 = "a98b32664ab456d088225a19c0fc7e672a8fccd6a30129fdb2ff11d25e766b17";
};
};
}; # /rice
}