mirror of
https://github.com/xddxdd/nix-cachyos-kernel.git
synced 2026-07-03 19:18:07 +02:00
Extract kernel version from flake input to ensure version in sync
This commit is contained in:
parent
8ea11ba1b5
commit
e8fd643d68
@ -129,6 +129,8 @@
|
||||
cachyosKernels = self.legacyPackages."${final.stdenv.hostPlatform.system}";
|
||||
};
|
||||
|
||||
cachyos-kernel-input-path = inputs.cachyos-kernel.outPath;
|
||||
|
||||
mkCachyKernel =
|
||||
{ buildLinux, pkgs, ... }@args:
|
||||
(import ./kernel-cachyos/mkCachyKernel.nix) {
|
||||
|
||||
@ -1,15 +1,19 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
import requests
|
||||
import tempfile
|
||||
|
||||
|
||||
def get_srctag(variant: str = "latest") -> str:
|
||||
with tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as dir:
|
||||
subprocess.run(
|
||||
["nix", "build", ".#cachyos-kernel-input-path", "-o", f"{dir}/result"], check=True
|
||||
)
|
||||
|
||||
pkgbuild_path = f"linux-cachyos-{variant}" if variant != "latest" else "linux-cachyos"
|
||||
url = f"https://github.com/CachyOS/linux-cachyos/raw/refs/heads/master/{pkgbuild_path}/PKGBUILD"
|
||||
pkgbuild = requests.get(url).text
|
||||
|
||||
with open(f"{dir}/result/{pkgbuild_path}/PKGBUILD") as f:
|
||||
pkgbuild = f.read()
|
||||
|
||||
script = pkgbuild + "\necho $_srctag"
|
||||
result = subprocess.run(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user