misc: Add ReplaySorcery

This commit is contained in:
PapaTutuWawa 2021-08-07 17:26:11 +02:00
parent dfef2f4aa5
commit c3a3d9ae85
6 changed files with 95 additions and 9 deletions

View File

@ -3,7 +3,6 @@
let
unstable = (import ../modules/unstable.nix config);
customPkgs = import ../packages/overlay.nix;
gamemode = pkgs.callPackage ../packages/gamemode {};
in {
imports = [
./generic.nix
@ -37,6 +36,7 @@ in {
libvirt virt-manager qemu
gamemode # Custom package
key-mapper # Custom package
replaysorcery # Custom package
scream
linuxPackages_zen.vendor-reset
];
@ -87,6 +87,7 @@ in {
kernelModules = [];
extraModulePackages = [ pkgs.linuxPackages_zen.vendor-reset ];
kernelPackages = pkgs.linuxPackages_zen;
#kernelPackages = pkgs.linuxPackages_lqx;
};
services = {
@ -111,7 +112,7 @@ in {
cgroup_device_acl = [
"/dev/null", "/dev/zero", "/dev/full",
"/dev/random", "/dev/kvm", "/dev/kqemu",
"/dev/rtc", "/dev/hpet", "dev/ptmx",
"/dev/rtc", "/dev/hpet", "/dev/ptmx",
"/dev/input/by-id/usb-Logitech_G700s_Rechargeable_Gaming_Mouse_93DF48160007-event-mouse",
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-event-kbd",
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-if01-event-kbd",
@ -125,22 +126,39 @@ in {
services.NetworkManager-wait-online.enable = false;
user.services = {
scream = {
enable = false; # Started by the passthrough script
description = "Audio receiver for the Scream virtual network sound card";
wantedBy = [ "multi-user.target" ];
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
RestartAlways = "always";
Restart = "always";
};
};
replaysorcery-kms = {
description = "An open-source, instant-replay solution for Linux; KMS service";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery kms-service";
Restart = "always";
};
};
replaysorcery = {
description = "An open-source, instant-replay solution for Linux";
#wantedBy = [ "default.target" ];
requires = [ "replaysorcery-kms.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery";
Restart = "always";
};
};
gamemode = {
enable = true;
description = "A daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS.";
wantedBy = [ "multi-user.target" ];
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${gamemode}/bin/gamemoded";
ExecStart = "${pkgs.gamemode}/bin/gamemoded";
Restart = "always";
};
};

View File

@ -26,4 +26,11 @@ inhibit_screensaver=1
[supervisor]
[custom]
[custom]
start=systemctl --user start replaysorcery-kms
systemctl --user start replaysorcery
end=systemctl --user stop replaysorcery-kms
systemctl --user stop replaysorcery
script_timeout=10

View File

@ -11,4 +11,7 @@
gnome = {
gnome-terminal = pkgs.callPackage ./gnome-terminal {};
};
hydrapaper = pkgs.callPackage ./hydrapaper {};
replaysorcery = pkgs.callPackage ./replaysorcery {};
helvum = pkgs.callPackage ./helvum {};
}

View File

@ -8,4 +8,5 @@ self: super:
gnomeExtensionsCustom = {
notification-timeout = super.callPackage ./gnomeExtensions-notification-timeout {};
};
replaysorcery = super.callPackage ./replaysorcery {};
}

View File

@ -0,0 +1,39 @@
{ stdenv, lib,
pkgconfig, cmake, ffmpeg, libdrm, libpulseaudio, xorg, libnotify,
fetchgit }:
stdenv.mkDerivation rec {
pname = "ReplaySorcery";
version = "0.6.0";
src = fetchgit {
url = "https://github.com/matanui159/${pname}.git";
rev = "d8d5921988b5161004aed6209bd88251d721611d";
sha256 = "14m67mlfp0zh9s0bhz1qxppivw2aignxqb51xb5cy3v8farxmcv4";
deepClone = true;
};
nativeBuildInputs = [
pkgconfig cmake
];
buildInputs = [
ffmpeg libdrm libpulseaudio xorg.libxcb xorg.libX11
];
propagatedBuildInputs = [
libnotify
];
patches = [
./ignore-systemd.patch
];
meta = with lib; {
description = "An open-source, instant-replay solution for Linux";
homepage = "https://github.com/matanui159/ReplaySorcery";
license = licenses.gpl3;
maintainers = [ ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4633f85..e3fdd7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -213,8 +213,8 @@ install(TARGETS ${binary} DESTINATION bin PERMISSIONS ${permissions})
install(FILES sys/replay-sorcery.conf DESTINATION etc)
# Install services
-set(RS_SYSTEMD_DIR /usr/lib/systemd CACHE STRING "Where to install the systemd services")
-configure_file(sys/replay-sorcery.service.in replay-sorcery.service)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/replay-sorcery.service" DESTINATION "${RS_SYSTEMD_DIR}/user")
-configure_file(sys/replay-sorcery-kms.service.in replay-sorcery-kms.service)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/replay-sorcery-kms.service" DESTINATION "${RS_SYSTEMD_DIR}/system")
+#set(RS_SYSTEMD_DIR /usr/lib/systemd CACHE STRING "Where to install the systemd services")
+#configure_file(sys/replay-sorcery.service.in replay-sorcery.service)
+#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/replay-sorcery.service" DESTINATION "${RS_SYSTEMD_DIR}/user")
+#configure_file(sys/replay-sorcery-kms.service.in replay-sorcery-kms.service)
+#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/replay-sorcery-kms.service" DESTINATION "${RS_SYSTEMD_DIR}/system")