1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-23 18:29:47 +01:00

kanshi: dont write config in absence of nix settings (#6198)

This commit is contained in:
Matthieu Coudron 2024-12-12 23:48:46 +01:00 committed by GitHub
parent e526fd2b1a
commit 3066cc58f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 9 deletions

View file

@ -38,9 +38,7 @@ let
else
throw "Unknown tags ${attrNames x}";
directivesStr = ''
${concatStringsSep "\n" (map tagToStr cfg.settings)}
'';
directivesStr = concatStringsSep "\n" (map tagToStr cfg.settings);
oldDirectivesStr = ''
${concatStringsSep "\n"
@ -332,11 +330,13 @@ in {
{
home.packages = [ cfg.package ];
xdg.configFile."kanshi/config".text =
if cfg.profiles == { } && cfg.extraConfig == "" then
directivesStr
else
oldDirectivesStr;
xdg.configFile."kanshi/config" = let
generatedConfigStr =
if cfg.profiles == { } && cfg.extraConfig == "" then
directivesStr
else
oldDirectivesStr;
in mkIf (generatedConfigStr != "") { text = generatedConfigStr; };
systemd.user.services.kanshi = {
Unit = {

View file

@ -16,4 +16,3 @@ profile {
output "LVDS-1" enable
exec echo "7 eight 9"
}