Move plugin version into .env, fix version-bump workflow to only touch it
Version Bump / check-bump-label (pull_request) Skipped
Version Bump / apply-version-bump (pull_request) Successful in 23s

The old workflow grepped CMakeLists.txt for the first "VERSION X.Y" match,
which was cmake_minimum_required's own version rather than the project's,
mangling it to 3.27.0.0 on the first real bump. PLUGIN_VERSION in .env is
now the single source of truth for both CMakeLists.txt and flake.nix, and
the workflow's bump/commit steps only ever touch that one file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-30 00:02:19 +02:00
co-authored by Claude Sonnet 5
parent d5338c3d6a
commit 9acfd2b946
4 changed files with 31 additions and 12 deletions
+11 -1
View File
@@ -18,13 +18,23 @@
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
# Read from .env (also read by CMakeLists.txt) rather than a separate
# hardcoded string, so .gitea/workflows/version-bump.yml only ever has
# to touch that one file for both build systems to stay in sync.
pluginVersion =
let
envLines = pkgs.lib.splitString "\n" (builtins.readFile ./.env);
versionLine = pkgs.lib.findFirst (pkgs.lib.hasPrefix "PLUGIN_VERSION=") null envLines;
in
pkgs.lib.removePrefix "PLUGIN_VERSION=" versionLine;
in
{
# Build with Hyprland's own stdenv (not nixpkgs' default one) so the
# compiler/libstdc++ ABI matches what Hyprland itself was built with.
packages.${system}.default = pkgs.hyprland.stdenv.mkDerivation {
pname = "hypr-chrome";
version = "0.1";
version = pluginVersion;
src = self;
nativeBuildInputs = [ pkgs.cmake pkgs.pkg-config ];