From 666eee4f72979b0ebbd2e065a3846d7a8a16895c Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Thu, 10 Jun 2021 12:40:36 -0400 Subject: [PATCH] programs.foot: Always create config file (#2091) foot complains if there is no config file. --- modules/programs/foot.nix | 2 +- tests/modules/programs/foot/empty-settings.nix | 5 ++++- tests/modules/programs/foot/systemd-user-service.nix | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix index 8df201fd9..08b5e3975 100644 --- a/modules/programs/foot.nix +++ b/modules/programs/foot.nix @@ -51,7 +51,7 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - xdg.configFile."foot/foot.ini" = mkIf (cfg.settings != { }) { + xdg.configFile."foot/foot.ini" = { source = iniFormat.generate "foot.ini" cfg.settings; }; diff --git a/tests/modules/programs/foot/empty-settings.nix b/tests/modules/programs/foot/empty-settings.nix index 3935fd9dc..44caeca55 100644 --- a/tests/modules/programs/foot/empty-settings.nix +++ b/tests/modules/programs/foot/empty-settings.nix @@ -10,7 +10,10 @@ with lib; [ (self: super: { foot = pkgs.writeScriptBin "dummy-foot" ""; }) ]; nmt.script = '' - assertPathNotExists home-files/.config/foot + assertFileExists home-files/.config/foot/foot.ini + assertFileContent \ + home-files/.config/foot/foot.ini \ + ${builtins.toFile "test" ""} ''; }; } diff --git a/tests/modules/programs/foot/systemd-user-service.nix b/tests/modules/programs/foot/systemd-user-service.nix index 1eff14f9f..9c131362b 100644 --- a/tests/modules/programs/foot/systemd-user-service.nix +++ b/tests/modules/programs/foot/systemd-user-service.nix @@ -11,7 +11,10 @@ in { }; nmt.script = '' - assertPathNotExists home-files/.config/foot/foot.ini + assertFileExists home-files/.config/foot/foot.ini + assertFileContent \ + home-files/.config/foot/foot.ini \ + ${builtins.toFile "test" ""} assertFileContent \ home-files/.config/systemd/user/foot.service \