Skip to content

Commit

Permalink
[+] Disable Nix Local Repo (Expensive af)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azathothas committed Oct 9, 2024
1 parent 3debe16 commit 5e5feb6
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 73 deletions.
1 change: 1 addition & 0 deletions .github/scripts/aarch64-Linux/build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
##ENV:$PATH
HOST_TRIPLET="$(uname -m)-$(uname -s)" && export HOST_TRIPLET="${HOST_TRIPLET}"
HF_REPO_DL="https://huggingface.co/datasets/Azathothas/Toolpacks-Extras/resolve/main/${HOST_TRIPLET}" && export HF_REPO_DL="${HF_REPO_DL}"
#export NIX_SETUP_MODE="EXPENSIVE"
source <(curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/main/.github/scripts/${HOST_TRIPLET}/env.sh")
#-------------------------------------------------------#

Expand Down
28 changes: 15 additions & 13 deletions .github/scripts/aarch64-Linux/init_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,21 @@
export CONTINUE="NO" && exit 1
else
nix --version && nix-channel --list && nix-channel --update
#Setup NixPkgs Repo [Latest Packages but EXPENSIVE]
sudo rm -rvf "/opt/nixpkgs" 2>/dev/null ; sudo mkdir -p "/opt" && pushd "/opt" >/dev/null 2>&1
sudo git clone --filter="blob:none" --depth="1" --quiet "https://github.com/NixOS/nixpkgs.git"
sudo chown -R "$(whoami):$(whoami)" "/opt/nixpkgs" && sudo chmod -R 755 "/opt/nixpkgs"
nix registry add "nixpkgs" "/opt/nixpkgs" ; nix registry list
nix derivation show "nixpkgs#hello"
popd >/dev/null 2>&1
if [ -d "/opt/nixpkgs" ] && [ "$(find "/opt/nixpkgs" -mindepth 1 -print -quit 2>/dev/null)" ]; then
ls "/opt/nixpkgs" -lah ; du -sh "/opt/nixpkgs"
else
echo -e "\n[-] nixpkgs REPO NOT Found: /opt/nixpkgs\n"
export CONTINUE="NO" && exit 1
fi
if [ "${NIX_SETUP_MODE}" == "EXPENSIVE" ]; then
#Setup NixPkgs Repo [Latest Packages but EXPENSIVE]
sudo rm -rvf "/opt/nixpkgs" 2>/dev/null ; sudo mkdir -p "/opt" && pushd "/opt" >/dev/null 2>&1
sudo git clone --filter="blob:none" --depth="1" --quiet "https://github.com/NixOS/nixpkgs.git"
sudo chown -R "$(whoami):$(whoami)" "/opt/nixpkgs" && sudo chmod -R 755 "/opt/nixpkgs"
nix registry add "nixpkgs" "/opt/nixpkgs" ; nix registry list
nix derivation show "nixpkgs#hello"
popd >/dev/null 2>&1
if [ -d "/opt/nixpkgs" ] && [ "$(find "/opt/nixpkgs" -mindepth 1 -print -quit 2>/dev/null)" ]; then
ls "/opt/nixpkgs" -lah ; du -sh "/opt/nixpkgs"
else
echo -e "\n[-] nixpkgs REPO NOT Found: /opt/nixpkgs\n"
export CONTINUE="NO" && exit 1
fi
fi
fi
#----------------------#
##Install rust & cargo
Expand Down
30 changes: 17 additions & 13 deletions .github/scripts/aarch64-Linux/pkgs/obs-studio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,23 @@ if [ "${SKIP_BUILD}" == "NO" ]; then
export APP="obs"
export NIX_PKGNAME="obs-studio"
export PKG_NAME="${NIX_PKGNAME}.NixAppImage"
#nix bundle --bundler "github:ralismark/nix-appimage" "nixpkgs#${NIX_PKGNAME}" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs" -type d -name "${NIX_PKGNAME}" -print -quit | xargs realpath)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "${PKG_NIX_DIR}" -maxdepth 1 -type f -name "*.nix" | head -n 1)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${NIX_PKGNAME}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add "${PKG_NIX_DIR}/"* >/dev/null 2>&1 && git commit -m "[+] NixAppImage ${NIX_PKGNAME}" >/dev/null 2>&1
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" -o "${OWD}/${APP}.AppImage" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
unset PKG_NIX_DIR PKG_NIX_TMP
#If local repo, use
if [ -d "/opt/nixpkgs" ] && [ $(du -s "/opt/nixpkgs" | cut -f1) -gt 100 ]; then
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs" -type d -name "${NIX_PKGNAME}" -print -quit | xargs realpath)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "${PKG_NIX_DIR}" -maxdepth 1 -type f -name "*.nix" | head -n 1)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${NIX_PKGNAME}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add "${PKG_NIX_DIR}/"* >/dev/null 2>&1 && git commit -m "[+] NixAppImage ${NIX_PKGNAME}" >/dev/null 2>&1
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" -o "${OWD}/${APP}.AppImage" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
unset PKG_NIX_DIR PKG_NIX_TMP
else
nix bundle --bundler "github:ralismark/nix-appimage" "nixpkgs#${NIX_PKGNAME}" --log-format bar-with-logs
fi
#Copy
sudo rsync -achL "${OWD}/${APP}.AppImage" "${OWD}/${PKG_NAME}.tmp"
sudo chown -R "$(whoami):$(whoami)" "${OWD}/${PKG_NAME}.tmp" && chmod -R 755 "${OWD}/${PKG_NAME}.tmp"
Expand Down
29 changes: 17 additions & 12 deletions .github/scripts/aarch64-Linux/pkgs/olive-editor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,23 @@ if [ "${SKIP_BUILD}" == "NO" ]; then
export APP="olive"
export NIX_PKGNAME="olive-editor"
export PKG_NAME="${NIX_PKGNAME}.NixAppImage"
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs" -type d -name "${NIX_PKGNAME}" -print -quit | xargs realpath)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "${PKG_NIX_DIR}" -maxdepth 1 -type f -name "*.nix" | head -n 1)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${NIX_PKGNAME}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add "${PKG_NIX_DIR}/"* >/dev/null 2>&1 && git commit -m "[+] NixAppImage ${NIX_PKGNAME}" >/dev/null 2>&1
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" -o "${OWD}/${APP}.AppImage" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
unset PKG_NIX_DIR PKG_NIX_TMP
#If local repo, use
if [ -d "/opt/nixpkgs" ] && [ $(du -s "/opt/nixpkgs" | cut -f1) -gt 100 ]; then
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs" -type d -name "${NIX_PKGNAME}" -print -quit | xargs realpath)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "${PKG_NIX_DIR}" -maxdepth 1 -type f -name "*.nix" | head -n 1)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${NIX_PKGNAME}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add "${PKG_NIX_DIR}/"* >/dev/null 2>&1 && git commit -m "[+] NixAppImage ${NIX_PKGNAME}" >/dev/null 2>&1
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" -o "${OWD}/${APP}.AppImage" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
unset PKG_NIX_DIR PKG_NIX_TMP
else
nix bundle --bundler "github:ralismark/nix-appimage" "nixpkgs#${NIX_PKGNAME}" --log-format bar-with-logs
fi
#Copy
sudo rsync -achL "${OWD}/${APP}.AppImage" "${OWD}/${PKG_NAME}.tmp"
sudo chown -R "$(whoami):$(whoami)" "${OWD}/${PKG_NAME}.tmp" && chmod -R 755 "${OWD}/${PKG_NAME}.tmp"
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/x86_64-Linux/build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
##ENV:$PATH
HOST_TRIPLET="$(uname -m)-$(uname -s)" && export HOST_TRIPLET="${HOST_TRIPLET}"
HF_REPO_DL="https://huggingface.co/datasets/Azathothas/Toolpacks-Extras/resolve/main/${HOST_TRIPLET}" && export HF_REPO_DL="${HF_REPO_DL}"
#export NIX_SETUP_MODE="EXPENSIVE"
source <(curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/main/.github/scripts/${HOST_TRIPLET}/env.sh")
#-------------------------------------------------------#

Expand Down
28 changes: 15 additions & 13 deletions .github/scripts/x86_64-Linux/init_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,21 @@
export CONTINUE="NO" && exit 1
else
nix --version && nix-channel --list && nix-channel --update
#Setup NixPkgs Repo [Latest Packages but EXPENSIVE]
sudo rm -rvf "/opt/nixpkgs" 2>/dev/null ; sudo mkdir -p "/opt" && pushd "/opt" >/dev/null 2>&1
sudo git clone --filter="blob:none" --depth="1" --quiet "https://github.com/NixOS/nixpkgs.git"
sudo chown -R "$(whoami):$(whoami)" "/opt/nixpkgs" && sudo chmod -R 755 "/opt/nixpkgs"
nix registry add "nixpkgs" "/opt/nixpkgs" ; nix registry list
nix derivation show "nixpkgs#hello"
popd >/dev/null 2>&1
if [ -d "/opt/nixpkgs" ] && [ "$(find "/opt/nixpkgs" -mindepth 1 -print -quit 2>/dev/null)" ]; then
ls "/opt/nixpkgs" -lah ; du -sh "/opt/nixpkgs"
else
echo -e "\n[-] nixpkgs REPO NOT Found: /opt/nixpkgs\n"
export CONTINUE="NO" && exit 1
fi
if [ "${NIX_SETUP_MODE}" == "EXPENSIVE" ]; then
#Setup NixPkgs Repo [Latest Packages but EXPENSIVE]
sudo rm -rvf "/opt/nixpkgs" 2>/dev/null ; sudo mkdir -p "/opt" && pushd "/opt" >/dev/null 2>&1
sudo git clone --filter="blob:none" --depth="1" --quiet "https://github.com/NixOS/nixpkgs.git"
sudo chown -R "$(whoami):$(whoami)" "/opt/nixpkgs" && sudo chmod -R 755 "/opt/nixpkgs"
nix registry add "nixpkgs" "/opt/nixpkgs" ; nix registry list
nix derivation show "nixpkgs#hello"
popd >/dev/null 2>&1
if [ -d "/opt/nixpkgs" ] && [ "$(find "/opt/nixpkgs" -mindepth 1 -print -quit 2>/dev/null)" ]; then
ls "/opt/nixpkgs" -lah ; du -sh "/opt/nixpkgs"
else
echo -e "\n[-] nixpkgs REPO NOT Found: /opt/nixpkgs\n"
export CONTINUE="NO" && exit 1
fi
fi
fi
#----------------------#
#rust & cargo
Expand Down
27 changes: 17 additions & 10 deletions .github/scripts/x86_64-Linux/pkgs/affine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,23 @@ if [ "${SKIP_BUILD}" == "NO" ]; then
export APP="affine"
export NIX_PKGNAME="affine"
export PKG_NAME="${NIX_PKGNAME}.NixAppImage"
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs/by-name" -type d -name "affine" -exec realpath "{}" \;)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "/opt/nixpkgs/pkgs/by-name" -type d -name "affine" -exec find "{}" -type f -name "package.nix" \;)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${APP}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add --all --verbose && git commit -m "[+] NixAppImage ${APP}"
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
#If local repo, use
if [ -d "/opt/nixpkgs" ] && [ $(du -s "/opt/nixpkgs" | cut -f1) -gt 100 ]; then
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs/by-name" -type d -name "affine" -exec realpath "{}" \;)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "/opt/nixpkgs/pkgs/by-name" -type d -name "affine" -exec find "{}" -type f -name "package.nix" \;)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${APP}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add --all --verbose && git commit -m "[+] NixAppImage ${APP}"
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
unset PKG_NIX_DIR PKG_NIX_TMP
else
nix bundle --bundler "github:ralismark/nix-appimage" "nixpkgs#${NIX_PKGNAME}" --log-format bar-with-logs
fi
#Copy
sudo rsync -achL "${OWD}/${APP}.AppImage" "${OWD}/${PKG_NAME}.tmp"
sudo chown -R "$(whoami):$(whoami)" "${OWD}/${PKG_NAME}.tmp" && chmod -R 755 "${OWD}/${PKG_NAME}.tmp"
Expand Down
29 changes: 17 additions & 12 deletions .github/scripts/x86_64-Linux/pkgs/qbittorrent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,23 @@ if [ "${SKIP_BUILD}" == "NO" ]; then
export APP="qbittorrent"
export NIX_PKGNAME="qbittorrent"
export PKG_NAME="${NIX_PKGNAME}.NixAppImage"
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs" -type d -name "${NIX_PKGNAME}" -print -quit | xargs realpath)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "${PKG_NIX_DIR}" -maxdepth 1 -type f -name "*.nix" | head -n 1)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${NIX_PKGNAME}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add "${PKG_NIX_DIR}/"* >/dev/null 2>&1 && git commit -m "[+] NixAppImage ${NIX_PKGNAME}" >/dev/null 2>&1
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" -o "${OWD}/${APP}.AppImage" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
unset PKG_NIX_DIR PKG_NIX_TMP
#If local repo, use
if [ -d "/opt/nixpkgs" ] && [ $(du -s "/opt/nixpkgs" | cut -f1) -gt 100 ]; then
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
PKG_NIX_DIR="$(find "/opt/nixpkgs/pkgs" -type d -name "${NIX_PKGNAME}" -print -quit | xargs realpath)" && export PKG_NIX_DIR="${PKG_NIX_DIR}"
PKG_NIX_TMP="$(find "${PKG_NIX_DIR}" -maxdepth 1 -type f -name "*.nix" | head -n 1)" && export PKG_NIX_TMP="${PKG_NIX_TMP}"
pushd "${PKG_NIX_DIR}" >/dev/null 2>&1
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks-Extras/refs/heads/main/.github/assets/nix-flakes/numtide_nix-gl-host.nix" -o "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_NAME/${NIX_PKGNAME}/g" -i "${PKG_NIX_DIR}/flake.nix"
sed "s/PKG_ARCH/$(uname -m)/g" -i "${PKG_NIX_DIR}/flake.nix"
git add "${PKG_NIX_DIR}/"* >/dev/null 2>&1 && git commit -m "[+] NixAppImage ${NIX_PKGNAME}" >/dev/null 2>&1
git stash ; nix flake update ; popd >/dev/null 2>&1
nix bundle --bundler "github:ralismark/nix-appimage" "${PKG_NIX_DIR}" -o "${OWD}/${APP}.AppImage" --log-format bar-with-logs
pushd "/opt/nixpkgs" >/dev/null 2>&1 && git reset --hard "origin/master" && popd >/dev/null 2>&1
unset PKG_NIX_DIR PKG_NIX_TMP
else
nix bundle --bundler "github:ralismark/nix-appimage" "nixpkgs#${NIX_PKGNAME}" --log-format bar-with-logs
fi
#Copy
sudo rsync -achL "${OWD}/${APP}.AppImage" "${OWD}/${PKG_NAME}.tmp"
sudo chown -R "$(whoami):$(whoami)" "${OWD}/${PKG_NAME}.tmp" && chmod -R 755 "${OWD}/${PKG_NAME}.tmp"
Expand Down

0 comments on commit 5e5feb6

Please sign in to comment.