From 1c98fae5130db5294580584851975706fda356e9 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Sun, 18 May 2025 23:40:07 +0300 Subject: [PATCH] nix shell --- .gitignore | 1 + shell.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8ae2bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.pmbootstrap/ diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..20064bb --- /dev/null +++ b/shell.nix @@ -0,0 +1,48 @@ +{ pkgs ? import (builtins.fetchTarball { + name = "nixos-unstable-2025-05-18"; + url = "https://github.com/nixos/nixpkgs/archive/10862bc5b70821539abbe4ed885fdd7070675143.tar.gz"; + sha256 = "0m40jd2q7s10z321hqirvd8dz4ipaawqpwpa0g7v8yys5z8hyix0"; +}) {} }: +pkgs.mkShell { + buildInputs = with pkgs; [ + pmbootstrap + android-tools + git + ]; + + shellHook = '' + export PMWORK=$PWD/.pmbootstrap + export PMAPORTS=$PMWORK/cache_git/pmaports + mkdir -p $PMWORK + if [ ! -d $PMAPORTS ]; then + mkdir -p $PMWORK/cache_git + git clone https://gitlab.postmarketos.org/postmarketOS/pmaports.git $PMAPORTS + fi + if [ ! -L $PMAPORTS/device/testing/linux-xiaomi-angelican ]; then + ln -s $PWD/linux-xiaomi-angelican $PMAPORTS/device/testing + fi + if [ ! -L $PMAPORTS/device/testing/device-xiaomi-angelican ]; then + ln -s $PWD/device-xiaomi-angelican $PMAPORTS/device/testing + fi + if [ ! -f $PMWORK/pmbootstrap.conf ]; then + cat > $PMWORK/pmbootstrap.conf < $PMWORK/version + fi + alias pmbootstrap="\ + \pmbootstrap \ + --aports $PMAPORTS \ + --work $PMWORK \ + " + ''; +}