finally caved and removed my redundant color scheme definition in the flake.nix file to use stylix's built-in color scheme definition

This commit is contained in:
pagedmov
2024-11-03 15:55:36 -05:00
parent 62bbbfa71d
commit e4369939f4
11 changed files with 65 additions and 79 deletions

View File

@@ -41,31 +41,6 @@
} @ inputs: let
system = "x86_64-linux";
username = "pagedmov";
wallpaper = "${self}/assets/wallpapers/sleeping-blackmetal.png";
base16scheme = "black-metal-immortal"; # can be easily changed with the chscheme script
# Map colors from yaml to attribute set
# Extracting colors into a set here allows them to be propagated across the entire config, with or without stylix
lib = nixpkgs.lib;
pkgs = import nixpkgs {system = "x86_64-linux";};
scheme_path = "${pkgs.base16-schemes}/share/themes/${base16scheme}.yaml";
scheme_string = builtins.readFile scheme_path;
scheme_list = lib.splitString "\n" "${scheme_string}";
colors = lib.filter (line: builtins.match "^ *base[0-9A-F]{2}: .*" line != null) scheme_list;
scheme =
lib.lists.foldl' (
acc: line: let
splitLine = lib.splitString ": " line;
key = builtins.elemAt splitLine 0;
value = builtins.elemAt splitLine 1;
trimmedKey = lib.trim key;
cleanValue_step1 = lib.splitString " " value;
cleanValue_step2 = builtins.elemAt cleanValue_step1 0;
cleanValue_final = builtins.substring 1 (builtins.stringLength cleanValue_step2 - 2) cleanValue_step2;
in
acc // {"${trimmedKey}" = cleanValue_final;}
) {}
colors;
in {
homeManagerModules.default = ./modules/home;
@@ -73,7 +48,7 @@
oganesson = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "oganesson";
inherit self inputs scheme wallpaper username;
inherit self inputs username;
};
inherit system;
modules = [
@@ -88,7 +63,7 @@
mercury = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "mercury";
inherit self inputs scheme wallpaper username;
inherit self inputs username;
};
modules = [
./hosts/laptop/config.nix
@@ -102,7 +77,7 @@
xenon = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "xenon";
inherit self inputs scheme username;
inherit self inputs username;
};
modules = [
./hosts/server/config.nix