mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +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
|
let
|
||||||
tomlFormat = pkgs.formats.toml { };
|
tomlFormat = pkgs.formats.toml { };
|
||||||
cfg = config.programs.gurk-rs;
|
cfg = config.programs.gurk-rs;
|
||||||
|
configDir =
|
||||||
|
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
meta.maintainers = [ lib.maintainers.da157 ];
|
meta.maintainers = [ lib.maintainers.da157 ];
|
||||||
@@ -46,9 +48,8 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||||
|
|
||||||
home.file."${
|
home.file."${configDir}/gurk/gurk.toml" = lib.mkIf (cfg.settings != { }) {
|
||||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome
|
source = tomlFormat.generate "gurk-config" cfg.settings;
|
||||||
}/gurk/gurk.toml".source =
|
};
|
||||||
lib.mkIf (cfg.settings != { }) (tomlFormat.generate "gurk-config" cfg.settings);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user