From 279790b29eeeefd2b169dda5a98abbdbecc16f4a Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Mon, 26 Sep 2022 12:52:40 +0200 Subject: [PATCH] Move systemd configuration to module --- flake.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 8508ef1..ed22d34 100644 --- a/flake.nix +++ b/flake.nix @@ -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