diff --git a/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix b/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix index cc05950..2ee58ec 100755 --- a/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix +++ b/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix @@ -78,6 +78,7 @@ in }; programs = { btop = enabled; + calibre = enabled; kitty = disabled; mako = disabled; nwg-dock = disabled; @@ -145,6 +146,7 @@ in ] ++ (with pkgs; [ bolt-launcher + bottles iw iwd orca-slicer diff --git a/modules/home/programs/calibre/default.nix b/modules/home/programs/calibre/default.nix new file mode 100644 index 0000000..e9fd989 --- /dev/null +++ b/modules/home/programs/calibre/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + namespace, + ... +}: +{ + imports = [ + (lib.${namespace}.mkHomeModule { + inherit config; + domain = "programs"; + name = "calibre"; + moduleConfig = { + programs.calibre = { + enable = true; + plugins = with pkgs.${namespace}; [ + dedrm + ]; + }; + }; + }) + ]; +} diff --git a/packages/calibrePlugin/dedrm/default.nix b/packages/calibrePlugin/dedrm/default.nix new file mode 100644 index 0000000..b023669 --- /dev/null +++ b/packages/calibrePlugin/dedrm/default.nix @@ -0,0 +1,44 @@ +{ + ensureNewerSourcesForZipFilesHook, + fetchFromGitHub, + lib, + python3, + stdenvNoCC, + unzip, +}: +stdenvNoCC.mkDerivation rec { + pname = "dedrm"; + version = "10.0.9-unstable-2024-11-10"; + + src = fetchFromGitHub { + owner = "noDRM"; + repo = "DeDRM_tools"; + rev = "7379b453199ed1ba91bf3a4ce4875d5ed3c309a9"; + hash = "sha256-Hq/DBYeJ2urJtxG+MiO2L8TGZ9/kLue1DXbG4/KJFhc="; + }; + + nativeBuildInputs = [ + ensureNewerSourcesForZipFilesHook + python3 + ]; + + buildPhase = '' + runHook preBuild + ${lib.getExe python3} make_release.py + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + ${lib.getExe unzip} DeDRM_tools.zip -d out + install -D --mode=0644 --target-directory=$out/lib/calibre/calibre-plugins out/DeDRM_plugin.zip out/Obok_plugin.zip + runHook postInstall + ''; + + meta = { + homepage = "https://github.com/noDRM/DeDRM_tools"; + changelog = "https://github.com/noDRM/DeDRM_tools/releases/tag/v${version}"; + platforms = with lib.platforms; linux ++ darwin ++ windows; + license = with lib.licenses; [ gpl3Only ]; + }; +} \ No newline at end of file