diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index f012c1b4495d..a514d31dc84c 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -13893,6 +13893,12 @@ github = "wamserma"; githubId = 60148; }; + water-sucks = { + email = "varun@cvte.org"; + name = "Varun Narravula"; + github = "water-sucks"; + githubId = 68445574; + }; waynr = { name = "Wayne Warren"; email = "wayne.warren.s@gmail.com"; diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index 0f4c6b73e55f..2e53929f061f 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -125,7 +125,9 @@ - Cinnamon has been updated to 5.4. + Cinnamon has been updated to 5.4. While at it, the cinnamon + module now defaults to blueman as bluetooth manager and + slick-greeter as lightdm greeter to match upstream. diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index 05611ddce508..1f1d2f34074b 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -50,7 +50,8 @@ In addition to numerous new and upgraded packages, this release has the followin - PHP now defaults to PHP 8.1, updated from 8.0. -- Cinnamon has been updated to 5.4. +- Cinnamon has been updated to 5.4. While at it, the cinnamon module now defaults to + blueman as bluetooth manager and slick-greeter as lightdm greeter to match upstream. - `hardware.nvidia` has a new option `open` that can be used to opt in the opensource version of NVIDIA kernel driver. Note that the driver's support for GeForce and Workstation GPUs is still alpha quality, see [NVIDIA Releases Open-Source GPU Kernel Modules](https://developer.nvidia.com/blog/nvidia-releases-open-source-gpu-kernel-modules/) for the official announcement. diff --git a/nixos/modules/services/x11/desktop-managers/cinnamon.nix b/nixos/modules/services/x11/desktop-managers/cinnamon.nix index 26a5191761d6..a8e0bf9dddb6 100644 --- a/nixos/modules/services/x11/desktop-managers/cinnamon.nix +++ b/nixos/modules/services/x11/desktop-managers/cinnamon.nix @@ -58,13 +58,18 @@ in }; config = mkMerge [ - (mkIf (cfg.enable && config.services.xserver.displayManager.lightdm.enable && config.services.xserver.displayManager.lightdm.greeters.gtk.enable) { - services.xserver.displayManager.lightdm.greeters.gtk.extraConfig = mkDefault (builtins.readFile "${pkgs.cinnamon.mint-artwork}/etc/lightdm/lightdm-gtk-greeter.conf.d/99_linuxmint.conf"); - }) - (mkIf cfg.enable { services.xserver.displayManager.sessionPackages = [ pkgs.cinnamon.cinnamon-common ]; + services.xserver.displayManager.lightdm.greeters.slick = { + enable = mkDefault true; + + # Taken from mint-artwork.gschema.override + theme.name = mkDefault "Mint-X"; + theme.package = mkDefault pkgs.cinnamon.mint-themes; + iconTheme.name = mkDefault "Mint-X-Dark"; + iconTheme.package = mkDefault pkgs.cinnamon.mint-x-icons; + }; services.xserver.displayManager.sessionCommands = '' if test "$XDG_CURRENT_DESKTOP" = "Cinnamon"; then true diff --git a/nixos/modules/services/x11/display-managers/lightdm-greeters/slick.nix b/nixos/modules/services/x11/display-managers/lightdm-greeters/slick.nix new file mode 100644 index 000000000000..5199f33c0611 --- /dev/null +++ b/nixos/modules/services/x11/display-managers/lightdm-greeters/slick.nix @@ -0,0 +1,124 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + ldmcfg = config.services.xserver.displayManager.lightdm; + cfg = ldmcfg.greeters.slick; + + inherit (pkgs) writeText; + + theme = cfg.theme.package; + icons = cfg.iconTheme.package; + font = cfg.font.package; + + slickGreeterConf = writeText "slick-greeter.conf" '' + [Greeter] + background=${ldmcfg.background} + theme-name=${cfg.theme.name} + icon-theme-name=${cfg.iconTheme.name} + font-name=${cfg.font.name} + draw-user-backgrounds=${boolToString cfg.draw-user-backgrounds} + ${cfg.extraConfig} + ''; +in +{ + options = { + services.xserver.displayManager.lightdm.greeters.slick = { + enable = mkOption { + type = types.bool; + default = true; + description = lib.mdDoc '' + Whether to enable lightdm-slick-greeter as the lightdm greeter. + ''; + }; + + theme = { + package = mkOption { + type = types.package; + default = pkgs.gnome.gnome-themes-extra; + defaultText = literalExpression "pkgs.gnome.gnome-themes-extra"; + description = lib.mdDoc '' + The package path that contains the theme given in the name option. + ''; + }; + + name = mkOption { + type = types.str; + default = "Adwaita"; + description = lib.mdDoc '' + Name of the theme to use for the lightdm-slick-greeter. + ''; + }; + }; + + iconTheme = { + package = mkOption { + type = types.package; + default = pkgs.gnome.adwaita-icon-theme; + defaultText = literalExpression "pkgs.gnome.adwaita-icon-theme"; + description = lib.mdDoc '' + The package path that contains the icon theme given in the name option. + ''; + }; + + name = mkOption { + type = types.str; + default = "Adwaita"; + description = lib.mdDoc '' + Name of the icon theme to use for the lightdm-slick-greeter. + ''; + }; + }; + + font = { + package = mkOption { + type = types.package; + default = pkgs.ubuntu_font_family; + defaultText = literalExpression "pkgs.ubuntu_font_family"; + description = lib.mdDoc '' + The package path that contains the font given in the name option. + ''; + }; + + name = mkOption { + type = types.str; + default = "Ubuntu 11"; + description = lib.mdDoc '' + Name of the font to use. + ''; + }; + }; + + draw-user-backgrounds = mkEnableOption "draw user backgrounds"; + + extraConfig = mkOption { + type = types.lines; + default = ""; + description = lib.mdDoc '' + Extra configuration that should be put in the lightdm-slick-greeter.conf + configuration file. + ''; + }; + }; + }; + + config = mkIf (ldmcfg.enable && cfg.enable) { + services.xserver.displayManager.lightdm = { + greeters.gtk.enable = false; + greeter = mkDefault { + package = pkgs.lightdm-slick-greeter.xgreeters; + name = "lightdm-slick-greeter"; + }; + }; + + environment.systemPackages = [ + icons + theme + ]; + + fonts.fonts = [ font ]; + + environment.etc."lightdm/slick-greeter.conf".source = slickGreeterConf; + }; +} diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix index 2d1ae0ed0a36..1d557fb5f33d 100644 --- a/nixos/modules/services/x11/display-managers/lightdm.nix +++ b/nixos/modules/services/x11/display-managers/lightdm.nix @@ -82,6 +82,7 @@ in ./lightdm-greeters/enso-os.nix ./lightdm-greeters/pantheon.nix ./lightdm-greeters/tiny.nix + ./lightdm-greeters/slick.nix (mkRenamedOptionModule [ "services" "xserver" "displayManager" "lightdm" "autoLogin" "enable" ] [ "services" "xserver" diff --git a/pkgs/applications/display-managers/lightdm-slick-greeter/default.nix b/pkgs/applications/display-managers/lightdm-slick-greeter/default.nix new file mode 100644 index 000000000000..fe8132fb1b46 --- /dev/null +++ b/pkgs/applications/display-managers/lightdm-slick-greeter/default.nix @@ -0,0 +1,110 @@ +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, python3 +, vala +, intltool +, autoreconfHook +, wrapGAppsHook +, lightdm +, gtk3 +, pixman +, libcanberra +, libX11 +, libXext +, linkFarm +, lightdm-slick-greeter +, numlockx +}: + +stdenv.mkDerivation rec { + pname = "lightdm-slick-greeter"; + version = "1.5.9"; + + src = fetchFromGitHub { + owner = "linuxmint"; + repo = "slick-greeter"; + rev = version; + sha256 = "sha256-UEzidH4ZWggcOWHHuAclHbbgATDBdogL99Ze0PlwRoc="; + }; + + nativeBuildInputs = [ + pkg-config + vala + intltool + autoreconfHook + wrapGAppsHook + python3 + python3.pkgs.wrapPython + ]; + + buildInputs = [ + lightdm + gtk3 + pixman + libcanberra + libX11 + libXext + ]; + + pythonPath = [ + python3.pkgs.pygobject3 # for slick-greeter-check-hidpi + ]; + + postPatch = '' + substituteInPlace src/slick-greeter.vala \ + --replace "/usr/bin/numlockx" "${numlockx}/bin/numlockx" \ + --replace "/usr/share/xsessions/" "/run/current-system/sw/share/xsessions/" \ + --replace "/usr/bin/slick-greeter" "${placeholder "out"}/bin/slick-greeter" + + substituteInPlace src/session-list.vala \ + --replace "/usr/share" "${placeholder "out"}/share" + + patchShebangs files/usr/bin/* + ''; + + preAutoreconf = '' + # intltoolize fails during autoreconfPhase unless this + # directory is created manually. + mkdir m4 + ''; + + configureFlags = [ + "--localstatedir=/var" + "--sysconfdir=/etc" + "--sbindir=${placeholder "out"}/bin" + ]; + + installFlags = [ + "localstatedir=\${TMPDIR}" + "sysconfdir=${placeholder "out"}/etc" + ]; + + postInstall = '' + substituteInPlace "$out/share/xgreeters/slick-greeter.desktop" \ + --replace "Exec=slick-greeter" "Exec=$out/bin/slick-greeter" + + cp -r files/usr/* $out + ''; + + preFixup = '' + buildPythonPath "$out $pythonPath" + gappsWrapperArgs+=( + --prefix PYTHONPATH : "$program_PYTHONPATH" + ) + ''; + + passthru.xgreeters = linkFarm "lightdm-slick-greeter-xgreeters" [{ + path = "${lightdm-slick-greeter}/share/xgreeters/slick-greeter.desktop"; + name = "lightdm-slick-greeter.desktop"; + }]; + + meta = with lib; { + description = "A slick-looking LightDM greeter"; + homepage = "https://github.com/linuxmint/slick-greeter"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ water-sucks ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/desktops/cinnamon/mint-artwork/default.nix b/pkgs/desktops/cinnamon/mint-artwork/default.nix index 16ad17294071..833a28967b4d 100644 --- a/pkgs/desktops/cinnamon/mint-artwork/default.nix +++ b/pkgs/desktops/cinnamon/mint-artwork/default.nix @@ -28,7 +28,6 @@ stdenv.mkDerivation rec { -e s,DMZ-White,Vanilla-DMZ,g \ -e s,DMZ-Black,Vanilla-DMZ-AA,g \ -e s,linuxmint-logo-5,cinnamon-symbolic,g \ - -e s,^theme-name=Mint-X$,theme-name=Mint-X-Dark,g \ {} + # fixup broken symlink diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6f8786a40cf4..78297451107c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30619,6 +30619,8 @@ with pkgs; inherit (xfce) xfce4-dev-tools; }; + lightdm-slick-greeter = callPackage ../applications/display-managers/lightdm-slick-greeter { }; + lightdm-mini-greeter = callPackage ../applications/display-managers/lightdm-mini-greeter { }; lightdm-tiny-greeter = callPackage ../applications/display-managers/lightdm-tiny-greeter {