From bda6c0d9ad33ee1f79ada5f9d864e95ee1428ba3 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Tue, 9 Sep 2025 21:00:01 -0700 Subject: [PATCH] home-assistant-custom-lovelace-modules.material-you-utilities: init at 2.0.12 --- .../material-you-utilities/package.nix | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 pkgs/servers/home-assistant/custom-lovelace-modules/material-you-utilities/package.nix diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/material-you-utilities/package.nix b/pkgs/servers/home-assistant/custom-lovelace-modules/material-you-utilities/package.nix new file mode 100644 index 000000000000..4d660cef0dd2 --- /dev/null +++ b/pkgs/servers/home-assistant/custom-lovelace-modules/material-you-utilities/package.nix @@ -0,0 +1,44 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, +}: + +buildNpmPackage rec { + pname = "material-you-utilities"; + version = "2.0.12"; + + src = fetchFromGitHub { + owner = "Nerwyn"; + repo = "material-you-utilities"; + tag = version; + hash = "sha256-R93jv6r6pEe/2t+2RntMzykvH/tNikm79mWYyYnfgyk="; + }; + + npmDepsHash = "sha256-xSlEkYqeq0DLttwlqYKh02B6nW96aENC6C6cuIQCInU="; + + postPatch = '' + # Remove git dependency from rspack config + substituteInPlace rspack.config.js \ + --replace-fail "execSync('git branch --show-current').toString().trim() == 'main'" "false" + ''; + + installPhase = '' + runHook preInstall + + mkdir $out + cp dist/material-you-utilities.min.js $out/ + + runHook postInstall + ''; + + passthru.entrypoint = "material-you-utilities.min.js"; + + meta = { + description = "Material Design 3 color theme generation and Home Assistant component modification"; + homepage = "https://github.com/Nerwyn/material-you-utilities"; + changelog = "https://github.com/Nerwyn/material-you-utilities/releases/tag/${version}"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.jamiemagee ]; + }; +}