Make booster packages system-wide

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2023-07-13 17:40:23 +08:00
parent c693637faf
commit 2b5e037a47
7 changed files with 52 additions and 76 deletions

5
README
View File

@ -9,7 +9,4 @@
* sudo nix-collect-garbage -d * sudo nix-collect-garbage -d
* history clear * history clear
Add-on for Boosters: Add-on for Boosters: uncomment packages in configuration.nix before auto-install.
* copy `booster` to the /opt
* mkdir -p ~/.config/nixpkgs && echo '{permittedInsecurePackages = ["electron-9*"];}' > ~/.config/nixpkgs/config.nix
* echo 'For Booster-related apps, use `nix-shell /opt/booster/booster_shell.nix`' > ~/README.md

View File

@ -1,27 +0,0 @@
let
pkgs = import <nixpkgs> { };
mqtt-explorer = pkgs.callPackage /opt/booster/mqtt-explorer.nix {} ;
gmqtt = pkgs.callPackage /opt/booster/gmqtt.nix {};
miniconf = pkgs.callPackage /opt/booster/miniconf.nix {};
in
pkgs.mkShell {
buildInputs = [
(pkgs.python3.withPackages(ps: [
ps.numpy
ps.setuptools
ps.matplotlib
gmqtt
miniconf
]))
pkgs.libtool
pkgs.libusb1
pkgs.mosquitto
pkgs.libftdi
pkgs.cutecom
mqtt-explorer
];
}

View File

@ -4,23 +4,23 @@ python3Packages.buildPythonPackage rec {
name = "gmqtt"; name = "gmqtt";
version = "v0.6.12"; version = "v0.6.12";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "wialon" ; owner = "wialon";
repo = "gmqtt"; repo = "gmqtt";
rev = "190d12156890efcfc5099fea0f7ef3ce072c4a27" ; rev = "190d12156890efcfc5099fea0f7ef3ce072c4a27";
sha256 = "sha256-lhvRRZsrJy2U7b705GTlquAP/LwKEmInuVC4zzivmKk="; sha256 = "sha256-lhvRRZsrJy2U7b705GTlquAP/LwKEmInuVC4zzivmKk=";
}; };
buildInputs = [ buildInputs = [
(pkgs.python3.withPackages(ps: [ (pkgs.python3.withPackages (ps: [
ps.codecov ps.codecov
ps.pytest-asyncio ps.pytest-asyncio
ps.pytest ps.pytest
ps.pytestcov ps.pytestcov
ps.six ps.six
ps.uvloop ps.uvloop
ps.more-itertools ps.more-itertools
ps.atomicwrites ps.atomicwrites
])) ]))
]; ];
propagatedBuildInputs = with pkgs.python3Packages; [ setproctitle ]; propagatedBuildInputs = with pkgs.python3Packages; [ setproctitle ];

View File

@ -1,22 +1,20 @@
{ stdenv, lib, python3Packages, callPackage, fetchgit, makeWrapper }: { stdenv, lib, python3Packages, callPackage, fetchgit, makeWrapper }:
let let gmqtt = callPackage ./gmqtt.nix { };
gmqtt = callPackage /opt/booster/gmqtt.nix {}; in python3Packages.buildPythonPackage rec {
in pname = "miniconf";
python3Packages.buildPythonPackage rec { version = "0.1.0";
pname = "miniconf"; src = fetchgit {
version = "0.1.0"; url = "https://github.com/quartiq/miniconf";
src = fetchgit { rev = "01caac4adb3f81cbcd34d8a48087f5df962c096f";
url = "https://github.com/quartiq/miniconf"; sha256 = "sha256-Gco56sl2mQ2y+M1evzLhtuFvrhJZbAvbIq7N6J9uiFE=";
rev = "01caac4adb3f81cbcd34d8a48087f5df962c096f"; };
sha256 = "sha256-ssRV4FtdMehPA4+mKQ4Ub+wtEakpKX5jXRubFtHpanA="; prePatch = ''
}; cd py/miniconf-mqtt
prePatch = '' '';
cd py/miniconf-mqtt doCheck = false;
''; propagatedBuildInputs = [
doCheck = false;
propagatedBuildInputs = [
# Specify dependencies # Specify dependencies
gmqtt gmqtt
]; ];
} }

View File

@ -1,20 +1,18 @@
{ stdenv, lib, fetchurl, appimageTools, electron_9, makeWrapper }: { stdenvNoCC, lib, fetchurl, appimage-run, makeWrapper, symlinkJoin }:
stdenv.mkDerivation rec { let
pname = "MQTT-Explorer"; pname = "MQTT-Explorer";
version = "0.4.0-beta1"; version = "0.4.0-beta1";
src = appimageTools.extract { mqtt-explorer = fetchurl {
name = pname; url ="https://github.com/thomasnordquist/${pname}/releases/download/0.0.0-${version}/${pname}-${version}.AppImage";
src = fetchurl { sha256 = "0x9ava13hn1nkk2kllh5ldi4b3hgmgwahk08sq48yljilgda4ppn";
url = "https://github.com/thomasnordquist/${pname}/releases/download/0.0.0-${version}/${pname}-${version}.AppImage";
sha256 = "0x9ava13hn1nkk2kllh5ldi4b3hgmgwahk08sq48yljilgda4ppn";
};
}; };
in symlinkJoin {
name = "mqtt-explorer";
paths = [ appimage-run ];
buildInputs = [ makeWrapper ]; buildInputs = [ makeWrapper ];
installPhase = '' postBuild = ''
install -m 444 -D resources/app.asar $out/libexec/app.asar mv $out/bin/appimage-run $out/bin/mqtt-explorer
install -m 444 -D mqtt-explorer.png $out/share/icons/mqtt-explorer.png wrapProgram $out/bin/mqtt-explorer --add-flags "${mqtt-explorer}"
install -m 444 -D mqtt-explorer.desktop $out/share/applications/mqtt-explorer.desktop
makeWrapper ${electron_9}/bin/electron $out/bin/mqtt-explorer --add-flags $out/libexec/app.asar
''; '';
} }

View File

@ -40,6 +40,7 @@ let
mount /dev/disk/by-label/boot /mnt/boot mount /dev/disk/by-label/boot /mnt/boot
nixos-generate-config --root /mnt nixos-generate-config --root /mnt
cp ${./final}/* /mnt/etc/nixos cp ${./final}/* /mnt/etc/nixos
cp ${./booster}/* /mnt/etc/nixos/
nixos-install --no-root-password --flake /mnt/etc/nixos#artiq nixos-install --no-root-password --flake /mnt/etc/nixos#artiq
''; '';

View File

@ -55,6 +55,9 @@
pyserial pyserial
spyder spyder
artiq.packages.x86_64-linux.artiq artiq.packages.x86_64-linux.artiq
## Booster python packages:
# (callPackage ./gmqtt.nix { })
# (callPackage ./miniconf.nix { })
])) ]))
artiq.packages.x86_64-linux.openocd-bscanspi artiq.packages.x86_64-linux.openocd-bscanspi
texlive.combined.scheme-full texlive.combined.scheme-full
@ -69,6 +72,12 @@
gnome3.gnome-tweaks gnome3.gnome-tweaks
libreoffice-fresh libreoffice-fresh
vscode vscode
## Booster packages:
# mosquitto
# libftdi
# libusb1
# cutecom
# (pkgs.callPackage ./mqtt-explorer.nix { })
]; ];
programs.wireshark.enable = true; programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark; programs.wireshark.package = pkgs.wireshark;