mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 22:33:00 +00:00
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
60 lines
1.3 KiB
Nix
60 lines
1.3 KiB
Nix
{ 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" { nullable = true; };
|
|
|
|
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 = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile."looking-glass/client.ini" = mkIf (cfg.settings != { }) {
|
|
source =
|
|
settingsFormat.generate ("looking-glass-client.ini") cfg.settings;
|
|
};
|
|
};
|
|
}
|