Unverified Commit b83db86a authored by Artturi's avatar Artturi Committed by GitHub
Browse files

Merge pull request #222080 from Stunkymonkey/nixos-optionalString

parents 2fc54db0 327b0cff
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -10,10 +10,7 @@ let
    check = x: (lib.types.package.check x) && (attrByPath ["meta" "isIbusEngine"] false x);
  };

  impanel =
    if cfg.panel != null
    then "--panel=${cfg.panel}"
    else "";
  impanel = optionalString (cfg.panel != null) "--panel=${cfg.panel}";

  ibusAutostart = pkgs.writeTextFile {
    name = "autostart-ibus-daemon";
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ let
      (option: ''
        menuentry '${defaults.name} ${
        # Name appended to menuentry defaults to params if no specific name given.
        option.name or (if option ? params then "(${option.params})" else "")
        }' ${if option ? class then " --class ${option.class}" else ""} {
        option.name or (optionalString (option ? params) "(${option.params})")
        }' ${optionalString (option ? class) " --class ${option.class}"} {
          linux ${defaults.image} \''${isoboot} ${defaults.params} ${
            option.params or ""
          }
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ let
    ${concatStringsSep "\n"
      (mapAttrsToList (command: action: "${command} ${action}") cfg.commands)
    }
    ${if cfg.clearDefaultCommands then "#stop" else ""}
    ${optionalString cfg.clearDefaultCommands "#stop"}

    #line-edit
    ${concatStringsSep "\n"
+8 −8
Original line number Diff line number Diff line
{ config, pkgs, lib, ... }:

let
  inherit (lib) mkOption mkIf types;
  inherit (lib) mkOption mkIf types optionalString;

  cfg = config.programs.tmux;

@@ -17,17 +17,17 @@ let
    set  -g base-index      ${toString cfg.baseIndex}
    setw -g pane-base-index ${toString cfg.baseIndex}

    ${if cfg.newSession then "new-session" else ""}
    ${optionalString cfg.newSession "new-session"}

    ${if cfg.reverseSplit then ''
    ${optionalString cfg.reverseSplit ''
    bind v split-window -h
    bind s split-window -v
    '' else ""}
    ''}

    set -g status-keys ${cfg.keyMode}
    set -g mode-keys   ${cfg.keyMode}

    ${if cfg.keyMode == "vi" && cfg.customPaneNavigationAndResize then ''
    ${optionalString (cfg.keyMode == "vi" && cfg.customPaneNavigationAndResize) ''
    bind h select-pane -L
    bind j select-pane -D
    bind k select-pane -U
@@ -37,15 +37,15 @@ let
    bind -r J resize-pane -D ${toString cfg.resizeAmount}
    bind -r K resize-pane -U ${toString cfg.resizeAmount}
    bind -r L resize-pane -R ${toString cfg.resizeAmount}
    '' else ""}
    ''}

    ${if (cfg.shortcut != defaultShortcut) then ''
    ${optionalString (cfg.shortcut != defaultShortcut) ''
    # rebind main key: C-${cfg.shortcut}
    unbind C-${defaultShortcut}
    set -g prefix C-${cfg.shortcut}
    bind ${cfg.shortcut} send-prefix
    bind C-${cfg.shortcut} last-window
    '' else ""}
    ''}

    setw -g aggressive-resize ${boolToStr cfg.aggressiveResize}
    setw -g clock-mode-style  ${if cfg.clock24 then "24" else "12"}
+2 −2
Original line number Diff line number Diff line
@@ -781,11 +781,11 @@ in {

      # FIXME Most of these custom warnings and filters for security.acme.certs.* are required
      # because using mkRemovedOptionModule/mkChangedOptionModule with attrsets isn't possible.
      warnings = filter (w: w != "") (mapAttrsToList (cert: data: if data.extraDomains != "_mkMergedOptionModule" then ''
      warnings = filter (w: w != "") (mapAttrsToList (cert: data: optionalString (data.extraDomains != "_mkMergedOptionModule") ''
        The option definition `security.acme.certs.${cert}.extraDomains` has changed
        to `security.acme.certs.${cert}.extraDomainNames` and is now a list of strings.
        Setting a custom webroot for extra domains is not possible, instead use separate certs.
      '' else "") cfg.certs);
      '') cfg.certs);

      assertions = let
        certs = attrValues cfg.certs;
Loading