Nix flake with a dev shell for everything

nix develop: Go, gopls, shellcheck, make, curl, jq, Python, Node.js,
oxipng and ImageMagick; on Linux also Ghostty, Xvfb, xdotool, DejaVu fonts
and Chromium for the README screenshots and the webOS app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 18:16:05 +01:00
co-authored by Claude Opus 5.5
parent 7f6d4d07b9
commit 0dedcb3893
6 changed files with 96 additions and 3 deletions
+2
View File
@@ -140,6 +140,8 @@ TV's Developer Mode; see [webos/README.md](webos/README.md).
## Development
`nix develop` opens a shell with everything below (Go, shellcheck, Node.js, Python, the screenshot
tools and Chromium; the flake is in [flake.nix](flake.nix)); without Nix, install what you use.
`dev/` has a compose file with pinned Radarr, Sonarr and SABnzbd containers plus a fake indexer;
see [dev/README.md](dev/README.md).
`make test` runs vet and the unit tests. The screenshots are made with
+2 -2
View File
@@ -7,8 +7,8 @@ keys (masked in the Config view anyway).
```sh
dev/screenshots/take.sh
# on NixOS, with the tools from nixpkgs:
nix-shell -p xvfb-run xorg-server xdotool imagemagick oxipng --run dev/screenshots/take.sh
# with Nix, everything from the flake's dev shell:
nix develop --command dev/screenshots/take.sh
```
Needs Go, Python 3, Ghostty, `xvfb-run` (Xvfb), `xdotool`, ImageMagick 7 and fontconfig with the
+1 -1
View File
@@ -5,7 +5,7 @@
#
# Needs: go, python3, ghostty, xvfb-run (Xvfb), xdotool, ImageMagick 7,
# fontconfig with DejaVu fonts; oxipng optional. On NixOS:
# nix-shell -p xvfb-run xorg-server xdotool imagemagick oxipng --run dev/screenshots/take.sh
# nix develop --command dev/screenshots/take.sh
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
repo=$(cd "$here/../.." && pwd)
Generated
+27
View File
@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1792773339,
"narHash": "sha256-rZLrzrC6i+jnTAlvPZHogKDulY7WWDEv9hJeHieO7Zw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3ec636362e1816bc2f0888fa0fa2c69f1bc9e504",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+62
View File
@@ -0,0 +1,62 @@
{
description = "arr-tui: a terminal UI (and webOS TV app) for Radarr, Sonarr and SABnzbd";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAll = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in
{
# nix develop: everything make test, the release script, the README
# screenshots (dev/screenshots) and the webOS app (webos/) need.
# Containers for dev/up.sh (docker or podman) come from the system.
devShells = forAll (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
# arr-tui
go
gopls
gnumake
shellcheck
git
# scripts/release.sh, dev/up.sh
curl
jq
# dev/screenshots (fake services), webos (app, tests, ares CLI)
python3
nodejs_24
# README pictures: oxipng compresses them
oxipng
imagemagick
] ++ lib.optionals stdenv.hostPlatform.isLinux [
# dev/screenshots/take.sh: Ghostty on a virtual X display
ghostty
xvfb-run
xorg-server
xdotool
fontconfig
dejavu_fonts
# webos/dev/drive.mjs
chromium
];
# posters.sh asks fontconfig for the DejaVu fonts: the system's
# fonts plus DejaVu.
FONTCONFIG_FILE = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux (pkgs.writeText "fonts.conf" ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<include ignore_missing="yes">/etc/fonts/fonts.conf</include>
<dir>${pkgs.dejavu_fonts}/share/fonts</dir>
</fontconfig>
'');
shellHook = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux ''
export CHROMIUM=${pkgs.chromium}/bin/chromium
'';
};
});
};
}
+2
View File
@@ -77,6 +77,8 @@ The app targets webOS 5 (2020 TVs, Chromium 68) and newer.
## Development
`nix develop` in the repository has Node.js and Chromium (and sets `$CHROMIUM`).
```sh
npm run typecheck
npm test # unit tests (Node's test runner)