From b2794eb97c9cd69e2d1a7923cee759e13e0700b9 Mon Sep 17 00:00:00 2001 From: Waldemar Tomme Date: Fri, 10 Jan 2025 09:53:05 +0100 Subject: [PATCH] Add command to flash custom lineage kernel --- .gitignore | 1 + dev/default.nix | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 0ddcaf5..1a8fb26 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /tools/ /.cache/ /.repos/ +/.tmp/ diff --git a/dev/default.nix b/dev/default.nix index 0fc97d5..3b8fcaa 100644 --- a/dev/default.nix +++ b/dev/default.nix @@ -35,7 +35,6 @@ (python3.withPackages (pypi: with pypi; [ libfdt ])) - android-fhs (writeShellScriptBin "flash-lineage-magisk" '' rootDir="${rootDir}" @@ -73,6 +72,16 @@ flash-lineage-magisk '') + (writeShellScriptBin "flash-custom-lineage-kernel" '' + echo "Installing custom LineageOS..." + heimdall flash --BOOT ".repos/lineageos/out/target/product/a71/boot.img" + '') + (writeShellScriptBin "flash-stock" '' + echo "Installing stock..." + + # does not work for some reason + # pmbootstrap flasher --method heimdall-bootimg --resume flash_kernel + '') (writeShellScriptBin "flash-postmarketos" '' echo "Installing postmarketOS..." heimdall flash \ @@ -269,6 +278,19 @@ # only necessary if you wanna use `runScript = "zsh";` below zsh + + brotli + sdat2img + + (writeShellScriptBin "init-repositories" '' + if [[ ! -d ".repos/lineageos" ]]; then + mkdir -p ".repos/lineageos" + pushd .repos/lineageos + repo init -u https://github.com/LineageOS/android.git -b lineage-22.1 --git-lfs --no-clone-bundle + repo sync + popd + fi + '') ]; multiPkgs = pkgs: with pkgs; [ @@ -280,16 +302,6 @@ libgcc # crtbeginS.o iconv # ??? - i put this here and by the time i went back to remove unecessary packages i forgot why iconv.dev # sys/types.h - - (writeShellScriptBin "init-repositories" '' - if [[ ! -d ".repos/lineageos" ]]; then - mkdir -p ".repos/lineageos" - pushd .repos/lineageos - repo init -u https://github.com/LineageOS/android.git -b lineage-22.1 --git-lfs --no-clone-bundle - repo sync - popd - fi - '') ]; runScript = "zsh"; # personal preference, you could set this to bash instead if you want profile = '' @@ -303,7 +315,11 @@ ''; }; in - fhs.env; + pkgs.stdenv.mkDerivation { + name = "lineageos-env-shell"; + nativeBuildInputs = [fhs]; + shellHook = "exec lineageos-env"; + }; }; }; }