1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-02 21:13:33 +02:00

kitty: silently drop darwin-specific options (#3394)

Rather than reject a configuration when this option is set, just
silently ignore it when the platform isn't darwin. The name makes it
obvious that it won't be applied outside of darwin, and this allows
people to use the same configuration between hosts without any special concern.

Co-authored-by: Nicholas Sielicki <git@opensource.nslick.com>
This commit is contained in:
Nicholas Sielicki 2022-11-26 16:16:33 -08:00 committed by GitHub
parent 62cb5bcf93
commit bf99255fc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,14 +119,6 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [{
assertion = (cfg.darwinLaunchOptions != null)
-> pkgs.stdenv.hostPlatform.isDarwin;
message = ''
The 'programs.kitty.darwinLaunchOptions' option is only available on darwin.
'';
}];
home.packages = [ cfg.package ] ++ optionalPackage cfg.font; home.packages = [ cfg.package ] ++ optionalPackage cfg.font;
xdg.configFile."kitty/kitty.conf" = { xdg.configFile."kitty/kitty.conf" = {
@ -158,8 +150,8 @@ in {
''; '';
}; };
xdg.configFile."kitty/macos-launch-services-cmdline" = xdg.configFile."kitty/macos-launch-services-cmdline" = mkIf
mkIf (cfg.darwinLaunchOptions != null) { (cfg.darwinLaunchOptions != null && pkgs.stdenv.hostPlatform.isDarwin) {
text = concatStringsSep " " cfg.darwinLaunchOptions; text = concatStringsSep " " cfg.darwinLaunchOptions;
}; };
}; };