mirror of
https://github.com/icewind1991/cynthion-flake.git
synced 2026-06-03 14:24:07 +02:00
init flake
This commit is contained in:
commit
a6d41bbaa3
17 changed files with 623 additions and 0 deletions
91
pkgs/cynthion/default.nix
Normal file
91
pkgs/cynthion/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildPythonPackage,
|
||||
python3Packages,
|
||||
pkgs,
|
||||
setuptools,
|
||||
setuptools-git-versioning,
|
||||
libusb1,
|
||||
pyusb,
|
||||
tomli,
|
||||
future,
|
||||
prompt-toolkit,
|
||||
tabulate,
|
||||
tqdm,
|
||||
pyserial,
|
||||
amaranth-041,
|
||||
luna-usb,
|
||||
luna-soc,
|
||||
apollo-fpga,
|
||||
pyfwup,
|
||||
pygreat-2024,
|
||||
zsh,
|
||||
yosys,
|
||||
nextpnr,
|
||||
trellis,
|
||||
}: let
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
pname = "cynthion";
|
||||
version = "0.1.0";
|
||||
|
||||
outputs = ["out" "udev"];
|
||||
pyproject = true;
|
||||
|
||||
src = import ./src.nix fetchFromGitHub;
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
setuptools-git-versioning
|
||||
zsh
|
||||
yosys
|
||||
nextpnr
|
||||
trellis
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
libusb1
|
||||
pyusb
|
||||
tomli
|
||||
future
|
||||
prompt-toolkit
|
||||
tabulate
|
||||
tqdm
|
||||
pyserial
|
||||
amaranth-041
|
||||
luna-usb
|
||||
luna-soc
|
||||
apollo-fpga
|
||||
pyfwup
|
||||
pygreat-2024
|
||||
trellis
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace cynthion/python/Makefile \
|
||||
--replace-fail 'SHELL := /bin/zsh' "SHELL := ${zsh}/bin/zsh"
|
||||
substituteInPlace cynthion/python/src/commands/util.py \
|
||||
--replace-fail "module_path, '../../assets/'" "\"$out/share/assets/\""
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
cd cynthion/python
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $udev/lib/udev/rules.d
|
||||
cp assets/54-cynthion.rules $udev/lib/udev/rules.d/54-cynthion.rules
|
||||
|
||||
make bitstreams
|
||||
mkdir -p $out/share
|
||||
ls -l
|
||||
cp -r assets $out/share
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Cynthion is an all-in-one tool for building, testing, monitoring, and experimenting with USB device";
|
||||
homepage = "https://github.com/greatscottgadgets/cynthion";
|
||||
license = lib.licenses.bsd3;
|
||||
};
|
||||
}
|
||||
6
pkgs/cynthion/src.nix
Normal file
6
pkgs/cynthion/src.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
fetchFromGitHub: fetchFromGitHub {
|
||||
owner = "greatscottgadgets";
|
||||
repo = "cynthion";
|
||||
rev = "db0fb8ecfee1c153219f029c0db627c6805e3d59";
|
||||
hash = "sha256-BrxoRJ8bKBTENJgbYpi/fEHdCYThJEzKftH2Xo3u/3U=";
|
||||
}
|
||||
18
pkgs/cynthion/udev.nix
Normal file
18
pkgs/cynthion/udev.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
fetchFromGitHub,
|
||||
stdenvNoCC,
|
||||
...
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "cynthion-udev";
|
||||
version = "0.1.0";
|
||||
dontBuild = true;
|
||||
dontFixup = true;
|
||||
|
||||
src = import ./src.nix fetchFromGitHub;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/udev/rules.d
|
||||
cp cynthion/python/assets/54-cynthion.rules $out/lib/udev/rules.d/54-cynthion.rules
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue