Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`services.xserver.displayManager.job.execCmd' is defined multiple times #47945

Closed
hcmeyer opened this issue Oct 5, 2018 · 7 comments
Closed

Comments

@hcmeyer
Copy link

hcmeyer commented Oct 5, 2018

Issue description

The unique option services.xserver.displayManager.job.execCmd' is defined multiple times in /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/services/x11/display-managers/sddm.nix' and `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix'.

Steps to reproduce

nixos-rebuild switch --upgrade

Technical details

first try with nixos-18.09

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.14.71, NixOS, 18.03.133245.d16a7abceb7 (Impala)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.0.4
  • channels(root): "nixos-18.09beta739.6cbd1ec4b04"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@hedning
Copy link
Contributor

hedning commented Oct 6, 2018

It looks like the system is trying to enable botth gdm and sddm which doesn't work. Probably related to #30890. What's your services.xserver config? Specifically desktopManager and displayManager.

@hcmeyer
Copy link
Author

hcmeyer commented Oct 6, 2018

I am not sure where or what to look for, but

/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/services/x11/display-managers/default.nix says:

options = {

services.xserver.displayManager = {

  xauthBin = mkOption {
    internal = true;
    default = "${xorg.xauth}/bin/xauth";
    description = "Path to the <command>xauth</command> program used by display managers.";
  };

  xserverBin = mkOption {
    type = types.path;
    description = "Path to the X server used by display managers.";
  };

  xserverArgs = mkOption {
    type = types.listOf types.str;
    default = [];
    example = [ "-ac" "-logverbose" "-verbose" "-nolisten tcp" ];
    description = "List of arguments for the X server.";
  };

  sessionCommands = mkOption {
    type = types.lines;
    default = "";
    example =
      ''
        xmessage "Hello World!" &
      '';
    description = "Shell commands executed just before the window or desktop manager is started.";
  };

  hiddenUsers = mkOption {
    type = types.listOf types.str;
    default = [ "nobody" ];
    description = ''
      A list of users which will not be shown in the display manager.
    '';
  };

and

/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/services/x11/desktop-managers/default.nix says:

services.xserver.desktopManager = {

  wallpaper = {
    mode = mkOption {
      type = types.enum [ "center" "fill" "max" "scale" "tile" ];
      default = "scale";
      example = "fill";
      description = ''
        The file <filename>~/.background-image</filename> is used as a background image.
        This option specifies the placement of this image onto your desktop.

        Possible values:
        <literal>center</literal>: Center the image on the background. If it is too small, it will be surrounded by a black border.
        <literal>fill</literal>: Like <literal>scale</literal>, but preserves aspect ratio by zooming the image until it fits. Either a horizontal or a vertical part of the image will be cut off.
        <literal>max</literal>: Like <literal>fill</literal>, but scale the image to the maximum size that fits the screen with black borders on one side.
        <literal>scale</literal>: Fit the file into the background without repeating it, cutting off stuff or using borders. But the aspect ratio is not preserved either.
        <literal>tile</literal>: Tile (repeat) the image in case it is too small for the screen.
      '';
    };

    combineScreens = mkOption {
      type = types.bool;
      default = false;
      description = ''
        When set to <literal>true</literal> the wallpaper will stretch across all screens.
        When set to <literal>false</literal> the wallpaper is duplicated to all screens.
      '';
    };
  };

  session = mkOption {
    internal = true;
    default = [];
    example = singleton
      { name = "kde";
        bgSupport = true;
        start = "...";
      };
    description = ''
      Internal option used to add some common line to desktop manager
      scripts before forwarding the value to the
      <varname>displayManager</varname>.
    '';
    apply = list: {
      list = map (d: d // {
        manage = "desktop";
        start = d.start
        + 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
          else
            # Use a solid black background as fallback
            ${pkgs.xorg.xsetroot}/bin/xsetroot -solid black
          fi
        '';
      }) list;
      needBGPackages = [] != filter needBGCond list;
    };
  };

  default = mkOption {
    type = types.str;
    default = "";
    example = "none";
    description = "Default desktop manager loaded if none have been chosen.";
    apply = defaultDM:
      if defaultDM == "" && cfg.session.list != [] then
        (head cfg.session.list).name
      else if any (w: w.name == defaultDM) cfg.session.list then
        defaultDM
      else
        builtins.trace ''
          Default desktop manager (${defaultDM}) not found at evaluation time.
          These are the known valid session names:
            ${concatMapStringsSep "\n  " (w: "services.xserver.desktopManager.default = \"${w.name}\";") cfg.session.list}
          It's also possible the default can be found in one of these packages:
            ${concatMapStringsSep "\n  " (p: p.name) config.services.xserver.displayManager.extraSessionFilePackages}
        '' defaultDM;
  };

};

};

These are where grep finds desktopManager and displayManager on the left side of an equals sign.

@hedning
Copy link
Contributor

hedning commented Oct 7, 2018

Ah, sorry should've specified that I was referring to your system configuration file: /etc/nixos/configuration.nix.

If both gdm and sddm is enabled in your config, simply remove the one you don't want (gdm is typically used by gnome and sddm by plasma/kde). If that's not the case we're dealing with a bug (probably triggered by enabling the plasma5 and gnome3 desktop managers).

Stuff to try out if the above doesn't work or apply would be to explicitly set the display manager to your preference (eg. gdm if you're using gnome and sddm if you're using plasma). If that doesn't work try to also disable the display manager you're not using, eg. services.xserver.displayManager.sddm.enable = false. That should hopefully fix it until we can fix the problem properly.

@hcmeyer
Copy link
Author

hcmeyer commented Oct 7, 2018 via email

@hedning
Copy link
Contributor

hedning commented Oct 7, 2018

Glad it worked. You should be able to replace ...gnome3.enable = true with networking.networkmanager.enable = true, that way you'll avoid pulling in a bunch of stuff you don't necessarily want. I'm guessing this happened when trying to upgrade to 18.09? Else I can't quite understand how gnome3 would pull in gdm.

A display manager is simply used to log into a desktop manager/environment like xfce.

@hcmeyer
Copy link
Author

hcmeyer commented Oct 7, 2018 via email

@hedning
Copy link
Contributor

hedning commented Nov 18, 2018

The root cause should've been addressed in #48080.

@hedning hedning closed this as completed Nov 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants