Move systemd configuration to module
This commit is contained in:
parent
39d469ee43
commit
279790b29e
1 changed files with 9 additions and 3 deletions
12
flake.nix
12
flake.nix
|
@ -68,12 +68,10 @@
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
substituteInPlace CMakeLists.txt \
|
substituteInPlace CMakeLists.txt \
|
||||||
--replace "/usr/include/libevdev-1.0" "${pkgs.libevdev}/include/libevdev-1.0" \
|
--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 = ''
|
postInstall = ''
|
||||||
|
rm -r $out/lib/systemd
|
||||||
wrapProgram $out/bin/sunshine --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (with pkgs; [ avahi mesa libGL ])}"
|
wrapProgram $out/bin/sunshine --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (with pkgs; [ avahi mesa libGL ])}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
@ -121,6 +119,14 @@
|
||||||
source = "${sunshine}/bin/sunshine";
|
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 {
|
networking.firewall = mkIf cfg.openFirewall {
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
48010
|
48010
|
||||||
|
|
Loading…
Reference in a new issue