massive refactor

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2026-01-13 00:35:27 +01:00
parent b23cc9ce7c
commit f2dae2ee81
17 changed files with 223 additions and 268 deletions

View File

@@ -1,8 +1,8 @@
{ pkgs, ... }@all: with all;
{
home.packages = with pkgs; [
(writers.writePython3Bin "change_colors_json" {
libraries = with python3Packages; [ numpy pillow scikit-learn ];
home.packages = [
(pkgs.writers.writePython3Bin "change_colors_json" {
libraries = with pkgs.python3Packages; [ numpy pillow scikit-learn ];
flakeIgnore = [ "E302" "E305" "E226" "E501" ];
} /*python */ ''
from colorsys import hls_to_rgb, rgb_to_hls
@@ -141,7 +141,10 @@
foreground = alter_l(accent, 0.9)
background = alter_l(accent, 0.05)
d = {
with open("${hyper.home}/nix-dots/flake-modules/colors.json", "r") as f:
full_d = json.load(f)
full_d['${hyper.host}'] = {
"base": {
"foreground": list_to_hex(foreground),
"background": list_to_hex(background)
@@ -155,8 +158,8 @@
}
}
with open("/home/nx2/nix-dots/flake-modules/colors.json", "w") as f:
f.write(json.dumps(d, indent=4))
with open("${hyper.home}/nix-dots/flake-modules/colors.json", "w") as f:
f.write(json.dumps(full_d, indent=4))
'')
];
}