From d147d7feed63ba43e80a103d278d5ad4bb12b1fd Mon Sep 17 00:00:00 2001 From: Dmytro Kyrychuk Date: Sun, 8 Oct 2023 20:22:45 +0000 Subject: nixos/spice-autorandr: init --- nixos/modules/services/misc/spice-autorandr.nix | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 nixos/modules/services/misc/spice-autorandr.nix (limited to 'nixos/modules/services/misc') diff --git a/nixos/modules/services/misc/spice-autorandr.nix b/nixos/modules/services/misc/spice-autorandr.nix new file mode 100644 index 000000000000..8437441c752a --- /dev/null +++ b/nixos/modules/services/misc/spice-autorandr.nix @@ -0,0 +1,26 @@ +{ 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."); + package = lib.mkPackageOptionMD pkgs "spice-autorandr" { }; + }; + }; + + 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"; + }; + }; + }; +} -- cgit 1.4.1