add mangal patch to help with ram

This commit is contained in:
Kopatz
2024-12-28 13:57:45 +01:00
parent 2a2c3d5a14
commit ea6da30fee
6 changed files with 30 additions and 9 deletions

View File

@@ -29,7 +29,7 @@ in {
v4l-utils v4l-utils
logseq # notes logseq # notes
ani-cli ani-cli
mangal mangal-patched
]; ];
}; };
} }

View File

@@ -26,7 +26,7 @@ in {
useStepCa = false; # config.services.step-ca.enable; useStepCa = false; # config.services.step-ca.enable;
useHttps = cfg.https; useHttps = cfg.https;
baseDir = cfg.dir; baseDir = cfg.dir;
mangal = "${pkgs.mangal}/bin/mangal"; mangal = "${pkgs.mangal-patched}/bin/mangal";
githubRunnerEnabled = config.services.github-runners ? oberprofis.enable; githubRunnerEnabled = config.services.github-runners ? oberprofis.enable;
in lib.mkIf cfg.enable { in lib.mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [ 5000 ]; networking.firewall.allowedTCPPorts = [ 5000 ];

View File

@@ -53,7 +53,6 @@ in {
# example = prev.example.overrideAttrs (oldAttrs: rec { # example = prev.example.overrideAttrs (oldAttrs: rec {
# ... # ...
# }); # });
mangal = addPatches prev.mangal [ ./pkgs/patches/mangal.diff ];
}; };
# When applied, the unstable nixpkgs set (declared in the flake inputs) will # When applied, the unstable nixpkgs set (declared in the flake inputs) will

View File

@@ -1,12 +1,13 @@
{ pkgs, ... }: rec { { pkgs, ... }: rec {
kop-hub = pkgs.callPackage ./hub/default.nix { }; adam-site = pkgs.callPackage ./adam-site/default.nix { };
ente-frontend = pkgs.callPackage ./ente-frontend/default.nix { }; ente-frontend = pkgs.callPackage ./ente-frontend/default.nix { };
kop-website = kop-fhcalendar = pkgs.callPackage ./kop-fhcalendar/default.nix { };
pkgs.callPackage ./website/default.nix { inherit kop-hub ente-frontend; }; kop-fileshare = pkgs.callPackage ./kop-fileshare/default.nix { };
kop-hub = pkgs.callPackage ./hub/default.nix { };
kop-monitor = pkgs.callPackage ./kop-monitor/default.nix { }; kop-monitor = pkgs.callPackage ./kop-monitor/default.nix { };
kop-newproject = pkgs.callPackage ./kop-newproject/default.nix { }; kop-newproject = pkgs.callPackage ./kop-newproject/default.nix { };
kop-fileshare = pkgs.callPackage ./kop-fileshare/default.nix { }; kop-website =
kop-fhcalendar = pkgs.callPackage ./kop-fhcalendar/default.nix { }; pkgs.callPackage ./website/default.nix { inherit kop-hub ente-frontend; };
adam-site = pkgs.callPackage ./adam-site/default.nix { };
sddm-astronaut = pkgs.callPackage ./sddm-astronaut/default.nix { }; sddm-astronaut = pkgs.callPackage ./sddm-astronaut/default.nix { };
mangal-patched = pkgs.callPackage ./mangal/default.nix { mangal = pkgs.mangal; };
} }

6
pkgs/mangal/default.nix Normal file
View File

@@ -0,0 +1,6 @@
{ mangal }:
let
addPatches = pkg: patches:
pkg.overrideAttrs
(oldAttrs: { patches = (oldAttrs.patches or [ ]) ++ patches; });
in addPatches mangal [ ./mangal.diff ]

View File

@@ -11,3 +11,18 @@ index e7d0c62..7af6542 100644
return fmt.Sprintf(template, query) return fmt.Sprintf(template, query)
}, },
MangaExtractor: &generic.Extractor{ MangaExtractor: &generic.Extractor{
diff --git a/inline/inline.go b/inline/inline.go
index 26ad0c6..dc02fda 100644
--- a/inline/inline.go
+++ b/inline/inline.go
@@ -131,6 +132,10 @@ func Run(options *Options) (err error) {
if err != nil {
log.Warn(err)
}
+ // free memory after downloading
+ for _, page := range chapter.Pages {
+ page.Contents = nil
+ }
} else {
err := downloader.Read(chapter, func(string) {})
if err != nil {