Merge pull request #260902 from LDprg/master

preload: init at 0.6.4
This commit is contained in:
Lin Jian 2023-11-25 23:29:40 -06:00 committed by GitHub
commit 5ba42a0de2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 129 additions and 0 deletions

View file

@ -10077,6 +10077,13 @@
githubId = 2472678;
name = "Lucas Desgouilles";
};
ldprg = {
email = "lukas_4dr@gmx.at";
matrix = "@ldprg:matrix.org";
github = "LDprg";
githubId = 71488985;
name = "LDprg";
};
league = {
email = "league@contrapunctus.net";
github = "league";

View file

@ -150,6 +150,8 @@
- [c2FmZQ](https://github.com/c2FmZQ/c2FmZQ/), an application that can securely encrypt, store, and share files, including but not limited to pictures and videos. Available as [services.c2fmzq-server](#opt-services.c2fmzq-server.enable).
- [preload](http://sourceforge.net/projects/preload), a service that makes applications run faster by prefetching binaries and shared objects. Available as [services.preload](#opt-services.preload.enable).
## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
- `services.postgresql.ensurePermissions` has been deprecated in favor of `services.postgresql.ensureUsers.*.ensureDBOwnership` which simplifies the setup of database owned by a certain system user

View file

@ -723,6 +723,7 @@
./services/misc/podgrab.nix
./services/misc/polaris.nix
./services/misc/portunus.nix
./services/misc/preload.nix
./services/misc/prowlarr.nix
./services/misc/pufferpanel.nix
./services/misc/pykms.nix

View file

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.preload;
in {
meta = { maintainers = pkgs.preload.meta.maintainers; };
options.services.preload = {
enable = mkEnableOption "preload";
package = mkPackageOption pkgs "preload" { };
};
config = mkIf cfg.enable {
systemd.services.preload = {
description = "Loads data into ram during idle time of CPU.";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
EnvironmentFile = "${cfg.package}/etc/conf.d/preload";
ExecStart = "${getExe cfg.package} --foreground $PRELOAD_OPTS";
Type = "simple";
# Only preload data during CPU idle time
IOSchedulingClass = 3;
DynamicUser = true;
StateDirectory = "preload";
};
};
};
}

View file

@ -0,0 +1,54 @@
diff --git a/Makefile.in b/Makefile.in
index e4072e4..4a6b069 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -327,23 +327,9 @@ installcheck-initdSCRIPTS: $(initd_SCRIPTS)
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
-install-logDATA: $(log_DATA)
- @$(NORMAL_INSTALL)
- test -z "$(logdir)" || $(MKDIR_P) "$(DESTDIR)$(logdir)"
- @list='$(log_DATA)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(logDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(logdir)/$$f'"; \
- $(logDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(logdir)/$$f"; \
- done
+install-logDATA:
uninstall-logDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(log_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(logdir)/$$f'"; \
- rm -f "$(DESTDIR)$(logdir)/$$f"; \
- done
install-logrotateDATA: $(logrotate_DATA)
@$(NORMAL_INSTALL)
test -z "$(logrotatedir)" || $(MKDIR_P) "$(DESTDIR)$(logrotatedir)"
@@ -361,23 +347,9 @@ uninstall-logrotateDATA:
echo " rm -f '$(DESTDIR)$(logrotatedir)/$$f'"; \
rm -f "$(DESTDIR)$(logrotatedir)/$$f"; \
done
-install-pkglocalstateDATA: $(pkglocalstate_DATA)
- @$(NORMAL_INSTALL)
- test -z "$(pkglocalstatedir)" || $(MKDIR_P) "$(DESTDIR)$(pkglocalstatedir)"
- @list='$(pkglocalstate_DATA)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(pkglocalstateDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglocalstatedir)/$$f'"; \
- $(pkglocalstateDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglocalstatedir)/$$f"; \
- done
+install-pkglocalstateDATA:
uninstall-pkglocalstateDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(pkglocalstate_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(pkglocalstatedir)/$$f'"; \
- rm -f "$(DESTDIR)$(pkglocalstatedir)/$$f"; \
- done
install-sysconfigDATA: $(sysconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(sysconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfigdir)"

View file

@ -0,0 +1,34 @@
{ lib, stdenv, fetchzip, autoconf, automake, pkg-config, glib }:
stdenv.mkDerivation rec {
pname = "preload";
version = "0.6.4";
src = fetchzip {
url = "mirror://sourceforge/preload/preload-${version}.tar.gz";
hash = "sha256-vAIaSwvbUFyTl6DflFhuSaMuX9jPVBah+Nl6c/fUbAM=";
};
patches = [
# Prevents creation of /var directories on build
./0001-prevent-building-to-var-directories.patch
];
nativeBuildInputs = [ autoconf automake pkg-config ];
buildInputs = [ glib ];
configureFlags = [ "--localstatedir=/var" ];
postInstall = ''
make sysconfigdir=$out/etc/conf.d install
'';
meta = with lib; {
description = "Makes applications run faster by prefetching binaries and shared objects";
homepage = "https://sourceforge.net/projects/preload";
license = licenses.gpl2Only;
platforms = lib.platforms.linux;
mainProgram = "preload";
maintainers = with maintainers; [ ldprg ];
};
}