kryoflux: init at 3.50 (#423548)

This commit is contained in:
Matthew Croughan 2025-07-15 19:00:08 +01:00 committed by GitHub
commit ab7ac10545
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.kryoflux;
in
{
options.programs.kryoflux = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enables kryoflux udev rules, ensures 'floppy' group exists. This is a
prerequisite to using devices supported by kryoflux without being root,
since kryoflux device descriptors will be owned by floppy through udev.
'';
};
package = lib.mkPackageOption pkgs "kryoflux" { };
};
config = lib.mkIf cfg.enable {
services.udev.packages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
users.groups.floppy = { };
};
meta.maintainers = with lib.maintainers; [ matthewcroughan ];
}

View File

@ -0,0 +1,54 @@
{
stdenv,
lib,
autoPatchelfHook,
fetchurl,
makeWrapper,
jre,
fmt_9,
libusb1,
}:
stdenv.mkDerivation (finalAttrs: {
name = "kryoflux";
version = "3.50";
src = fetchurl {
url = "https://www.kryoflux.com/download/kryoflux_${finalAttrs.version}_linux_r2.tar.gz";
hash = "sha256-qGFXu0FkmCB7cffOqNiOluDUww19MA/UuEVElgmSd3o=";
};
nativeBuildInputs = [
makeWrapper
autoPatchelfHook
];
buildInputs = [
fmt_9
libusb1
];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share/java
cp -r {docs,testimages,schematics} $out/share
cp dtc/kryoflux-ui.jar $out/share/java
makeWrapper ${jre}/bin/java $out/bin/kryoflux-ui \
--add-flags "-jar $out/share/java/kryoflux-ui.jar" \
--set PATH "$out/bin"
tar -C $out -xf dtc/${stdenv.hostPlatform.linuxArch}/kryoflux-dtc*.tar.gz \
--strip-components=1 \
--wildcards '*/bin/*' '*/lib/*' '*/share/*'
mkdir -p $out/etc/udev/rules.d
echo 'ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="6124", GROUP="floppy", MODE="0660"' > 80-kryoflux.rules
runHook postInstall
'';
meta = {
description = "Software UI to accompany KryoFlux, the renowned forensic floppy controller";
homepage = "https://kryoflux.com";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ matthewcroughan ];
mainProgram = "kryoflux-ui";
platforms = with lib.platforms; lib.intersectLists linux (x86_64 ++ aarch64);
};
})