2023-11-16 04:20:00 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.spice-autorandr;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.spice-autorandr = {
|
|
|
|
enable = lib.mkEnableOption (lib.mdDoc "spice-autorandr service that will automatically resize display to match SPICE client window size.");
|
2024-01-02 11:29:13 +00:00
|
|
|
package = lib.mkPackageOption pkgs "spice-autorandr" { };
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
|
|
|
|
systemd.user.services.spice-autorandr = {
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
after = [ "spice-vdagentd.service" ];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${cfg.package}/bin/spice-autorandr";
|
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|