Add nix package

This commit is contained in:
2026-01-15 17:49:04 +01:00
parent 2de091567c
commit 0fe0691ac1
4 changed files with 81 additions and 4 deletions

View File

@@ -35,3 +35,33 @@ jobs:
fi fi
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
nix-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- name: Evaluate Nix package
run: |
nix-instantiate --eval --strict -E 'let pkgs = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-24.05.tar.gz") {}; in pkgs.callPackage ./nix/imgfloat-client.nix {}' > /dev/null
debian-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- name: Build Debian package
run: npx electron-builder --linux deb --publish=never

View File

@@ -1,7 +1,3 @@
# Client # Client
Electron based desktop client for viewing the imgfloat broadcast dashboard. Electron based desktop client for viewing the imgfloat broadcast dashboard.
## "Why not use a web source?"
TODO

3
nix/default.nix Normal file
View File

@@ -0,0 +1,3 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.callPackage ./imgfloat-client.nix { }

48
nix/imgfloat-client.nix Normal file
View File

@@ -0,0 +1,48 @@
{ lib
, buildNpmPackage
, fetchFromGitHub
, makeWrapper
, electron
}:
buildNpmPackage rec {
pname = "imgfloat-client";
version = "1.0.5";
src = fetchFromGitHub {
owner = "imgfloat";
repo = "client";
rev = "v${version}";
hash = lib.fakeSha256;
};
npmDepsHash = lib.fakeSha256;
npmBuild = false;
npmFlags = [ "--ignore-scripts" ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ electron ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/imgfloat
cp -R src res package.json node_modules $out/share/imgfloat/
mkdir -p $out/bin
makeWrapper ${lib.getExe electron} $out/bin/imgfloat \
--add-flags $out/share/imgfloat/src/main.js \
--set-default ELECTRON_IS_DEV 0
runHook postInstall
'';
meta = with lib; {
description = "Electron based desktop client for viewing the imgfloat broadcast dashboard";
homepage = "https://github.com/imgfloat/client";
license = licenses.mit;
mainProgram = "imgfloat";
platforms = platforms.linux;
maintainers = [];
};
}