Commit 2a2796c2 authored by Jan Tojnar's avatar Jan Tojnar
Browse files

nixos/xserver: Remove with statements

They masked the evaluation error caused by removal of
`defaultSessionFromLegacyOptions` variable
in 6be2bfcc
parent 8bf5752a
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
{ config, lib, pkgs, ... }:

with lib;

let
  inherit (lib) mkOption types;

  xcfg = config.services.xserver;
  cfg = xcfg.desktopManager;
@@ -59,7 +58,7 @@ in
      session = mkOption {
        internal = true;
        default = [];
        example = singleton
        example = lib.singleton
          { name = "kde";
            bgSupport = true;
            start = "...";
@@ -73,10 +72,10 @@ in
          manage = "desktop";
          start = d.start
          # literal newline to ensure d.start's last line is not appended to
          + optionalString (needBGCond d) ''
          + lib.optionalString (needBGCond d) ''

            if [ -e $HOME/.background-image ]; then
              ${pkgs.feh}/bin/feh --bg-${cfg.wallpaper.mode} ${optionalString cfg.wallpaper.combineScreens "--no-xinerama"} $HOME/.background-image
              ${pkgs.feh}/bin/feh --bg-${cfg.wallpaper.mode} ${lib.optionalString cfg.wallpaper.combineScreens "--no-xinerama"} $HOME/.background-image
            fi
          '';
        });
+11 −12
Original line number Diff line number Diff line
@@ -9,9 +9,8 @@

{ config, lib, options, pkgs, ... }:

with lib;

let
  inherit (lib) mkOption types literalExpression optionalString;

  cfg = config.services.xserver;
  xorg = pkgs.xorg;
@@ -91,7 +90,7 @@ let
      # Import environment variables into the systemd user environment.
      ${optionalString (cfg.displayManager.importedVariables != []) (
        "/run/current-system/systemd/bin/systemctl --user import-environment "
          + toString (unique cfg.displayManager.importedVariables)
          + toString (lib.unique cfg.displayManager.importedVariables)
      )}

      # Speed up application start by 50-150ms according to
@@ -247,8 +246,8 @@ in
    # that do not have upstream session files (those defined using services.{display,desktop,window}Manager.session options).
    services.displayManager.sessionPackages =
      let
        dms = filter (s: s.manage == "desktop") cfg.displayManager.session;
        wms = filter (s: s.manage == "window") cfg.displayManager.session;
        dms = lib.filter (s: s.manage == "desktop") cfg.displayManager.session;
        wms = lib.filter (s: s.manage == "window") cfg.displayManager.session;

        # Script responsible for starting the window manager and the desktop manager.
        xsession = dm: wm: pkgs.writeScript "xsession" ''
@@ -276,16 +275,16 @@ in
        '';
      in
        # We will generate every possible pair of WM and DM.
        concatLists (
        lib.concatLists (
            lib.mapCartesianProduct
            ({dm, wm}: let
              sessionName = "${dm.name}${optionalString (wm.name != "none") ("+" + wm.name)}";
              script = xsession dm wm;
              desktopNames = if dm ? desktopNames
                             then concatStringsSep ";" dm.desktopNames
                             then lib.concatStringsSep ";" dm.desktopNames
                             else sessionName;
            in
              optional (dm.name != "none" || wm.name != "none")
              lib.optional (dm.name != "none" || wm.name != "none")
                (pkgs.writeTextFile {
                  name = "${sessionName}-xsession";
                  destination = "/share/xsessions/${sessionName}.desktop";
@@ -310,11 +309,11 @@ in
  };

  imports = [
    (mkRemovedOptionModule [ "services" "xserver" "displayManager" "desktopManagerHandlesLidAndPower" ]
    (lib.mkRemovedOptionModule [ "services" "xserver" "displayManager" "desktopManagerHandlesLidAndPower" ]
     "The option is no longer necessary because all display managers have already delegated lid management to systemd.")
    (mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logsXsession" ] [ "services" "displayManager" "logToFile" ])
    (mkRenamedOptionModule [ "services" "xserver" "displayManager" "logToJournal" ] [ "services" "displayManager" "logToJournal" ])
    (mkRenamedOptionModule [ "services" "xserver" "displayManager" "extraSessionFilesPackages" ] [ "services" "displayManager" "sessionPackages" ])
    (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "job" "logsXsession" ] [ "services" "displayManager" "logToFile" ])
    (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "logToJournal" ] [ "services" "displayManager" "logToJournal" ])
    (lib.mkRenamedOptionModule [ "services" "xserver" "displayManager" "extraSessionFilesPackages" ] [ "services" "displayManager" "sessionPackages" ])
  ];

}
+1 −2
Original line number Diff line number Diff line
{ config, lib, ... }:

with lib;

let
  inherit (lib) mkOption types;
  cfg = config.services.xserver.windowManager;
in