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