--- title: pm-user-repository related: - "[pm](pm.md)" categories: - Tools and applications - Package management --- The **pm user repository** is a community registry of package definitions for [pm](pm.md). Its `ur` module lets pm install packages from Lua definitions hosted in the repository: you write a short config, `ur` downloads and runs the definition, and pm uses the returned table to fetch, build and install the binary. ## How it works 1. You download `ur.lua` into your pm config directory. 2. Your `init.lua` requires it and calls `ur.Fetch { ... }` for each package. 3. `ur.Fetch` downloads the Lua file from the repository over HTTPS, loads it in text-only mode (which blocks bytecode injection) and `pcall`s it to get the table. 4. pm consumes the table to handle download, build and install. The `ur.Github` helper covers the common case: fetch a tarball from a GitHub repository, extract it, run `make` (or a custom build command) and return the artifact path. It can use `gh auth token` for authenticated API requests (5000 requests per hour instead of 60). ## Usage Download the module: ``` $ mkdir -p ~/.config/pm && curl -o ~/.config/pm/ur.lua https://raw.githubusercontent.com/hugoocoto/pm-user-repository/refs/heads/main/ur.lua ``` Then use it from `init.lua`: ``` local ur = require("ur") Packages = { ur.Fetch { user = "hugoocoto", file = "nvim-nightly/nvim.lua" }, ur.Fetch { user = "hugoocoto", file = "helium/helium.lua" }, } ``` ## Available packages | File | Package | |---|---| | `b/b.lua` | [b](b.md) web browser | | `dv/dv.lua` | [dv](dv.md) directory viewer | | `eqnx/eqnx.lua` | [eqnx](eqnx.md) (archived) | | `fetch/fetch.lua` | [fetch](fetch.md) system info fetcher | | `helium/helium.lua` | Helium AppImage | | `infinipaint/infinipaint.lua` | InfiniPaint painting application | | `isf/isf.lua` | [isf](isf.md) two-way folder sync over ssh | | `mybar/mybar.lua` | [mybar](mybar.md) Wayland status bar | | `nvim-nightly/nvim.lua` | Neovim nightly AppImage | | `pdfjoin/pdfjoin.lua` | [pdfjoin](pdfjoin.md) PDF merger | | `send2kodi/send2kodi.lua` | [send2kodi](send2kodi.md) links and local media to Kodi | | `st/st.lua` | [st](st.md) simple terminal | | `tetris/tetris.lua` | [tetris](tetris.md) terminal game | | `todo/todo.lua` | [todo](todo.md) task manager | | `tui-do/tui-do.lua` | [tui-do](tui-do.md) task list | | `vicel/vicel.lua` | [vicel](vicel.md) spreadsheet editor | | `wallpaper/wallpaper.lua` | [wallpaper](wallpapers.md) for Wayland | | `wl2kodi/wl2kodi.lua` | [wl2kodi](wl2kodi.md) screen mirroring to Kodi | | `yaci/yaci.lua` | [yaci](yaci.md) calculator REPL | | `zrun/zrun.lua` | [zrun](zrun.md) fuzzy launcher | All of them are under the `hugoocoto` user directory. ## Package format Each `.lua` file returns a table: | Field | Required | Description | |---|---|---| | `url` | Yes | Download URL for a source archive or binary | | `build` | Yes | Shell commands that produce the executable | | `name` | No | File name for the download (inferred from the URL if absent) | | `artifact` | Yes, unless `name` is set | Executable produced by `build` | | `last_modified_cmd` | No | Command to check the remote Last-Modified date | ``` return { url = "https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.appimage", name = "nvim", build = "chmod +x nvim", } ``` ## Contributing 1. Fork the repository. 2. Create a directory named after your GitHub username. 3. Add your `.lua` files inside it (subdirectories are fine, like `username/tool/tool.lua`). A `README.md` next to it renders on the [docs page](https://hugoocoto.github.io/pm-user-repository/docs/). 4. Open a pull request. CI validates the Lua syntax and the root structure. > [!WARNING] > Do not include tokens, passwords or private keys. Only `ur.lua` lives at > the root. ## See also - [Source code](https://github.com/hugoocoto/pm-user-repository) (MIT) - [Package documentation](https://hugoocoto.github.io/pm-user-repository/docs/)