This repository was archived by the owner on Aug 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (133 loc) · 6.52 KB
/
Copy pathlist_nix_pkgs.yaml
File metadata and controls
147 lines (133 loc) · 6.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: 💾 Fetch || ⏫ Update NixOS/nixpkgs 📦❄️
#MAX_RUNTIME: ~ 03 mins
on:
workflow_dispatch:
schedule:
- cron: "0 */3 * * *" # Every 3 Hrs
jobs:
fetch:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: "main"
filter: "blob:none" #https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
- name: Setup ENV
run: |
#presets
set +x ; set +e
#-------------#
sudo apt update -y
sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y
sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rsync software-properties-common texinfo util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null
# Do again, sometimes fails
sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y
sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rsync software-properties-common texinfo util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null
#tmp
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}"
echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}"
##User-Agent
USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}"
echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}"
continue-on-error: true
- name: Install Addons
run: |
#presets
set +x ; set +e
#-------------#
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh")
#yj
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/yj" -o "/usr/local/bin/yj" && sudo chmod +x "/usr/local/bin/yj"
continue-on-error: true
- name: Set TZ to (Asia/Kathmandu)
run: |
# Presets
set +x ; set +e
#--------------#
sudo apt-get update -y && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime"
sudo dpkg-reconfigure --frontend noninteractive tzdata
sudo apt-get install apt-utils software-properties-common -y
sudo apt-get update -y
continue-on-error: true
- name: Setup Nix
run: |
#Presets
set +x ; set +e
#--------------#
# Create Output Dir
mkdir -p "${GITHUB_WORKSPACE}/main"
#Install nix
curl -qfsSL "https://nixos.org/nix/install" | bash -s -- --no-daemon
source "${HOME}/.nix-profile/etc/profile.d/nix.sh"
nix --version
continue-on-error: true
- name: Fetch || Update NixOS Packages (https://github.com/NixOS/nixpkgs)
run: |
#Presets
set +x ; set +e
#--------------#
source "${HOME}/.nix-profile/etc/profile.d/nix.sh"
#JSON
nix search "nixpkgs#" "^" --extra-experimental-features nix-command --extra-experimental-features flakes --json --refresh --quiet | jq . > "${GITHUB_WORKSPACE}/main/nixpkgs.json"
#Convert to YAML
cat "${GITHUB_WORKSPACE}/main/nixpkgs.json" | yj -jy | tee "${GITHUB_WORKSPACE}/main/nixpkgs.yaml"
#TXT
cat "${GITHUB_WORKSPACE}/main/nixpkgs.json" | jq -r 'to_entries[] | "| \(.value.pname) | \(.value.version) | \(.value.description) | \(.key) |"' | sort -u -o "${SYSTMP}/nixpkgs.txt"
continue-on-error: false
- name: Update README.md
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main"
echo -e "" > "${GITHUB_WORKSPACE}/main/README.md"
echo '---' >> "${GITHUB_WORKSPACE}/main/README.md"
echo "|Package | Version | Description | Attribute |" >> "${GITHUB_WORKSPACE}/main/README.md"
echo "|--------|---------|-------------|-----------|" >> "${GITHUB_WORKSPACE}/main/README.md"
cat "${SYSTMP}/nixpkgs.txt" >> "${GITHUB_WORKSPACE}/main/README.md"
echo -e "" >> "${GITHUB_WORKSPACE}/main/README.md"
echo '---' >> "${GITHUB_WORKSPACE}/main/README.md"
cat "${GITHUB_WORKSPACE}/main/README.md" > "${GITHUB_WORKSPACE}/main/README.md.txt"
sed 's/[\*\|]//g' "${SYSTMP}/nixpkgs.txt" > "${GITHUB_WORKSPACE}/main/nixpkgs.txt"
continue-on-error: true
- name: Generate index.html --> ("https://nixos-packages.ajam.dev")
run: |
#Presets
set +x ; set +e
#--------------#
#https://github.com/oscarmorrison/md-page
cat "${GITHUB_WORKSPACE}/main/.github/style.header" > "${GITHUB_WORKSPACE}/main/index.html"
echo "" >> "${GITHUB_WORKSPACE}/main/index.html"
#cat "${GITHUB_WORKSPACE}/main/README.md" >> "${GITHUB_WORKSPACE}/main/index.html"
sed -n "$(($(grep -n '|Package' "${GITHUB_WORKSPACE}/main/README.md" | cut -d ':' -f 1) - 1)),\$p" "${GITHUB_WORKSPACE}/main/README.md" >> "${GITHUB_WORKSPACE}/main/index.html"
echo "" >> "${GITHUB_WORKSPACE}/main/index.html"
cat "${GITHUB_WORKSPACE}/main/.github/style.footer" >> "${GITHUB_WORKSPACE}/main/index.html"
continue-on-error: true
- name: Get DateTime
run: |
#Presets
set +x ; set +e
#--------------#
# Date Time
NEPALI_TIME="$(TZ='Asia/Kathmandu' date +'%Y-%m-%d (%I:%M:%S %p)')"
echo "NEPALI_TIME=${NEPALI_TIME}" >> "${GITHUB_ENV}"
continue-on-error: true
- name: Git Pull
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main" && git pull origin main
continue-on-error: true
#Commit & Push
- uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./main
commit_user_name: Azathothas # defaults to "github-actions[bot]"
commit_user_email: AjamX101@gmail.com # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
commit_message: "✅ Update NixOS/nixpkgs ❄️📦 <-- ${{ env.NEPALI_TIME }} ⌚"
#push_options: '--force'