mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 01:19:32 +08:00
gurk-rs: deduplicate platform-dependent files
This commit is contained in:
committed by
Austin Horstman
parent
40deed4ffe
commit
12a723df97
@@ -7,6 +7,8 @@
|
||||
let
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
cfg = config.programs.gurk-rs;
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.da157 ];
|
||||
@@ -46,9 +48,8 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file."${
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome
|
||||
}/gurk/gurk.toml".source =
|
||||
lib.mkIf (cfg.settings != { }) (tomlFormat.generate "gurk-config" cfg.settings);
|
||||
home.file."${configDir}/gurk/gurk.toml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "gurk-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user