1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-19 08:19:48 +01:00

tmate: don't generate empty config file (#4271)

This commit is contained in:
Naïm Favier 2023-07-24 16:17:31 +02:00 committed by GitHub
parent a30f5b5b35
commit d309a62ee8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,7 +65,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ cfg.package ]; home.packages = [ cfg.package ];
home.file.".tmate.conf".text = let home.file.".tmate.conf" = let
conf = conf =
optional (cfg.host != null) ''set -g tmate-server-host "${cfg.host}"'' optional (cfg.host != null) ''set -g tmate-server-host "${cfg.host}"''
++ optional (cfg.port != null) ++ optional (cfg.port != null)
@ -75,6 +75,6 @@ in {
++ optional (cfg.rsaFingerprint != null) ++ optional (cfg.rsaFingerprint != null)
''set -g tmate-server-rsa-fingerprint "${cfg.rsaFingerprint}"'' ''set -g tmate-server-rsa-fingerprint "${cfg.rsaFingerprint}"''
++ optional (cfg.extraConfig != "") cfg.extraConfig; ++ optional (cfg.extraConfig != "") cfg.extraConfig;
in concatStringsSep "\n" conf + "\n"; in mkIf (conf != [ ]) { text = concatLines conf; };
}; };
} }