linted
This commit is contained in:
atagen 2025-02-02 16:57:31 +11:00
parent 4e99a0e323
commit 7485de646a
95 changed files with 2743 additions and 2282 deletions

View file

@ -3,16 +3,19 @@
home-manager,
system,
inputs,
outputs,
self,
sharedModules,
...
}: {
systems = definitions:
nixpkgs.lib.mapAttrs (name: info:
}:
{
systems =
definitions:
nixpkgs.lib.mapAttrs (
name: info:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs outputs;
inherit inputs self;
mainUser = info.user;
};
modules =
@ -23,18 +26,17 @@
home-manager = {
useGlobalPkgs = true;
extraSpecialArgs = {
inherit inputs outputs;
inherit inputs self;
mainUser = info.user;
};
users.${info.user}.imports =
[
../home/${info.user}.nix
]
++ info.hmImports or [];
users.${info.user}.imports = [
../home/${info.user}.nix
] ++ info.hmImports or [ ];
};
}
]
++ info.imports or []
++ info.imports or [ ]
++ sharedModules;
}) definitions;
}
) definitions;
}

View file

@ -1,65 +1,70 @@
{pkgs}: {palette}: let
rendersvg = pkgs.runCommand "rendersvg" {} ''
{ 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 = "d7f59a37ef51f893c28b55dc344146e04b2cd52c";
sha256 = "sha256-PnpFAmKEpfg3wBwShLYviZybWQQltcw7fpsQkTUZtww=";
};
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
pkgs.stdenv.mkDerivation rec {
name = "generated-gtk-theme-nix-rice";
src = pkgs.fetchFromGitHub {
owner = "nana-4";
repo = "materia-theme";
rev = "d7f59a37ef51f893c28b55dc344146e04b2cd52c";
sha256 = "sha256-PnpFAmKEpfg3wBwShLYviZybWQQltcw7fpsQkTUZtww=";
};
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
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 .
'';
}
echo "Changing colours:"
./change_color.sh -o nix-rice /build/gtk-colors -i False -t "$out/share/themes"
chmod 555 -R .
'';
}

View file

@ -1,49 +1,18 @@
{
inputs,
lib,
...
}: {
}:
{
rice = import ./rice.nix;
murex-jump = inputs.murex-jump.overlays.murex-jump;
murex-starship = inputs.murex-starship.overlays.murex-starship;
comfyui = inputs.comfyui.overlays.comfyui;
comfyui-plugins = inputs.comfyui-plugins.overlays.comfyui-plugins;
murex = final: prev: {
inherit (inputs.murex-jump.overlays) murex-jump;
inherit (inputs.murex-starship.overlays) murex-starship;
inherit (inputs.comfyui.overlays) comfyui;
inherit (inputs.comfyui-plugins.overlays) comfyui-plugins;
murex = _final: prev: {
murex = prev.murex.overrideAttrs {
version = "dev-${builtins.toString inputs.murex.lastModifiedDate}";
src = inputs.murex;
vendorHash = "sha256-NIhg8D8snCNxpb3i2JG5tLcZteYBCGN4QbOowG/vgJE=";
vendorHash = "sha256-+V9rvWTtMtszR8JmTrntEy+CsAZsKYRblHsp6iaPuUs=";
};
};
# sirula = let
# src = inputs.sirula;
# in
# final: prev: {
# sirula =
# (prev.sirula.override (old: {
# rustPlatform =
# old.rustPlatform
# // {
# buildRustPackage = args:
# old.rustPlatform.buildRustPackage (args
# // {
# inherit src;
# cargoHash = prev.lib.fakeHash;
# cargoSha256 = prev.lib.fakeHash;
# cargoLock = {
# lockFile = "${inputs.sirula}" + /Cargo.lock;
# };
# });
# };
# }))
# .overrideAttrs (oldAttrs: {
# version = "1.0.0-${builtins.toString inputs.sirula.lastModifiedDate}";
# inherit src;
# cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const {
# inherit src;
# outputHash = prev.lib.fakeHash;
# outputHashMode = "recursive";
# });
# });
# };
}

View file

@ -1,43 +1,43 @@
final: prev: let
final: prev:
let
inherit (prev.lib.nix-rice) kitty-themes;
inherit (prev.lib.nix-rice.palette) toRGBShortHex toRgbHex;
inherit (prev.lib.nix-rice.palette) toRGBShortHex;
# theme = kitty-themes.parseTheme ./op.pal;
theme = kitty-themes.parseTheme ./pal.conf;
# theme = kitty-themes.getThemeByName "everforest_dark_hard";
in {
in
# theme = kitty-themes.getThemeByName "everforest_dark_hard";
{
rice = rec {
palette =
{
normal = {
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 = {
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 = {
fg = theme.foreground;
bg = theme.background;
fg_sel = theme.selection_foreground;
bg_sel = theme.selection_background;
cursor = theme.cursor;
# url = theme.url_color;
};
}
// theme;
palette = {
normal = {
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 = {
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 = {
fg = theme.foreground;
bg = theme.background;
fg_sel = theme.selection_foreground;
bg_sel = theme.selection_background;
inherit (theme) cursor;
# url = theme.url_color;
};
} // theme;
fonts = rec {
sans = {
@ -81,7 +81,7 @@ in {
gtk-theme = {
name = "nix-rice";
package = prev.callPackage ./gtk-theme.nix {} {palette = toRGBShortHex final.rice.palette;};
package = prev.callPackage ./gtk-theme.nix { } { palette = toRGBShortHex final.rice.palette; };
};
borders = {
@ -92,7 +92,7 @@ in {
};
bg = {
image = prev.callPackage ./wallpaper.nix {} {
image = prev.callPackage ./wallpaper.nix { } {
palette = toRGBShortHex final.rice.palette;
wallpaper = builtins.path rec {
name = "wallpaper.jpg";
@ -104,8 +104,8 @@ in {
cursor = {
package = prev.afterglow-cursors-recolored.override {
themeVariants = ["Dracula"];
draculaColorVariants = ["Orange"];
themeVariants = [ "Dracula" ];
draculaColorVariants = [ "Orange" ];
};
name = "Afterglow-Recolored-Dracula-Orange";
};
@ -115,7 +115,7 @@ in {
font = "${fonts.sans.package}/share/fonts/truetype/InriaSans-Regular.ttf";
theme = "colorful_loop";
themePackages = [
(prev.pkgs.adi1090x-plymouth-themes.override {selected_themes = ["colorful_loop"];})
(prev.pkgs.adi1090x-plymouth-themes.override { selected_themes = [ "colorful_loop" ]; })
];
};
}; # /rice

View file

@ -1,20 +1,26 @@
{pkgs}: {
{ pkgs }:
{
palette,
wallpaper,
}: let
str_pal = with pkgs.lib; concatStringsSep " " (builtins.foldl' (acc: el: acc ++ (attrValues el)) [] [palette.normal palette.bright palette.util]);
}:
let
str_pal =
with pkgs.lib;
concatStringsSep " " (
builtins.foldl' (acc: el: acc ++ (attrValues el)) [ ] [ palette.normal palette.bright palette.util ]
);
in
pkgs.stdenv.mkDerivation rec {
name = "generated-wallpaper.png";
src = wallpaper;
buildInputs = [
pkgs.lutgen
];
pkgs.stdenv.mkDerivation rec {
name = "generated-wallpaper.png";
src = wallpaper;
buildInputs = [
pkgs.lutgen
];
phases = ["installPhase"];
phases = [ "installPhase" ];
installPhase = ''
echo -e "Generating wallpaper from ${wallpaper} using palette:\n${str_pal}.."
${pkgs.lib.getExe pkgs.lutgen} apply --lum 0.8 -l 10 -s 128 -n 8 -o $out ${wallpaper} -- ${str_pal}
'';
}
installPhase = ''
echo -e "Generating wallpaper from ${wallpaper} using palette:\n${str_pal}.."
${pkgs.lib.getExe pkgs.lutgen} apply --lum 0.8 -l 10 -s 128 -n 8 -o $out ${wallpaper} -- ${str_pal}
'';
}