about summary refs log tree commit diff
path: root/overlays/patches/wlroots-displaylink
Commit message (Collapse)AuthorAgeFilesLines
* feat(home/gui): sway: use displaylink patch on laptopsefidel2023-11-151-0/+48
>26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
{ config, lib, pkgs, ... }:

with lib;
with lib.types;

let
  cfg = config.programs.zellij;
  yamlFormat = pkgs.formats.yaml { };

  prim = oneOf [ bool int str ];
  primOrPrimAttrs = either prim (attrsOf prim);
  entry = either prim (listOf primOrPrimAttrs);
  entryOrAttrsOf = t: either entry (attrsOf t);
  entries = entryOrAttrsOf (entryOrAttrsOf entry);
in
{
  meta.maintainers = with lib.maintainers; [ boppyt ];

  options.programs.zellij = {
    enable = mkEnableOption "Zellij, A terminal workspace with batteries included.";

    package = mkOption {
      type = types.package;
      default = pkgs.zellij;
      defaultText = literalExpression "pkgs.zellij";
      description = "The zellij package to install";
    };

    settings = mkOption {
      type = attrsOf entries // { description = "zellij configuration"; };
      default = { };
      description = ''
        Configuration written to
        <filename>$XDG_CONFIG_HOME/zellij/config.yaml</filename>. See <link
        xlink:href="https://zellij.dev/documentation/configuration.html"/>
        for a list of available options.
      '';
      example = literalExample ''
        {
          default-mode = "normal";
          simplified-ui = true;
        }
      '';
    };

    defaultLayout = mkOption {
      type = attrsOf entries // { description = "zellij default pane layout"; };
      default = { };
      description = ''
        Configuration written to
        <filename>$XDG_CONFIG_HOME/zellij/layout/default.yaml</filename>. See <link
        xlink:href="https://zellij.dev/documentation/layouts.html"/>
        for a list of available options.
      '';
    };
  };

  config = mkIf cfg.enable {

    home.packages = [ cfg.package ];

    xdg.configFile."zellij/config.yaml" = mkIf (cfg.settings != { }) {
      source = yamlFormat.generate "zellij-config" cfg.settings;
    };

    xdg.configFile."zellij/layout/default.yaml" = mkIf (cfg.defaultLayout != { }) {
      source = yamlFormat.generate "zellij-layout" cfg.defaultLayout;
    };
  };
}