From b14695a1476fdcd1c2ac48fc04253ce278d5a7d0 Mon Sep 17 00:00:00 2001 From: tnichols217 <62992267+tnichols217@users.noreply.github.com> Date: Sun, 16 Feb 2025 23:45:54 -0500 Subject: [PATCH] update readme --- README.md | 5 +++-- build.nix | 3 ++- flake.nix | 1 + src/build.py | 7 ------- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6a92b28..7eeeb97 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ A nix flake is also provided with the `#branding` attribute, this is useful for ## Branding elements -The `src/colors` folder contains color variants for different color schemes for models. All files referenced from the `build.py` builder will be built as a variant of the branding. +The `src/colors` folder contains color variants for different color schemes for models. All files referenced from the `src/build.py` builder will be built as a variant of the branding. ## Build process -The build process is managed by the `build.py` script +The build process is managed by the `src/build.py` script 1. It iterates over specified color schemes 2. It iterates over logo variants, including the logomark, logo, OX logo, and stacked logomark variants @@ -29,3 +29,4 @@ The build process is managed by the `build.py` script 5. Releases: - For the GitHub release, a zip file will be made containing all the variants - For the nix flake, all raw files are provided in the `result` folder + - An additional attribute `.#branding-nopng` is provided for quicker builds diff --git a/build.nix b/build.nix index dd23248..7ed00cc 100644 --- a/build.nix +++ b/build.nix @@ -1,4 +1,4 @@ -{ stdenv, imagemagick, envsubst, python3Full, zip, ... }: +{ stdenv, imagemagick, envsubst, python3Full, zip, nopng ? false, ... }: stdenv.mkDerivation { pname = "BetaNuBranding"; version = "1.0.0"; @@ -9,6 +9,7 @@ stdenv.mkDerivation { buildPhase = '' python build.py + ${if nopng then "" else "mogrify -format png -density 2500 -background none out/*.svg" } ''; installPhase = '' diff --git a/flake.nix b/flake.nix index 81c5980..aa134e6 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,7 @@ }; packages = rec { branding = pkgs.callPackage ./build.nix { }; + branding-nopng = pkgs.callPackage ./build.nix { nopng = true; }; deploy = pkgs.callPackage ./deploy.nix { src = branding; }; default = branding; }; diff --git a/src/build.py b/src/build.py index 5cedf00..af8a357 100644 --- a/src/build.py +++ b/src/build.py @@ -1,6 +1,3 @@ -from typing import Any - - import subprocess colors = [ "black", "color", "red", "white" ] @@ -58,8 +55,4 @@ for color in colors: {build(f"{des}{image[0]}-{color}.svg")} ''' -script += ''' - mogrify -format png -density 2500 -background none out/*.svg -''' - _ = subprocess.run(["bash", "-c", script], check=True)