Unverified Commit 5448eaf6 authored by sternenseemann's avatar sternenseemann Committed by GitHub
Browse files

nixos/foot: add option xdg.serverAutostart, don't hardcode package (#493708)

parents dac0472c 71243766
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@ in
      };
    };

    xdg = {
      serverAutostart = lib.mkEnableOption "starting the foot server via xdg-autostart";
    };

    theme = lib.mkOption {
      type = with lib.types; nullOr str;
      default = null;
@@ -74,10 +78,14 @@ in
    environment = {
      systemPackages = [ cfg.package ];
      etc."xdg/foot/foot.ini".source = settingsFormat.generate "foot.ini" cfg.settings;

      etc."xdg/autostart/foot-server.desktop".source =
        lib.mkIf cfg.xdg.serverAutostart "${cfg.package}/share/applications/foot-server.desktop";
    };

    programs = {
      foot.settings.main.include = lib.optionals (cfg.theme != null) [
        "${pkgs.foot.themes}/share/foot/themes/${cfg.theme}"
        "${cfg.package.themes}/share/foot/themes/${cfg.theme}"
      ];
      # https://codeberg.org/dnkl/foot/wiki#user-content-shell-integration
      bash.interactiveShellInit = lib.mkIf cfg.enableBashIntegration ". ${./bashrc} # enable shell integration for foot terminal";