mirror of
https://codeberg.org/mart-w/nixos-x13s.git
synced 2024-11-23 07:24:49 +01:00
Merge pull request 'main' (#1) from adamcstephens/nixos-x13s:main into main
Reviewed-on: https://codeberg.org/mart-w/nixos-x13s/pulls/1
This commit is contained in:
commit
757ba49d65
|
@ -11,7 +11,7 @@ steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: bash
|
image: bash
|
||||||
commands:
|
commands:
|
||||||
- nix develop .#ci -c just -- build
|
- tini -s nix -- develop .#ci -c just -- build
|
||||||
|
|
||||||
- name: upload
|
- name: upload
|
||||||
image: bash
|
image: bash
|
||||||
|
|
20
flake.lock
20
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714641030,
|
"lastModified": 1717285511,
|
||||||
"narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=",
|
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e",
|
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -20,11 +20,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715534503,
|
"lastModified": 1719254875,
|
||||||
"narHash": "sha256-5ZSVkFadZbFP1THataCaSf0JH2cAH3S29hU9rrxTEqk=",
|
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2057814051972fa1453ddfb0d98badbea9b83c06",
|
"rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,14 +36,14 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714640452,
|
"lastModified": 1717284937,
|
||||||
"narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=",
|
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
|
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
|
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|
|
@ -28,6 +28,11 @@
|
||||||
pkgs.cachix
|
pkgs.cachix
|
||||||
pkgs.jq
|
pkgs.jq
|
||||||
pkgs.just
|
pkgs.just
|
||||||
|
(pkgs.python3.withPackages (py: [
|
||||||
|
py.PyGithub
|
||||||
|
py.packaging
|
||||||
|
]))
|
||||||
|
pkgs.pyright
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
24
module.nix
24
module.nix
|
@ -2,6 +2,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
options,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
@ -40,7 +41,14 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = [ pkgs.efibootmgr ];
|
environment.systemPackages = [
|
||||||
|
pkgs.efibootmgr
|
||||||
|
(x13sPackages.uncompressed-firmware.override {
|
||||||
|
firmwareFilesList = lib.flatten options.hardware.firmware.definitions;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.pathsToLink = [ "/share/uncompressed-firmware" ];
|
||||||
|
|
||||||
hardware.enableAllFirmware = true;
|
hardware.enableAllFirmware = true;
|
||||||
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
|
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
|
||||||
|
@ -104,6 +112,14 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# 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 = [
|
nixpkgs.overlays = [
|
||||||
(_: super: {
|
(_: super: {
|
||||||
# don't try and use zfs
|
# don't try and use zfs
|
||||||
|
@ -119,6 +135,12 @@ in
|
||||||
# default is performance
|
# default is performance
|
||||||
powerManagement.cpuFreqGovernor = "ondemand";
|
powerManagement.cpuFreqGovernor = "ondemand";
|
||||||
|
|
||||||
|
# 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 = {
|
systemd.services.bluetooth-x13s-mac = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
before = [ "bluetooth.service" ];
|
before = [ "bluetooth.service" ];
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
"owner": "jhovold",
|
"owner": "jhovold",
|
||||||
"repo": "linux"
|
"repo": "linux"
|
||||||
},
|
},
|
||||||
"branch": "wip/sc8280xp-6.9",
|
"branch": "wip/sc8280xp-6.10-rc5",
|
||||||
"revision": "357c0f0c7ad2d7d95a3200b6cfd7bef43299de04",
|
"revision": "fb34a1d838d061d9e2199656b832bb2ebc2dc5e3",
|
||||||
"url": "https://github.com/jhovold/linux/archive/357c0f0c7ad2d7d95a3200b6cfd7bef43299de04.tar.gz",
|
"url": "https://github.com/jhovold/linux/archive/fb34a1d838d061d9e2199656b832bb2ebc2dc5e3.tar.gz",
|
||||||
"hash": "1n6cv149rafgk7wkb8cjixy6car4zq0dhhz39b7gjnzr599mqwxn"
|
"hash": "07gsf26954qi9lspbzlc4xsan4vbiyzbfnpwbwyaxcqfibzfg6vg"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": 3
|
"version": 3
|
||||||
|
|
|
@ -15,11 +15,9 @@ let
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
linux_jhovold = linux_jhovold_6_9;
|
linux_jhovold = pkgs.callPackage linux_x13s_pkg {
|
||||||
|
|
||||||
linux_jhovold_6_9 = pkgs.callPackage linux_x13s_pkg {
|
|
||||||
src = sources.linux-jhovold;
|
src = sources.linux-jhovold;
|
||||||
version = "6.9.0";
|
version = "6.10.0-rc5";
|
||||||
defconfig = "johan_defconfig";
|
defconfig = "johan_defconfig";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,4 +25,6 @@ rec {
|
||||||
qrtr = pkgs.callPackage ./qrtr { };
|
qrtr = pkgs.callPackage ./qrtr { };
|
||||||
|
|
||||||
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
|
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
|
||||||
|
|
||||||
|
uncompressed-firmware = pkgs.callPackage ./uncompressed-firmware.nix { };
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,10 @@ index 65c4b80..669d9a0 100644
|
||||||
+++ b/pd-mapper.c
|
+++ b/pd-mapper.c
|
||||||
@@ -194,7 +194,7 @@ static int pd_load_map(const char *file)
|
@@ -194,7 +194,7 @@ static int pd_load_map(const char *file)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
-#define FIRMWARE_BASE "/lib/firmware/"
|
-#define FIRMWARE_BASE "/lib/firmware/"
|
||||||
+#define FIRMWARE_BASE "/run/current-system/firmware/"
|
+#define FIRMWARE_BASE "/run/current-system/sw/share/uncompressed-firmware/"
|
||||||
#else
|
#else
|
||||||
#define FIRMWARE_BASE "/vendor/firmware/"
|
#define FIRMWARE_BASE "/vendor/firmware/"
|
||||||
#endif
|
#endif
|
||||||
|
|
24
packages/uncompressed-firmware.nix
Normal file
24
packages/uncompressed-firmware.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
runCommand,
|
||||||
|
buildEnv,
|
||||||
|
firmwareFilesList ? [ ],
|
||||||
|
}:
|
||||||
|
runCommand "qcom-modem-uncompressed-firmware-share"
|
||||||
|
{
|
||||||
|
firmwareFiles = buildEnv {
|
||||||
|
name = "qcom-modem-uncompressed-firmware";
|
||||||
|
paths = firmwareFilesList;
|
||||||
|
pathsToLink = [
|
||||||
|
"/lib/firmware/rmtfs"
|
||||||
|
"/lib/firmware/qcom"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
''
|
||||||
|
PS4=" $ "
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
mkdir -p $out/share/
|
||||||
|
ln -s $firmwareFiles/lib/firmware/ $out/share/uncompressed-firmware
|
||||||
|
)
|
||||||
|
''
|
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