From fef6c10b5cb404f1c772c118289a698ef396a654 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Thu, 18 Aug 2022 10:50:11 +0800 Subject: [PATCH 1/6] maintainers: add water-sucks --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 8ef00b74cc26..8bdac4ffe350 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -13856,6 +13856,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"; From 81e4c5cc151b20e6a6dcec153a089b72f7b29d35 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Thu, 18 Aug 2022 10:52:08 +0800 Subject: [PATCH 2/6] lightdm-slick-greeter: init at 1.5.9 --- .../lightdm-slick-greeter/default.nix | 110 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 112 insertions(+) create mode 100644 pkgs/applications/display-managers/lightdm-slick-greeter/default.nix 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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b472f5be828b..cd8249b66f7b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30551,6 +30551,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 { From fdac82a307201be6ee1e27fa24fd04e8e8b2c711 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Thu, 18 Aug 2022 11:19:26 +0800 Subject: [PATCH 3/6] nixos/lightdm-greeters/slick: init --- .../lightdm-greeters/slick.nix | 124 ++++++++++++++++++ .../services/x11/display-managers/lightdm.nix | 1 + 2 files changed, 125 insertions(+) create mode 100644 nixos/modules/services/x11/display-managers/lightdm-greeters/slick.nix 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" From e2ddd98cc91cc7736e9299d0f560164629ac7a98 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 18 Aug 2022 11:21:39 +0800 Subject: [PATCH 4/6] nixos/cinnamon: default to slick-greeter Default in Linux Mint. --- .../services/x11/desktop-managers/cinnamon.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 From 038d91ed4171d5f310f2c30c8f522fcf5e2df818 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 18 Aug 2022 11:32:46 +0800 Subject: [PATCH 5/6] rl-2211: mention blueman & slick-greeter switch --- nixos/doc/manual/from_md/release-notes/rl-2211.section.xml | 4 +++- nixos/doc/manual/release-notes/rl-2211.section.md | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 0d0e2647a070..aa8079b16dbf 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 @@ -97,7 +97,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 c560da8df27a..fa6f49de1114 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -46,7 +46,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. From a33b4a55393db31e7c099b12a433c5b420bd326e Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 18 Aug 2022 11:34:31 +0800 Subject: [PATCH 6/6] cinnamon.mint-artwork: drop unused sed Only useful for GTK greeter, which is no longer the default for Linux Mint. --- pkgs/desktops/cinnamon/mint-artwork/default.nix | 1 - 1 file changed, 1 deletion(-) 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