From e8c3b24e8bb9ee9085a171aee16f50e59cae9c2d Mon Sep 17 00:00:00 2001 From: nydragon Date: Tue, 18 Mar 2025 22:07:50 +0100 Subject: [PATCH] init --- flake.nix | 15 +++++++++++++++ package.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 flake.nix create mode 100644 package.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cb299c4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = + { self, nixpkgs }: + { + + packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.callPackage ./package.nix { }; + + }; +} diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..7f7f21b --- /dev/null +++ b/package.nix @@ -0,0 +1,31 @@ +{ + stdenv, + fetchFromGitHub, + python312Packages, + zip, + ... +}: +stdenv.mkDerivation { + name = "acsm-calibre-plugin"; + + src = fetchFromGitHub { + owner = "Leseratte10"; + repo = "acsm-calibre-plugin"; + rev = "97e6ddc1f13024c4406f2a6f2af1d9bca259fa84"; + hash = "sha256-uVPs6hgpIrWywcFkbSsGoIA4ZpBBk96zbNVhU4MsJ/Y="; + }; + + buildInputs = [ + python312Packages.oscrypto + python312Packages.asn1crypto + zip + ]; + + buildPhase = '' + zip calibre-plugin/oscrypto.zip ${python312Packages.oscrypto}/lib/python3.12/site-packages/oscrypto + zip calibre-plugin/asn1crypto.zip ${python312Packages.asn1crypto}/lib/python3.12/site-packages/asn1crypto + ls -la > $out + bash ./bundle_calibre_plugin.sh + cp calibre-plugin.zip $out + ''; +}