From b611d998632eec26230fb75616365298ee0e3490 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 12 Feb 2025 00:43:27 -0500 Subject: [PATCH] feat(material-rounded-theme): use latest release instead of latest git --- apps/update-sources/src/app.ts | 8 ++--- .../homie/modules/home-assistant/frontend.nix | 3 +- flake.lock | 17 ----------- flake.nix | 6 ---- inputs/default.nix | 4 --- packages/pam-fprint-grosshack/default.nix | 2 +- packages/protonhax/default.nix | 2 +- .../custom-sidebar/default.nix | 6 ++-- .../material-rounded-theme/default.nix | 29 +++++++++---------- .../material-rounded-theme/update.sh | 13 --------- 10 files changed, 26 insertions(+), 64 deletions(-) delete mode 100644 scopedPackages/lovelace-components/material-rounded-theme/update.sh diff --git a/apps/update-sources/src/app.ts b/apps/update-sources/src/app.ts index d6c34f92..1bd40794 100644 --- a/apps/update-sources/src/app.ts +++ b/apps/update-sources/src/app.ts @@ -58,7 +58,7 @@ const main = async() => { } if (args['m'] || args['material-rounded-theme']) { - console.log(updateCustomPackage( + console.log(runNixUpdate( 'scopedPackages.x86_64-linux.lovelace-components.material-rounded-theme', )); } @@ -123,9 +123,6 @@ const main = async() => { console.log(updateCustomPackage( 'scopedPackages.x86_64-linux.lovelace-components.custom-sidebar', )); - console.log(updateCustomPackage( - 'scopedPackages.x86_64-linux.lovelace-components.material-rounded-theme', - )); console.log(updateCustomPackage('some-sass-language-server')); // nix-update executions @@ -144,6 +141,9 @@ const main = async() => { updatePackage('pam-fprint-grosshack'); updatePackage('protonhax'); updatePackage('trash-d'); + updatePackage( + 'scopedPackages.x86_64-linux.lovelace-components.material-rounded-theme', + ); spawnSync('nixFastBuild', [], { diff --git a/configurations/homie/modules/home-assistant/frontend.nix b/configurations/homie/modules/home-assistant/frontend.nix index a7efbc19..567f8039 100644 --- a/configurations/homie/modules/home-assistant/frontend.nix +++ b/configurations/homie/modules/home-assistant/frontend.nix @@ -1,7 +1,6 @@ { caule-themes-src, dracul-ha-src, - material-rounded-theme-src, lib, pkgs, self, @@ -9,6 +8,8 @@ }: let inherit (lib) attrValues singleton; inherit (pkgs.writers) writeYAML; + + material-rounded-theme-src = self.scopedPackages.${pkgs.system}.lovelace-components.material-rounded-theme.src; in { services.home-assistant = { configFiles = { diff --git a/flake.lock b/flake.lock index b418ff65..328c4a61 100644 --- a/flake.lock +++ b/flake.lock @@ -958,22 +958,6 @@ "type": "github" } }, - "material-rounded-theme-src": { - "flake": false, - "locked": { - "lastModified": 1737141695, - "narHash": "sha256-VmO8AKyjl756ojIRyPXNeq6y0mLs9O2jLp82ej5rwY4=", - "owner": "Nerwyn", - "repo": "material-rounded-theme", - "rev": "7c69a1f03e424ab2485345e5f38ffc5264ead375", - "type": "github" - }, - "original": { - "owner": "Nerwyn", - "repo": "material-rounded-theme", - "type": "github" - } - }, "material-symbols-src": { "flake": false, "locked": { @@ -1682,7 +1666,6 @@ "kompass": "kompass", "lib-aggregate": "lib-aggregate", "libratbag-src": "libratbag-src", - "material-rounded-theme-src": "material-rounded-theme-src", "material-symbols-src": "material-symbols-src", "minix": "minix", "modernz-src": "modernz-src", diff --git a/flake.nix b/flake.nix index ce4f5980..3938fa45 100644 --- a/flake.nix +++ b/flake.nix @@ -221,12 +221,6 @@ repo = "libratbag"; type = "github"; }; - material-rounded-theme-src = { - flake = false; - owner = "Nerwyn"; - repo = "material-rounded-theme"; - type = "github"; - }; material-symbols-src = { flake = false; owner = "beecho01"; diff --git a/inputs/default.nix b/inputs/default.nix index 4bcf3b9c..69b19f21 100644 --- a/inputs/default.nix +++ b/inputs/default.nix @@ -293,10 +293,6 @@ let owner = "ricardoquecria"; repo = "caule-themes-pack-1"; } - { - owner = "Nerwyn"; - repo = "material-rounded-theme"; - } ## Lovelace Components { diff --git a/packages/pam-fprint-grosshack/default.nix b/packages/pam-fprint-grosshack/default.nix index f476f093..a87eee8a 100644 --- a/packages/pam-fprint-grosshack/default.nix +++ b/packages/pam-fprint-grosshack/default.nix @@ -28,7 +28,7 @@ in src = fetchFromGitLab { owner = "mishakmak"; - repo = "pam-fprint-grosshack"; + repo = pname; rev = "v${version}"; hash = "sha256-obczZbf/oH4xGaVvp3y3ZyDdYhZnxlCWvL0irgEYIi0="; }; diff --git a/packages/protonhax/default.nix b/packages/protonhax/default.nix index 6e9bd2d9..981cf2bd 100644 --- a/packages/protonhax/default.nix +++ b/packages/protonhax/default.nix @@ -13,7 +13,7 @@ in src = fetchFromGitHub { owner = "jcnils"; - repo = "protonhax"; + repo = pname; rev = version; hash = "sha256-5G4MCWuaF/adSc9kpW/4oDWFFRpviTKMXYAuT2sFf9w="; }; diff --git a/scopedPackages/lovelace-components/custom-sidebar/default.nix b/scopedPackages/lovelace-components/custom-sidebar/default.nix index 4a20dbd6..0a1ae65c 100644 --- a/scopedPackages/lovelace-components/custom-sidebar/default.nix +++ b/scopedPackages/lovelace-components/custom-sidebar/default.nix @@ -6,11 +6,13 @@ stdenv, ... }: let - package = builtins.fromJSON (builtins.readFile "${custom-sidebar-src}/package.json"); + inherit (builtins) fromJSON readFile; + + package = fromJSON (readFile "${custom-sidebar-src}/package.json"); in stdenv.mkDerivation (finalAttrs: { pname = "custom-sidebar"; - inherit (package) version; + version = "${package.version}+${custom-sidebar-src.shortRev}"; src = custom-sidebar-src; diff --git a/scopedPackages/lovelace-components/material-rounded-theme/default.nix b/scopedPackages/lovelace-components/material-rounded-theme/default.nix index 3dc922ac..cb8b892a 100644 --- a/scopedPackages/lovelace-components/material-rounded-theme/default.nix +++ b/scopedPackages/lovelace-components/material-rounded-theme/default.nix @@ -1,31 +1,30 @@ { buildNpmPackage, - concatTextFile, - material-rounded-theme-src, + fetchFromGitHub, ... }: let - package = builtins.fromJSON (builtins.readFile "${material-rounded-theme-src}/package.json"); + pname = "material-rounded-theme"; + version = "3.0.6"; in buildNpmPackage { - pname = package.name; - inherit (package) version; + inherit pname version; + + src = fetchFromGitHub { + owner = "Nerwyn"; + repo = pname; + rev = version; + hash = "sha256-OJllOW8YDcmAckcDO5e/fa0zdz7QRX8PgMC0OU0OKIY="; + }; - src = material-rounded-theme-src; postPatch = '' - substituteInPlace ./webpack.config.js --replace-fail "git branch --show-current" "echo main" + substituteInPlace ./webpack.config.js --replace-fail \ + "git branch --show-current" "echo main" ''; - npmDepsHash = "sha256-Vn4OBTM9MoS0LuU4nDYebncvD6wKmfcLP3gHh0CyfaM="; + npmDepsHash = "sha256-JsDWiRFZkn2Gji07LdsNAQO2W7HdwQRTIs6RPFlzf4A="; installPhase = '' mkdir $out cp ./dist/* $out ''; - - passthru.update = concatTextFile { - name = "update"; - files = [./update.sh]; - executable = true; - destination = "/bin/update"; - }; } diff --git a/scopedPackages/lovelace-components/material-rounded-theme/update.sh b/scopedPackages/lovelace-components/material-rounded-theme/update.sh deleted file mode 100644 index b7c98df0..00000000 --- a/scopedPackages/lovelace-components/material-rounded-theme/update.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -file="$FLAKE/scopedPackages/lovelace-components/material-rounded-theme/default.nix" -old_hash="$(sed -n 's/.*npmDepsHash = "\(.*\)";/\1/p' "$file")" - -sed -i "s/npmDepsHash = .*/npmDepsHash = \"\";/" "$file" -npm_hash="$(nix build "$FLAKE#scopedPackages.x86_64-linux.lovelace-components.material-rounded-theme" |& sed -n 's/.*got: *//p')" - -if [[ "$npm_hash" != "$old_hash" ]]; then - sed -i "s#npmDepsHash = .*#npmDepsHash = \"$npm_hash\";#" "$file" -else - sed -i "s#npmDepsHash = .*#npmDepsHash = \"$old_hash\";#" "$file" -fi