mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-19 14:53: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.
50 lines
1.2 KiB
Nix
50 lines
1.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
let toml = pkgs.formats.toml { };
|
|
in {
|
|
meta.maintainers = with lib.maintainers; [ HeitorAugustoLN ];
|
|
|
|
options.programs.vinegar = {
|
|
enable = lib.mkEnableOption "Vinegar";
|
|
|
|
package = lib.mkPackageOption pkgs "vinegar" { nullable = true; };
|
|
|
|
settings = lib.mkOption {
|
|
type = lib.types.attrsOf toml.type;
|
|
default = { };
|
|
example = {
|
|
env.WINEFSYNC = "1";
|
|
|
|
studio = {
|
|
dxvk = false;
|
|
renderer = "Vulkan";
|
|
|
|
fflags.DFIntTaskSchedulerTargetFps = 144;
|
|
|
|
env = {
|
|
DXVK_HUD = "0";
|
|
MANGOHUD = "1";
|
|
};
|
|
};
|
|
};
|
|
description = ''
|
|
Configuration written to {file}`$XDG_CONFIG_HOME/vinegar/config.toml`.
|
|
|
|
See <https://vinegarhq.org/Configuration/> for more information.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = let cfg = config.programs.vinegar;
|
|
in lib.mkIf cfg.enable {
|
|
assertions = [
|
|
(lib.hm.assertions.assertPlatform "programs.vinegar" pkgs
|
|
lib.platforms.linux)
|
|
];
|
|
|
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile."vinegar/config.toml" = lib.mkIf (cfg.settings != { }) {
|
|
source = toml.generate "vinegar-config.toml" cfg.settings;
|
|
};
|
|
};
|
|
}
|