This commit is contained in:
Lucy Hochkamp 2025-08-26 00:58:27 +02:00
parent 414e830efa
commit d3a93fd115
No known key found for this signature in database
35 changed files with 1832 additions and 228 deletions

45
packages/caddy-desec.nix Normal file
View file

@ -0,0 +1,45 @@
{ lib, caddy, buildGoModule, stdenv, xcaddy, cacert, git, go, ... }:
caddy.override {
buildGoModule = args: buildGoModule (args // {
src = stdenv.mkDerivation rec {
pname = "caddy-using-xcaddy-${xcaddy.version}";
inherit (caddy) version;
dontUnpack = true;
dontFixup = true;
nativeBuildInputs = [
cacert
git
go
];
plugins = [
"github.com/caddy-dns/desec@v1.0.1"
];
configurePhase = ''
export GOCACHE=$TMPDIR/go-cache
export GOPATH="$TMPDIR/go"
export XCADDY_SKIP_BUILD=1
'';
buildPhase = ''
${xcaddy}/bin/xcaddy build "${lib.last (lib.splitString "/" caddy.src.rev)}" ${lib.concatMapStringsSep " " (plugin: "--with ${plugin}") plugins}
cd buildenv*
go mod vendor
'';
installPhase = ''
cp -r --reflink=auto . $out
'';
outputHash = "sha256-r4+WK8UhGLAuIvdV6uiH2bMh/SjTfY4CzKcpHU0Gu5s=";
outputHashMode = "recursive";
};
subPackages = [ "." ];
ldflags = [ "-s" "-w" ]; ## don't include version info twice
vendorHash = null;
});
}

View file

@ -0,0 +1,53 @@
{
lib,
fetchFromGitHub,
python3Packages,
python-uhid
}:
python3Packages.buildPythonApplication rec {
pname = "fido2-hid-bridge";
version = "0.1.0";
pyproject = true;
doCheck = false;
src = fetchFromGitHub {
owner = "thexyno";
repo = "fido2-hid-bridge";
rev = "a61ca02f6c5c0b3762704589f9fe07b161b0cfcc";
hash = "sha256-uE4C3maVNf7UkeI4OBeBY75XJx115bUalvfaNc+Qyv4=";
};
dependencies = [
python3Packages.poetry-core
python3Packages.fido2_2
python3Packages.pyscard
python-uhid
python3Packages.flake8
];
# nativeCheckInputs =
# with python3Packages;
# [
# pytestCheckHook
# pytest-cov-stub
# mock
# pillow
# typeguard
# ]
# ++ [
# writableTmpDirAsHomeHook
# ];
meta = {
description = "a Linux virtual USB-HID FIDO2 Device that forwards CTAP2.1 commands to an attached PC/SC authenticator";
homepage = "https://github.com/BryanJacobs/fido2-hid-bridge/";
maintainers = with lib.maintainers; [
# TODO
];
license = lib.licenses.mit;
};
}

53
packages/uhid.nix Normal file
View file

@ -0,0 +1,53 @@
{
lib,
fetchPypi,
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "python-uhid";
version = "0.0.1";
pyproject = true;
doCheck = false;
src = fetchPypi {
inherit version;
pname = "uhid";
hash = "sha256-PHgkiYkNvzNiH7LDDRrIH7wbPvGRGufUxzkHzcD1mqs=";
};
propagatedBuildInputs = [
python3Packages.setuptools
];
dependencies = [
# python3Packages.poetry-core
# python3Packages.fido2
# python3Packages.pyscard
# python3Packages.uhid
];
# nativeCheckInputs =
# with python3Packages;
# [
# pytestCheckHook
# pytest-cov-stub
# mock
# pillow
# typeguard
# ]
# ++ [
# writableTmpDirAsHomeHook
# ];
meta = {
description = "Pure Python typed UHID wrapper.";
homepage = "https://github.com/FFY00/python-uhid/";
maintainers = with lib.maintainers; [
# TODO
];
license = lib.licenses.mit;
};
}