ASF-ui: init
This commit is contained in:
parent
bf30cd48ed
commit
98ccbafb05
5 changed files with 7987 additions and 0 deletions
40
pkgs/applications/misc/ArchiSteamFarm/web-ui/default.nix
Normal file
40
pkgs/applications/misc/ArchiSteamFarm/web-ui/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ lib, pkgs, fetchFromGitHub, nodejs, stdenv, ArchiSteamFarm, ... }:
|
||||
|
||||
let
|
||||
nodePackages = import ./node-composition.nix {
|
||||
inherit pkgs nodejs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "JustArchiNET";
|
||||
repo = "ASF-ui";
|
||||
# updated by the update script
|
||||
# this is always the commit that should be used with asf-ui from the latest asf version
|
||||
rev = "3be40800a37ff0dbf43dd821af0d7498c23a5a52";
|
||||
sha256 = "0mvpp6pw5ld23f56g6rmgiq4mwwwqhh55dn6zsjdylfj8sqisdx8";
|
||||
};
|
||||
|
||||
in
|
||||
nodePackages.package.override {
|
||||
inherit src;
|
||||
|
||||
# upstream isn't tagged, but we are using the latest official commit for that specific asf version (assuming both get updated at the same time)
|
||||
version = ArchiSteamFarm.version;
|
||||
|
||||
nativeBuildInputs = [ pkgs.nodePackages.node-gyp-build ];
|
||||
|
||||
postInstall = ''
|
||||
patchShebangs node_modules/
|
||||
npm run build
|
||||
ln -s $out/lib/node_modules/asf-ui/dist $out/lib/dist
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "The official web interface for ASF";
|
||||
license = licenses.apsl20;
|
||||
homepage = "https://github.com/JustArchiNET/ASF-ui";
|
||||
platforms = ArchiSteamFarm.meta.platforms;
|
||||
maintainers = with maintainers; [ lom ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
# This file has been generated by node2nix 1.9.0. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-14_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ../../../../development/node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
|
||||
inherit pkgs nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
7903
pkgs/applications/misc/ArchiSteamFarm/web-ui/node-packages.nix
generated
Normal file
7903
pkgs/applications/misc/ArchiSteamFarm/web-ui/node-packages.nix
generated
Normal file
File diff suppressed because it is too large
Load diff
26
pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh
Executable file
26
pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nodePackages.node2nix jq curl
|
||||
|
||||
version=$(nix-instantiate --strict --eval -A ArchiSteamFarm.version | jq -r)
|
||||
ui=$(curl https://api.github.com/repos/JustArchiNET/ArchiSteamFarm/contents/ASF-ui?ref=${version} | jq -r .sha)
|
||||
|
||||
pushd $(dirname "$0")
|
||||
|
||||
# update-source-version doesn't work for some reason
|
||||
sed -i "s/rev\\s*=\\s*.*/rev = \"$ui\";/" default.nix
|
||||
sed -i "s/sha256\\s*=\\s*.*/sha256 = \"$(nix-prefetch-url --unpack https://github.com/JustArchiNET/ASF-ui/archive/$ui.tar.gz)\";/" default.nix
|
||||
|
||||
curl https://raw.githubusercontent.com/JustArchiNET/ASF-ui/${ui}/package-lock.json -o package-lock.json
|
||||
curl https://raw.githubusercontent.com/JustArchiNET/ASF-ui/${ui}/package.json -o package.json
|
||||
|
||||
|
||||
node2nix \
|
||||
--nodejs-14 \
|
||||
--development \
|
||||
--lock package-lock.json \
|
||||
--node-env ../../../../development/node-packages/node-env.nix \
|
||||
--output node-packages.nix \
|
||||
--composition node-composition.nix \
|
||||
|
||||
popd
|
||||
rm package.json package-lock.json
|
|
@ -1294,6 +1294,7 @@ with pkgs;
|
|||
aptly = callPackage ../tools/misc/aptly { };
|
||||
|
||||
ArchiSteamFarm = callPackage ../applications/misc/ArchiSteamFarm { };
|
||||
ASF-ui = callPackage ../applications/misc/ArchiSteamFarm/web-ui { };
|
||||
|
||||
archivebox = python3Packages.callPackage ../applications/misc/archivebox { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue