From 6d390eb9383538caee757b1f2526c5686d0c0795 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Tue, 1 Aug 2023 22:55:21 -0400 Subject: [PATCH] containers(wine): Add sakaya systemd service This combined with su makes it possible to automatically start a user environment with sakaya-server running, thus eliminating the need to spawn a shell with machinectl. --- containers/wine.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/containers/wine.nix b/containers/wine.nix index 69dcbd5..13916ef 100644 --- a/containers/wine.nix +++ b/containers/wine.nix @@ -60,6 +60,25 @@ allowedTCPPorts = [ 39493 ]; }; + systemd.services.sakaya = { + enable = true; + description = "sakaya server"; + + unitConfig = { + Type = "simple"; + }; + + path = with pkgs; [ + su + ]; + + serviceConfig = { + ExecStart = "/usr/bin/env su user --command=${sakaya.packages.${pkgs.system}.sakaya}/bin/sakaya-server"; + }; + + wantedBy = [ "multi-user.target" ]; + }; + environment.systemPackages = with pkgs; [ wineWowPackages.stagingFull winetricks