Move systemd configuration to module

This commit is contained in:
Erwin Boskma 2022-09-26 12:52:40 +02:00
parent 39d469ee43
commit 279790b29e
Signed by: erwin
GPG key ID: 270B20D17394F7E5

View file

@ -68,12 +68,10 @@
preConfigure = ''
substituteInPlace CMakeLists.txt \
--replace "/usr/include/libevdev-1.0" "${pkgs.libevdev}/include/libevdev-1.0" \
--replace "/etc/udev/rules.d" "$out/etc/udev/rules.d" \
--replace "/usr/bin" "$out/bin" \
--replace "/usr/lib/systemd/user" "$out/lib/systemd/user"
'';
postInstall = ''
rm -r $out/lib/systemd
wrapProgram $out/bin/sunshine --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (with pkgs; [ avahi mesa libGL ])}"
'';
};
@ -121,6 +119,14 @@
source = "${sunshine}/bin/sunshine";
};
systemd.user.services.sunshine = {
description = "Sunshine is a Gamestream host for Moonlight";
serviceConfig.ExecStart = "${sunshine}/bin/sunshine";
wantedBy = [ "graphical-session.target" ];
};
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [
48010