fork/home-manager

git clone https://git.julia.blue/fork/home-manager

j-brnlooking-glass-client: add module42f81ac1

master
1.3 KiB60 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6  cfg = config.programs.looking-glass-client;
7  settingsFormat = pkgs.formats.ini { };
8in {
9  meta.maintainers = with maintainers; [ j-brn ];
10
11  options.programs.looking-glass-client = {
12    enable = mkEnableOption "looking-glass-client";
13
14    package = mkPackageOption pkgs "looking-glass-client" { };
15
16    settings = mkOption {
17      type = settingsFormat.type;
18      default = { };
19      description = "looking-glass-client settings.";
20      example = literalExpression ''
21        {
22          app = {
23            allowDMA = true;
24            shmFile = "/dev/kvmfr0";
25          };
26
27          win = {
28            fullScreen = true;
29            showFPS = false;
30            jitRender = true;
31          };
32
33          spice = {
34            enable = true;
35            audio = true;
36          };
37
38          input = {
39            rawMouse = true;
40            escapeKey = 62;
41          };
42        }
43      '';
44    };
45  };
46
47  config = mkIf cfg.enable {
48    assertions = [
49      (hm.assertions.assertPlatform "programs.looking-glass-client" pkgs
50        platforms.linux)
51    ];
52
53    home.packages = [ cfg.package ];
54
55    xdg.configFile."looking-glass/client.ini" = mkIf (cfg.settings != { }) {
56      source =
57        settingsFormat.generate ("looking-glass-client.ini") cfg.settings;
58    };
59  };
60}