looking-glass-client: add module
This commit is contained in:
parent
e901c8d860
commit
42f81ac107
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
|
@ -176,6 +176,9 @@ Makefile @thiagokokada
|
|||
|
||||
/modules/programs/lieer.nix @tadfisher
|
||||
|
||||
/modules/programs/looking-glass-client.nix @j-brn
|
||||
/tests/modules/programs/looking-glass-client @j-brn
|
||||
|
||||
/modules/programs/lsd.nix @marsam
|
||||
|
||||
/modules/programs/matplotlib.nix @rprospero
|
||||
|
|
|
@ -762,6 +762,14 @@ in
|
|||
want to automatically run scheduled backups.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2022-10-18T08:07:43+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'programs.looking-glass-client'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -110,6 +110,7 @@ let
|
|||
./programs/lf.nix
|
||||
./programs/librewolf.nix
|
||||
./programs/lieer.nix
|
||||
./programs/looking-glass-client.nix
|
||||
./programs/lsd.nix
|
||||
./programs/man.nix
|
||||
./programs/mangohud.nix
|
||||
|
|
60
modules/programs/looking-glass-client.nix
Normal file
60
modules/programs/looking-glass-client.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.looking-glass-client;
|
||||
settingsFormat = pkgs.formats.ini { };
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ j-brn ];
|
||||
|
||||
options.programs.looking-glass-client = {
|
||||
enable = mkEnableOption "looking-glass-client";
|
||||
|
||||
package = mkPackageOption pkgs "looking-glass-client" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = settingsFormat.type;
|
||||
default = { };
|
||||
description = "looking-glass-client settings.";
|
||||
example = literalExpression ''
|
||||
{
|
||||
app = {
|
||||
allowDMA = true;
|
||||
shmFile = "/dev/kvmfr0";
|
||||
};
|
||||
|
||||
win = {
|
||||
fullScreen = true;
|
||||
showFPS = false;
|
||||
jitRender = true;
|
||||
};
|
||||
|
||||
spice = {
|
||||
enable = true;
|
||||
audio = true;
|
||||
};
|
||||
|
||||
input = {
|
||||
rawMouse = true;
|
||||
escapeKey = 62;
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "programs.looking-glass-client" pkgs
|
||||
platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."looking-glass/client.ini" = mkIf (cfg.settings != { }) {
|
||||
source =
|
||||
settingsFormat.generate ("looking-glass-client.ini") cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -149,6 +149,7 @@ import nmt {
|
|||
./modules/programs/hexchat
|
||||
./modules/programs/i3status-rust
|
||||
./modules/programs/kodi
|
||||
./modules/programs/looking-glass-client
|
||||
./modules/programs/mangohud
|
||||
./modules/programs/ncmpcpp-linux
|
||||
./modules/programs/neovim # Broken package dependency on Darwin.
|
||||
|
|
4
tests/modules/programs/looking-glass-client/default.nix
Normal file
4
tests/modules/programs/looking-glass-client/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
looking-glass-client-example-settings = ./example-settings.nix;
|
||||
looking-glass-client-empty-settings = ./empty-settings.nix;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.looking-glass-client = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/looking-glass/client.ini
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
[app]
|
||||
allowDMA=true
|
||||
shmFile=/dev/kvmfr0
|
||||
|
||||
[input]
|
||||
escapeKey=62
|
||||
rawMouse=true
|
||||
|
||||
[spice]
|
||||
audio=true
|
||||
enable=true
|
||||
|
||||
[win]
|
||||
fullScreen=true
|
||||
jitRender=true
|
||||
showFPS=false
|
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.looking-glass-client = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
|
||||
settings = {
|
||||
app = {
|
||||
allowDMA = true;
|
||||
shmFile = "/dev/kvmfr0";
|
||||
};
|
||||
|
||||
win = {
|
||||
fullScreen = true;
|
||||
showFPS = false;
|
||||
jitRender = true;
|
||||
};
|
||||
|
||||
spice = {
|
||||
enable = true;
|
||||
audio = true;
|
||||
};
|
||||
|
||||
input = {
|
||||
rawMouse = true;
|
||||
escapeKey = 62;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/looking-glass/client.ini \
|
||||
${./example-config.ini}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue