Compare commits
41 commits
Author | SHA1 | Date | |
---|---|---|---|
f6a0df91fb | |||
6218392785 | |||
a59ae21e47 | |||
14777d1f0c | |||
8e16dc9e6a | |||
e6d95a3a60 | |||
5920196f4f | |||
6e5b3caccb | |||
f1a2bace41 | |||
79dcff6403 | |||
7a92ed1473 | |||
07c7d73a57 | |||
a977573540 | |||
4964bf1692 | |||
7d66d2ca4d | |||
757ba49d65 | |||
dccc4a2c35 | |||
4f3bbdaeca | |||
4ea1f591bc | |||
a95fcbdb0b | |||
bece952194 | |||
65b22fab10 | |||
0cf1cf36b8 | |||
bbe240e612 | |||
ce01289423 | |||
eb0287f9c0 | |||
6a1f04ae97 | |||
3a002c5a64 | |||
3e183c4b98 | |||
dc4fd98195 | |||
87a35b80a6 | |||
39105d4fa7 | |||
e2ed1ccd08 | |||
ebffb583a3 | |||
33327a5708 | |||
9f5d708f1a | |||
e0cc11fd56 | |||
dec99e46ed | |||
8e01e9917f | |||
0579c5474a | |||
735b1307eb |
|
@ -1,29 +0,0 @@
|
|||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
|
||||
jobs:
|
||||
kernel:
|
||||
runs-on: local/aarch64-linux
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: set home
|
||||
run: |
|
||||
echo "HOME=$PWD" >> "$GITHUB_ENV"
|
||||
|
||||
- name: build all
|
||||
run: |
|
||||
set -x
|
||||
TARGETS=$(nix eval .#packages.aarch64-linux --apply 'builtins.attrNames' --json | jq '. | map(".#" + .) | join(" ")' -r)
|
||||
OUTPUT=$(nix build --print-out-paths --keep-going $TARGETS)
|
||||
echo $OUTPUT
|
||||
echo "$OUTPUT" > build.out
|
||||
|
||||
- name: upload to cachix
|
||||
run: |
|
||||
cachix push nixos-x13s $(cat build.out)
|
||||
env:
|
||||
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_TOKEN_X13S }}'
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
.secret.envrc
|
||||
result
|
||||
|
|
25
.woodpecker/build.yaml
Normal file
25
.woodpecker/build.yaml
Normal file
|
@ -0,0 +1,25 @@
|
|||
labels:
|
||||
type: local
|
||||
system: aarch64-linux
|
||||
|
||||
steps:
|
||||
- name: find-targets
|
||||
image: bash
|
||||
commands:
|
||||
- nix develop .#ci -c just -- find-targets
|
||||
|
||||
- name: build
|
||||
image: bash
|
||||
commands:
|
||||
- tini -s nix -- develop .#ci -c just -- build
|
||||
|
||||
- name: upload
|
||||
image: bash
|
||||
commands:
|
||||
- nix develop .#ci -c just -- push
|
||||
environment:
|
||||
CACHIX_AUTH_TOKEN:
|
||||
from_secret: CACHIX_AUTH_TOKEN
|
||||
|
||||
when:
|
||||
- event: push
|
|
@ -1,5 +1,8 @@
|
|||
# nixos x13s
|
||||
|
||||
> [!CAUTION]
|
||||
> This project is unmaintained.
|
||||
|
||||
This repository aims to provide easy, shared, support for Lenovo X13s on Linux.
|
||||
|
||||
The support for this machine is constantly improving in mainline kernel and upstream packages. Eventually the goal is that this repository is no longer necessary.
|
||||
|
|
30
flake.lock
30
flake.lock
|
@ -5,11 +5,11 @@
|
|||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1712014858,
|
||||
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
||||
"lastModified": 1719994518,
|
||||
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
|
||||
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -20,11 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1714253743,
|
||||
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
|
||||
"lastModified": 1722062969,
|
||||
"narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
|
||||
"rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -36,20 +36,14 @@
|
|||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1711703276,
|
||||
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
|
||||
"type": "github"
|
||||
"lastModified": 1719876945,
|
||||
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
|
|
103
flake.nix
103
flake.nix
|
@ -6,6 +6,9 @@
|
|||
|
||||
outputs =
|
||||
inputs@{ flake-parts, self, ... }:
|
||||
let
|
||||
dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb";
|
||||
in
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [ ./packages/part.nix ];
|
||||
|
||||
|
@ -17,31 +20,115 @@
|
|||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
devShells.default = pkgs.mkShellNoCC { packages = [ pkgs.npins ]; };
|
||||
devShells = rec {
|
||||
default = pkgs.mkShellNoCC { packages = [ pkgs.npins ] ++ ci.nativeBuildInputs; };
|
||||
|
||||
ci = pkgs.mkShellNoCC {
|
||||
packages = [
|
||||
pkgs.cachix
|
||||
pkgs.jq
|
||||
pkgs.just
|
||||
(pkgs.python3.withPackages (py: [
|
||||
py.PyGithub
|
||||
py.packaging
|
||||
]))
|
||||
pkgs.pyright
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.nixosModules.default = import ./module.nix;
|
||||
flake.nixosModules.default = import ./module.nix { inherit dtbName; };
|
||||
|
||||
flake.nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
|
||||
flake.nixosConfigurations = {
|
||||
example = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
self.nixosModules.default
|
||||
(
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
nixos-x13s.enable = true;
|
||||
nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported
|
||||
|
||||
# install multiple kernels! note this increases eval time for each specialization
|
||||
specialisation = {
|
||||
mainline.configuration.nixos-x13s.kernel = "mainline";
|
||||
};
|
||||
|
||||
# allow unfree firmware
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# define your fileSystems
|
||||
fileSystems."/".device = "/dev/notreal";
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
|
||||
iso = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
|
||||
self.nixosModules.default
|
||||
(
|
||||
{
|
||||
modulesPath,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
image = import "${inputs.nixpkgs}/nixos/lib/make-disk-image.nix" {
|
||||
inherit config lib pkgs;
|
||||
|
||||
name = "nixos-x13s-bootstrap";
|
||||
diskSize = "auto";
|
||||
format = "raw";
|
||||
partitionTableType = "efi";
|
||||
copyChannel = false;
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
hardware.deviceTree = {
|
||||
enable = true;
|
||||
name = "qcom/${dtbName}";
|
||||
};
|
||||
|
||||
system.build.bootstrap-image = image;
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
systemd.enable = true;
|
||||
systemd.emergencyAccess = true;
|
||||
};
|
||||
|
||||
loader = {
|
||||
grub.enable = false;
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.graceful = true;
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nixos-x13s = {
|
||||
enable = true;
|
||||
bluetoothMac = "02:68:b3:29:da:98";
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/boot" = {
|
||||
fsType = "vfat";
|
||||
device = "/dev/disk/by-label/ESP";
|
||||
};
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
autoResize = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
12
justfile
Normal file
12
justfile
Normal file
|
@ -0,0 +1,12 @@
|
|||
all:
|
||||
just -l
|
||||
|
||||
find-targets:
|
||||
nix eval .#packages.aarch64-linux --apply 'builtins.attrNames' --json | jq '. | map(".#" + .) | join(" ")' -r > targets
|
||||
|
||||
build:
|
||||
nix build --print-out-paths --keep-going $(cat targets) > outputs
|
||||
cat outputs
|
||||
|
||||
push:
|
||||
cachix -- push nixos-x13s $(cat outputs)
|
91
module.nix
91
module.nix
|
@ -1,6 +1,8 @@
|
|||
{ dtbName }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
@ -9,19 +11,30 @@ let
|
|||
|
||||
x13sPackages = import ./packages/default.nix { inherit lib pkgs; };
|
||||
|
||||
dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb";
|
||||
linuxPackages_x13s =
|
||||
if cfg.kernel == "mainline" then
|
||||
pkgs.linuxPackages_latest
|
||||
else
|
||||
pkgs.linuxPackagesFor (
|
||||
if cfg.kernel == "jhovold" then
|
||||
x13sPackages.linux_jhovold
|
||||
else
|
||||
throw "Unsupported kernel"
|
||||
if cfg.kernel == "jhovold" then x13sPackages.linux_jhovold else throw "Unsupported kernel"
|
||||
);
|
||||
dtb = "${linuxPackages_x13s.kernel}/dtbs/qcom/${dtbName}";
|
||||
dtbEfiPath = "dtbs/${cfg.kernel}/${config.boot.kernelPackages.kernel.version}/${dtbName}";
|
||||
dtbEfiPath = "dtbs/x13s.dtb";
|
||||
|
||||
modulesClosure = pkgs.makeModulesClosure {
|
||||
rootModules = config.boot.initrd.availableKernelModules ++ config.boot.initrd.kernelModules;
|
||||
kernel = config.system.modulesTree;
|
||||
firmware = config.hardware.firmware;
|
||||
allowMissing = false;
|
||||
};
|
||||
|
||||
modulesWithExtra = pkgs.symlinkJoin {
|
||||
name = "modules-closure";
|
||||
paths = [
|
||||
modulesClosure
|
||||
x13sPackages.graphics-firmware
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
options.nixos-x13s = {
|
||||
|
@ -29,7 +42,7 @@ in
|
|||
|
||||
bluetoothMac = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "mac address to set on boot";
|
||||
description = "Bluetooth MAC address to set on boot";
|
||||
};
|
||||
|
||||
kernel = lib.mkOption {
|
||||
|
@ -37,27 +50,30 @@ in
|
|||
"jhovold"
|
||||
"mainline"
|
||||
];
|
||||
description = "which patched kernel to use. jhovold is the latest RC, and mainline is nixos latest";
|
||||
description = "Which patched kernel to use. jhovold is the latest RC or release with some x13s specific patches, and mainline is nixos latest";
|
||||
default = "jhovold";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = false;
|
||||
message = "adamcstephens/nixos-x13s is no longer maintained";
|
||||
}
|
||||
];
|
||||
|
||||
environment.systemPackages = [ pkgs.efibootmgr ];
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
|
||||
|
||||
systemd.services.pd-mapper = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${lib.getExe x13sPackages.pd-mapper}";
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
hardware.firmware = lib.mkBefore [ x13sPackages.graphics-firmware ];
|
||||
|
||||
boot = {
|
||||
initrd.systemd.enable = true;
|
||||
initrd.systemd.contents = {
|
||||
"/lib".source = lib.mkForce "${modulesWithExtra}/lib";
|
||||
};
|
||||
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot.enable = lib.mkDefault true;
|
||||
loader.systemd-boot.extraFiles = {
|
||||
|
@ -74,11 +90,8 @@ in
|
|||
"efi=noruntime"
|
||||
"clk_ignore_unused"
|
||||
"pd_ignore_unused"
|
||||
"regulator_ignore_unused"
|
||||
"arm64.nopauth"
|
||||
|
||||
# blacklist graphics in initrd so the firmware can load from disk
|
||||
"rd.driver.blacklist=msm"
|
||||
# "regulator_ignore_unused" # allows for > 30 sec to load msm, at the potential cost of power
|
||||
];
|
||||
|
||||
initrd = {
|
||||
|
@ -102,11 +115,19 @@ in
|
|||
"dispcc_sc8280xp"
|
||||
"phy_qcom_edp"
|
||||
"panel-edp"
|
||||
# "msm"
|
||||
"msm"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# https://github.com/jhovold/linux/wiki/X13s#modem
|
||||
networking.networkmanager.fccUnlockScripts = [
|
||||
{
|
||||
id = "105b:e0c3";
|
||||
path = "${pkgs.modemmanager}/share/ModemManager/fcc-unlock.available.d/105b";
|
||||
}
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(_: super: {
|
||||
# don't try and use zfs
|
||||
|
@ -122,17 +143,21 @@ in
|
|||
# default is performance
|
||||
powerManagement.cpuFreqGovernor = "ondemand";
|
||||
|
||||
systemd.services.bluetooth = {
|
||||
# https://github.com/jhovold/linux/wiki/X13s#camera
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="dma_heap", KERNEL=="linux,cma", GROUP="video", MODE="0660"
|
||||
ACTION=="add", SUBSYSTEM=="dma_heap", KERNEL=="system", GROUP="video", MODE="0660"
|
||||
'';
|
||||
|
||||
systemd.services.bluetooth-x13s-mac = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
before = [ "bluetooth.service" ];
|
||||
requiredBy = [ "bluetooth.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
# disabled because btmgmt call hangs
|
||||
# ExecStartPre = [
|
||||
# ""
|
||||
# "${pkgs.util-linux}/bin/rfkill block bluetooth"
|
||||
# "${pkgs.bluez5-experimental}/bin/btmgmt public-addr ${cfg.bluetoothMac}"
|
||||
# "${pkgs.util-linux}/bin/rfkill unblock bluetooth"
|
||||
# ];
|
||||
RestartSec = 5;
|
||||
Restart = "on-failure";
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.util-linux}/bin/script -q -c '${pkgs.bluez}/bin/btmgmt --index 0 public-addr ${cfg.bluetoothMac}'";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
"owner": "jhovold",
|
||||
"repo": "linux"
|
||||
},
|
||||
"branch": "wip/sc8280xp-6.9-rc6",
|
||||
"revision": "45be9698f7ddf9d3f0596ef1081b7f2d359931b0",
|
||||
"url": "https://github.com/jhovold/linux/archive/45be9698f7ddf9d3f0596ef1081b7f2d359931b0.tar.gz",
|
||||
"hash": "0mbrrz6g783iyc17c3g44fg6xh2arcvh5xsfwr9l0a4iam4r1v0v"
|
||||
"branch": "wip/sc8280xp-6.11-rc1",
|
||||
"revision": "9c6b81022b9c277d65c68e25f4cfd52f33ef8f28",
|
||||
"url": "https://github.com/jhovold/linux/archive/9c6b81022b9c277d65c68e25f4cfd52f33ef8f28.tar.gz",
|
||||
"hash": "13c6r67iy8y750f8zpals4l941lshxx3w3ar1ss9dizsqjsghdsr"
|
||||
}
|
||||
},
|
||||
"version": 3
|
||||
|
|
|
@ -14,17 +14,23 @@ let
|
|||
}
|
||||
);
|
||||
in
|
||||
rec {
|
||||
linux_jhovold = linux_jhovold_6_9;
|
||||
|
||||
linux_jhovold_6_9 = pkgs.callPackage linux_x13s_pkg {
|
||||
{
|
||||
linux_jhovold = pkgs.callPackage linux_x13s_pkg {
|
||||
src = sources.linux-jhovold;
|
||||
version = "6.9.0-rc6";
|
||||
version = "6.11.0-rc1";
|
||||
defconfig = "johan_defconfig";
|
||||
};
|
||||
|
||||
pd-mapper = pkgs.callPackage ./pd-mapper { inherit qrtr; };
|
||||
qrtr = pkgs.callPackage ./qrtr { };
|
||||
|
||||
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
|
||||
graphics-firmware =
|
||||
let
|
||||
gpu-src = pkgs.fetchurl {
|
||||
url = "https://download.lenovo.com/pccbbs/mobiles/n3hdr20w.exe";
|
||||
hash = "sha256-Jwyl9uKOnjpwfHd+VaGHjYs9x8cUuRdFCERuXqaJwEY=";
|
||||
};
|
||||
in
|
||||
pkgs.runCommand "graphics-firmware" { } ''
|
||||
mkdir -vp "$out/lib/firmware/qcom/sc8280xp/LENOVO/21BX"
|
||||
${lib.getExe pkgs.innoextract} ${gpu-src}
|
||||
cp -v code\$GetExtractPath\$/*/*.mbn "$out/lib/firmware/qcom/sc8280xp/LENOVO/21BX/"
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
{ stdenvNoCC, fetchFromGitHub }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "x13s-extra-firmware";
|
||||
version = "1.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ironrobin";
|
||||
repo = "x13s-alarm";
|
||||
rev = "efa51c3b519f75b3983aef67855b1561d9828771";
|
||||
sha256 = "sha256-weETbWXz9aL2pDQDKk7fkb1ecQH0qrhUYDs2E5EiJcI=";
|
||||
};
|
||||
|
||||
dontFixup = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/firmware/qcom/sc8280xp/LENOVO/21BX
|
||||
cp x13s-firmware/qcvss8280.mbn $out/lib/firmware/qcom/sc8280xp/LENOVO/21BX/
|
||||
'';
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
qrtr,
|
||||
xz,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "pd-mapper";
|
||||
version = "unstable-2023-09-01";
|
||||
|
||||
buildInputs = [
|
||||
qrtr
|
||||
xz
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "andersson";
|
||||
repo = "pd-mapper";
|
||||
rev = "10997ba7c43a3787a40b6b1b161408033e716374";
|
||||
hash = "sha256-qGrYNoPCxtdpTdbkSmB39+6/pSXml96Aul8b9opF9Lc=";
|
||||
};
|
||||
|
||||
patches = [ ./pd-mapper-firmware-path.diff ];
|
||||
|
||||
installFlags = [ "prefix=$(out)" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Qualcomm PD mapper";
|
||||
homepage = "https://github.com/andersson/pd-mapper";
|
||||
license = licenses.bsd3;
|
||||
mainProgram = "pd-mapper";
|
||||
platforms = platforms.aarch64;
|
||||
};
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/pd-mapper.c b/pd-mapper.c
|
||||
index 65c4b80..669d9a0 100644
|
||||
--- a/pd-mapper.c
|
||||
+++ b/pd-mapper.c
|
||||
@@ -194,7 +194,7 @@ static int pd_load_map(const char *file)
|
||||
}
|
||||
|
||||
#ifndef ANDROID
|
||||
-#define FIRMWARE_BASE "/lib/firmware/"
|
||||
+#define FIRMWARE_BASE "/run/current-system/firmware/"
|
||||
#else
|
||||
#define FIRMWARE_BASE "/vendor/firmware/"
|
||||
#endif
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "qrtr";
|
||||
version = "unstable-2023-01-17";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "andersson";
|
||||
repo = "qrtr";
|
||||
rev = "d0d471c96e7d112fac6f48bd11f9e8ce209c04d2";
|
||||
hash = "sha256-KF0gCBRw3BDJdK1s+dYhHkokVTHwRFO58ho0IwHPehc=";
|
||||
};
|
||||
|
||||
installFlags = [ "prefix=$(out)" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "QMI IDL compiler";
|
||||
homepage = "https://github.com/andersson/qrtr";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.aarch64;
|
||||
};
|
||||
}
|
55
update.py
Executable file
55
update.py
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from github import Github
|
||||
import sys
|
||||
import re
|
||||
from packaging.version import Version
|
||||
from subprocess import run
|
||||
|
||||
latest_version: str = "0"
|
||||
latest_branch: str = ""
|
||||
previous_version: str = ""
|
||||
|
||||
with Github() as gh:
|
||||
for branch in gh.get_user("jhovold").get_repo("linux").get_branches():
|
||||
v = re.match("wip/sc8280xp-((v?6.[0-9]+)(-rc[0-9]+)?)", branch.name)
|
||||
if v != None and Version(v.group(1)) > Version(latest_version):
|
||||
# add .0 to version
|
||||
latest_version = f"{v.group(2)}.0{v.group(3) or ''}"
|
||||
latest_branch = v.group(0)
|
||||
|
||||
print("branch: " + latest_branch)
|
||||
print("latest: " + latest_version)
|
||||
|
||||
with open("packages/default.nix", "r") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
for line in lines:
|
||||
v = re.match(r'^\s*version = "(6[.0-9-rc]+)";.*$', line)
|
||||
if v != None:
|
||||
previous_version = v.group(1)
|
||||
|
||||
print("previous: " + previous_version)
|
||||
|
||||
if previous_version == latest_version:
|
||||
print("No update found, exiting.")
|
||||
sys.exit(1)
|
||||
|
||||
with open("packages/default.nix", "w") as f:
|
||||
for line in lines:
|
||||
f.write(
|
||||
re.sub(
|
||||
r'^(\s*version = ")6[.0-9-rc]+(";.*$)',
|
||||
rf"\g<1>{latest_version}\2",
|
||||
line,
|
||||
)
|
||||
)
|
||||
|
||||
run(
|
||||
f"npins add --name linux-jhovold github --branch {latest_branch} jhovold linux".split(
|
||||
" "
|
||||
)
|
||||
)
|
||||
|
||||
run("git add npins/ packages/default.nix".split(" "))
|
||||
run(["git", "commit", "-m", f"jhovold: {previous_version} -> {latest_version}"])
|
Loading…
Reference in a new issue