summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2026-05-31 15:11:59 +0200
committerquentin@aristote.fr <quentin@aristote.fr>2026-05-31 15:11:59 +0200
commit205ee4aaf4a3fa733e83305b4b1c92a629ce8ca7 (patch)
tree25afd7bbf66ecc222f25a37c0584d16e8abe3205
downloadade-dedrm-master.tar.gz
ade-dedrm-master.tar.bz2
ade-dedrm-master.tar.xz
initial commitHEADmaster
-rw-r--r--.gitignore2
-rw-r--r--devenv.lock228
-rw-r--r--devenv.nix115
-rw-r--r--devenv.yaml10
4 files changed, 355 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..495e527
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+DeDRM
+wine \ No newline at end of file
diff --git a/devenv.lock b/devenv.lock
new file mode 100644
index 0000000..be6edf0
--- /dev/null
+++ b/devenv.lock
@@ -0,0 +1,228 @@
+{
+ "nodes": {
+ "devenv": {
+ "locked": {
+ "dir": "src/modules",
+ "lastModified": 1780091591,
+ "narHash": "sha256-07KVQbmtDbtTU9DlbOQiIXXS+UA+t+/aQ65iY311bSc=",
+ "owner": "cachix",
+ "repo": "devenv",
+ "rev": "21d68a204558895af93ad82014f8fa83f9c9a51e",
+ "type": "github"
+ },
+ "original": {
+ "dir": "src/modules",
+ "owner": "cachix",
+ "repo": "devenv",
+ "type": "github"
+ }
+ },
+ "flake-compat": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1767039857,
+ "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
+ "owner": "NixOS",
+ "repo": "flake-compat",
+ "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "flake-parts": {
+ "inputs": {
+ "nixpkgs-lib": "nixpkgs-lib"
+ },
+ "locked": {
+ "lastModified": 1778716662,
+ "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
+ "type": "github"
+ },
+ "original": {
+ "id": "flake-parts",
+ "type": "indirect"
+ }
+ },
+ "flake-parts_2": {
+ "inputs": {
+ "nixpkgs-lib": [
+ "my-nixpkgs",
+ "nur",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1733312601,
+ "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "git-hooks": {
+ "inputs": {
+ "flake-compat": "flake-compat",
+ "gitignore": "gitignore",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1778507602,
+ "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "type": "github"
+ }
+ },
+ "gitignore": {
+ "inputs": {
+ "nixpkgs": [
+ "git-hooks",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1709087332,
+ "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
+ "my-nixpkgs": {
+ "inputs": {
+ "flake-parts": "flake-parts",
+ "nixpkgs": "nixpkgs",
+ "nur": "nur"
+ },
+ "locked": {
+ "lastModified": 1778927864,
+ "narHash": "sha256-nH+hk5arAsHBUdswkx3wgrwgzGRXueGcf58T2I/42SI=",
+ "ref": "refs/heads/master",
+ "rev": "2b4ef3640055c6c1e012271bb9d653b73b2b2939",
+ "revCount": 394,
+ "type": "git",
+ "url": "https://git.aristote.fr/nix/my-nixpkgs"
+ },
+ "original": {
+ "type": "git",
+ "url": "https://git.aristote.fr/nix/my-nixpkgs"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1778794387,
+ "narHash": "sha256-BL04pOS9453Awkeb9f90XBJXBSkWxN+vB7HIgnL0iMM=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "8a1b0127302ea51e05bf4ea5a291743fac442406",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "type": "indirect"
+ }
+ },
+ "nixpkgs-lib": {
+ "locked": {
+ "lastModified": 1777168982,
+ "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=",
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "type": "github"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1778443072,
+ "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs_3": {
+ "locked": {
+ "lastModified": 1780030872,
+ "narHash": "sha256-u6WU/yd/o8iYQrHX3RAwO1hYa3LkoSL+WNQD0rJfJZQ=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "e9a7635a57597d9754eccebdfc7045e6c8600e6b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nur": {
+ "inputs": {
+ "flake-parts": "flake-parts_2",
+ "nixpkgs": "nixpkgs_2"
+ },
+ "locked": {
+ "lastModified": 1778925474,
+ "narHash": "sha256-Gt03YnUpP+FIndBy9frdwcqRF9m61QxSf6RxGrlPlTA=",
+ "owner": "nix-community",
+ "repo": "NUR",
+ "rev": "cb307695a0afecbaf24fbdb19fdb6e481396283d",
+ "type": "github"
+ },
+ "original": {
+ "id": "nur",
+ "type": "indirect"
+ }
+ },
+ "root": {
+ "inputs": {
+ "devenv": "devenv",
+ "git-hooks": "git-hooks",
+ "my-nixpkgs": "my-nixpkgs",
+ "nixpkgs": "nixpkgs_3"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+} \ No newline at end of file
diff --git a/devenv.nix b/devenv.nix
new file mode 100644
index 0000000..7aa21db
--- /dev/null
+++ b/devenv.nix
@@ -0,0 +1,115 @@
+{ inputs, pkgs, config, ... }:
+{
+ # to install ADE and extract its key, run the following scripts
+ # wine-setup
+ # python-install
+ # ade-install
+ # dedrm-install
+ # extract-key
+
+ # sources:
+ # https://baptiste.bouchereau.pro/tutorial/read-ade-protected-ebooks-on-linux/#setup-the-calibre-plugin
+ # https://gist.github.com/rendyanthony/a1d6b830c33a5e0fcd8b4c86f3f0dbff
+
+ packages = with pkgs; [
+ # for installing ADE and extracting its key
+ wget wine winetricks gnutls
+ # for calibre
+ calibre
+ ];
+
+ env = {
+ WINEPREFIX = "${config.env.DEVENV_ROOT}/wine";
+ WINEARCH = "win32";
+ PYTHONVERSION = "3.12.8";
+ ADEVERSION = "2.0";
+ DEDRMVERSION = "10.0.3";
+ DEDRM = "${config.env.DEVENV_ROOT}/DeDRM";
+ };
+
+ scripts = {
+ wine-rm.exec = ''
+ rm -rf "$WINEPREFIX"
+ '';
+
+ wine-setup.exec = ''
+ echo ============================================================
+ echo Setting up Wine environment...
+ echo ============================================================
+ mkdir -p $WINEPREFIX
+ wineboot
+ winetricks -q corefonts
+ winetricks -q dotnet35sp1
+ winetricks -q python
+ echo ==============================
+ echo Wine environment set up!
+ echo ==============================
+ '';
+
+ python-install.exec = ''
+ echo ============================================================
+ echo Downloading Python installer...
+ echo ============================================================
+ wget "https://www.python.org/ftp/python/$PYTHONVERSION/python-$PYTHONVERSION.exe" -O "$WINEPREFIX"/python.exe
+ echo ============================================================
+ echo Installing Python inside Wine...
+ echo The graphical installer will open next.
+ echo MAKE SURE TO SELECT '"add python.exe to PATH"'!
+ echo You can always rerun the Python install with "'python-install'"
+ read -p "Press ENTER to start to installing python."
+ echo ============================================================
+ wine "$WINEPREFIX"/python.exe
+ wine python -m pip install pycryptodome
+ echo ============================================================
+ echo Python installed!
+ echo ============================================================
+ '';
+
+
+ ade-install.exec = ''
+ echo ============================================================
+ echo Downloading ADE installer...
+ echo ============================================================
+ wget http://download.adobe.com/pub/adobe/digitaleditions/ADE_"$ADEVERSION"_Installer.exe -O "$WINEPREFIX/ADE.exe"
+ echo ============================================================
+ echo Installing ADE inside Wine...
+ echo The graphical installer will open next.
+ echo Once the installation is complete, ADE will start.
+ echo MAKE SURE TO AUTHORIZE YOUR WINE ENVIRONMENT
+ echo IN '"Help > Authorize your computer"'
+ echo You can always rerun the ADE install with "'ade-install'",
+ echo and you can launch ADE with "'ade'".
+ read -p "Press ENTER to start to installing ADE."
+ echo ============================================================
+ wine $WINEPREFIX/ADE.exe
+ echo ============================================================
+ echo ADE installed!
+ echo ============================================================
+ '';
+
+ ade.exec = ''
+ wine "$WINEPREFIX/drive_c/Program Files/Adobe/Adobe Digital Editions $ADEVERSION/DigitalEditions.exe"
+ '';
+
+ dedrm-install.exec = ''
+ echo ============================================================
+ echo Downloading and extracting DeDRM script...
+ echo ============================================================
+ wget "https://github.com/noDRM/DeDRM_tools/releases/download/v$DEDRMVERSION/DeDRM_tools_$DEDRMVERSION.zip" -O "$WINEPREFIX/DeDRM.zip"
+ unzip "$WINEPREFIX/DeDRM.zip" -d "$DEDRM"
+ unzip "$WINEPREFIX/DeDRM/DeDRM_plugin.zip" -d "$DEDRM/DeDRM_plugin"
+ '';
+
+ extract-key.exec = ''
+ echo ============================================================
+ echo Extracting ADE key...
+ echo ============================================================
+ wine python "$DEDRM/DeDRM_plugin/adobekey.py"
+ ln -sf "$WINEPREFIX/DeDRM_plugin/*.der adobekey.der"
+ echo ============================================================
+ echo ADE key extracted to "'$DEVENV_ROOT/adobekey.der'"!
+ echo Check out the links in "'devenv.nix'" for what to do next.
+ echo ============================================================
+ '';
+ };
+}
diff --git a/devenv.yaml b/devenv.yaml
new file mode 100644
index 0000000..c14231a
--- /dev/null
+++ b/devenv.yaml
@@ -0,0 +1,10 @@
+inputs:
+ git-hooks:
+ url: github:cachix/git-hooks.nix
+ inputs:
+ nixpkgs:
+ follows: nixpkgs
+ my-nixpkgs:
+ url: git+https://git.aristote.fr/nix/my-nixpkgs
+ nixpkgs:
+ url: github:NixOS/nixpkgs/nixpkgs-unstable