Merge pull request 'brian/flake' (#4) from brian/flake into main
Reviewed-on: #4
This commit is contained in:
228
README.md
Normal file
228
README.md
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
# PinePods Nix Package
|
||||||
|
|
||||||
|
A Nix/NixOS package for [PinePods](https://github.com/madeofpendletonwool/PinePods), a self-hosted podcast manager. This packages the PinePods desktop client (Tauri v2) for NixOS.
|
||||||
|
|
||||||
|
> **Note:** PinePods is a client/server application. You will need a running PinePods server instance to use this package. See the [PinePods documentation](https://github.com/madeofpendletonwool/PinePods) for server setup instructions.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- NixOS
|
||||||
|
- A running PinePods server (self-hosted)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Option 1: NixOS Module via Flake (recommended)
|
||||||
|
|
||||||
|
Add PinePods as a flake input in your system `flake.nix`:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||||
|
|
||||||
|
pinepods.url = "git+https://git.briannelson.dev/brian/PinePods-nix";
|
||||||
|
pinepods.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, pinepods, ... }: {
|
||||||
|
nixosConfigurations.mymachine = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
pinepods.nixosModules.pinepods
|
||||||
|
{
|
||||||
|
services.pinepods = {
|
||||||
|
enable = true;
|
||||||
|
# Your server address
|
||||||
|
server = "https://pinepods.example.com";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then rebuild your system:
|
||||||
|
```bash
|
||||||
|
sudo nixos-rebuild switch
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Option 2: NixOS Module without Flakes
|
||||||
|
|
||||||
|
Clone this repository:
|
||||||
|
```bash
|
||||||
|
git clone https://git.briannelson.dev/brian/PinePods-nix.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Add the module to your `/etc/nixos/configuration.nix`:
|
||||||
|
```nix
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
/path/to/pinepods-nix/pinepods-module.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
services.pinepods = {
|
||||||
|
enable = true;
|
||||||
|
# Your server address
|
||||||
|
server = "https://pinepods.example.com";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then rebuild your system:
|
||||||
|
```bash
|
||||||
|
sudo nixos-rebuild switch
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Option 3: Install to user profile with nix-env
|
||||||
|
|
||||||
|
Clone this repository:
|
||||||
|
```bash
|
||||||
|
git clone https://git.briannelson.dev/brian/PinePods-nix.git
|
||||||
|
cd pinepods-nix
|
||||||
|
```
|
||||||
|
|
||||||
|
Install to your user profile:
|
||||||
|
```bash
|
||||||
|
nix-env -f default.nix -iA pinepods
|
||||||
|
```
|
||||||
|
|
||||||
|
This is persistent across reboots. To uninstall:
|
||||||
|
```bash
|
||||||
|
nix-env -e pinepods
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note:** With this option the `server` URL cannot be pre-configured. You will need to enter it manually in the app on first launch.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Module Options
|
||||||
|
|
||||||
|
| Option | Type | Default | Description |
|
||||||
|
|--------|------|---------|-------------|
|
||||||
|
| `services.pinepods.enable` | bool | `false` | Enable the PinePods desktop client |
|
||||||
|
| `services.pinepods.server` | string | `""` | URL of your PinePods server (e.g. `https://pinepods.example.com`) |
|
||||||
|
|
||||||
|
When `server` is set, the app will navigate directly to your server on launch. If left empty, the app will open to a blank page and you will need to navigate to your server manually in the address bar.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
pinepods-nix/
|
||||||
|
├── flake.nix # Nix flake definition
|
||||||
|
├── default.nix # Package definition entry point (non-flake)
|
||||||
|
├── pinepods.nix # Main package derivation
|
||||||
|
├── pinepods-module.nix # NixOS module definition
|
||||||
|
├── patch-lib.py # Build-time patch for server URL support
|
||||||
|
├── example-usage-flake.nix # Example flake for users
|
||||||
|
├── Cargo.lock # Cargo lockfile for src-tauri (Tauri binary)
|
||||||
|
└── Cargo.frontend.lock # Cargo lockfile for web/ (Yew/WASM frontend)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How It Works
|
||||||
|
|
||||||
|
PinePods is a multi-component application. This package builds two components from source:
|
||||||
|
|
||||||
|
**Frontend (pinepods-frontend):** The Yew/WASM web frontend is compiled using `trunk` targeting `wasm32-unknown-unknown`. The output is a static `dist/` directory containing HTML, WASM, and CSS assets.
|
||||||
|
|
||||||
|
**Desktop client (pinepods):** The Tauri v2 desktop binary is compiled with `cargo`, with the pre-built frontend assets embedded directly into the binary via the `custom-protocol` feature. At build time, `tauri.conf.json` is patched to remove the `devUrl` so Tauri serves the embedded assets instead of connecting to a development server. The Rust source is also patched to read the `PINEPODS_SERVER` environment variable and navigate the app window to that URL on launch.
|
||||||
|
|
||||||
|
**Runtime dependencies** are provided via `wrapProgram`:
|
||||||
|
- WebKit2GTK 4.1 (Tauri v2 requirement)
|
||||||
|
- GStreamer + plugins (audio playback)
|
||||||
|
- libayatana-appindicator (system tray icon)
|
||||||
|
- GLib/GTK3/Cairo stack
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Building from Source
|
||||||
|
|
||||||
|
To build manually without installing:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://git.briannelson.dev/brian/PinePods-nix.git
|
||||||
|
cd pinepods-nix
|
||||||
|
nix-build -A pinepods
|
||||||
|
./result/bin/pinepods
|
||||||
|
```
|
||||||
|
|
||||||
|
To use the dev shell with all build tools available:
|
||||||
|
```bash
|
||||||
|
nix develop
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Updating to a New Version of PinePods
|
||||||
|
*This project is still a WIP so I have not been able to test these step until a new version of PinePods gets released*
|
||||||
|
|
||||||
|
To update to a new PinePods release:
|
||||||
|
|
||||||
|
1. Update the `version` and `sha256` in `pinepods.nix`:
|
||||||
|
```nix
|
||||||
|
version = "0.8.3"; # new version
|
||||||
|
sha256 = "..."; # run nix-build and paste the correct hash from the error
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Replace the Cargo lockfiles with the new versions:
|
||||||
|
```bash
|
||||||
|
curl -L https://github.com/madeofpendletonwool/PinePods/archive/refs/tags/0.8.3.tar.gz | tar xz
|
||||||
|
cp PinePods-0.8.3/web/Cargo.lock ./Cargo.frontend.lock
|
||||||
|
cp PinePods-0.8.3/web/src-tauri/Cargo.lock ./Cargo.lock
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Check if the `wasm-bindgen` version changed:
|
||||||
|
```bash
|
||||||
|
grep "wasm-bindgen" PinePods-0.8.3/web/Cargo.toml
|
||||||
|
```
|
||||||
|
If it changed, update `wasm-bindgen-cli` in `default.nix` and `TRUNK_TOOLS_WASM_BINDGEN` in `pinepods.nix` accordingly.
|
||||||
|
|
||||||
|
4. Rebuild and test:
|
||||||
|
```bash
|
||||||
|
nix-build -A pinepods
|
||||||
|
./result/bin/pinepods
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
**White screen on launch**
|
||||||
|
Make sure `WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1` is set. This is handled automatically by the package wrapper.
|
||||||
|
|
||||||
|
**No audio playback**
|
||||||
|
GStreamer plugins are included but if audio still doesn't work, check that your system has the required codec support:
|
||||||
|
```bash
|
||||||
|
gst-inspect-1.0 autoaudiosink
|
||||||
|
gst-inspect-1.0 appsink
|
||||||
|
```
|
||||||
|
|
||||||
|
**Login doesn't persist between sessions**
|
||||||
|
This is a known limitation of the WebKit localStorage implementation. As a workaround, set `services.pinepods.server` in your NixOS configuration so the app always navigates to your server on launch.
|
||||||
|
|
||||||
|
**Tray icon shows generic icon**
|
||||||
|
The icon is installed under the app's reverse-DNS identifier `com.gooseberrydevelopment.pinepods`. Make sure your icon theme cache is up to date:
|
||||||
|
```bash
|
||||||
|
gtk-update-icon-cache
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This Nix packaging is provided as-is. PinePods itself is licensed under GPL-3.0. See the [PinePods repository](https://github.com/madeofpendletonwool/PinePods) for details.
|
||||||
34
example-useage-flake.nix
Normal file
34
example-useage-flake.nix
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
description = "Example NixOS configuration using the PinePods flake";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||||
|
|
||||||
|
pinepods.url = "git+https://git.briannelson.dev/brian/pinepods-nix";
|
||||||
|
# If you want to ensure pinepods uses the same nixpkgs as your system
|
||||||
|
pinepods.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, pinepods, ... }: {
|
||||||
|
nixosConfigurations.mymachine = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
# Import the PinePods NixOS module
|
||||||
|
pinepods.nixosModules.pinepods
|
||||||
|
|
||||||
|
({ config, pkgs, ... }: {
|
||||||
|
# Enable PinePods and point it at your server
|
||||||
|
services.pinepods = {
|
||||||
|
enable = true;
|
||||||
|
server = "https://pinepods.example.com";
|
||||||
|
};
|
||||||
|
|
||||||
|
# The rest of your normal NixOS configuration goes here...
|
||||||
|
# networking.hostName = "mymachine";
|
||||||
|
# users.users.youruser = { ... };
|
||||||
|
# etc.
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1772822230,
|
||||||
|
"narHash": "sha256-yf3iYLGbGVlIthlQIk5/4/EQDZNNEmuqKZkQssMljuw=",
|
||||||
|
"owner": "NixOs",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "71caefce12ba78d84fe618cf61644dce01cf3a96",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOs",
|
||||||
|
"ref": "nixos-25.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
66
flake.nix
Normal file
66
flake.nix
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
description = "Pinepods desktop client - self-hosted podcast manager";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOs/nixpkgs/nixos-25.11";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = import nixpkgs { inherit system; config = {}; overlays = []; };
|
||||||
|
|
||||||
|
makePinepods = { serverUrl ? "" }:
|
||||||
|
pkgs.callPackage ./pinepods.nix {
|
||||||
|
wasm-bindgen-cli = pkgs.wasm-bindgen-cli_0_2_105;
|
||||||
|
inherit (pkgs) binaryen tailwindcss_3 libayatana-appindicator gst_all_1 python3;
|
||||||
|
inherit serverUrl;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.${system} = {
|
||||||
|
pinepods = makePinepods { };
|
||||||
|
default = makePinepods { };
|
||||||
|
};
|
||||||
|
|
||||||
|
nixosModules.pinepods = { config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.pinepods;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.pinepods = {
|
||||||
|
enable = lib.mkEnableOption "PinePods podcast manager";
|
||||||
|
|
||||||
|
server = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
example = "https://pinepods.example.com";
|
||||||
|
description = ''
|
||||||
|
The URL oof your self-hosted PinePods server.
|
||||||
|
The app will navigate directly to this address on launch.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [
|
||||||
|
(makePinepods { serverUrl = cfg.server; })
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nixosModules.default = self.nixosModules.pinepods;
|
||||||
|
|
||||||
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
trunk
|
||||||
|
wasm-bindgen-cli_0_2_105
|
||||||
|
cargo
|
||||||
|
rustc
|
||||||
|
llvmPackages.lld
|
||||||
|
binaryen
|
||||||
|
tailwindcss_3
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user