diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index bbc7feb2d049..803419f5d6c6 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -37,10 +37,10 @@ let chmod -R a+w $out/share/gsettings-schemas/nixos-gsettings-overrides cat - > $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/nixos-defaults.gschema.override <<- EOF [org.gnome.desktop.background] - picture-uri='file://${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/artwork/gnome/nix-wallpaper-simple-dark-gray.png' + picture-uri='file://${pkgs.nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}' [org.gnome.desktop.screensaver] - picture-uri='file://${pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom}/share/artwork/gnome/nix-wallpaper-simple-dark-gray_bottom.png' + picture-uri='file://${pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath}' [org.gnome.shell] favorite-apps=[ 'org.gnome.Epiphany.desktop', 'org.gnome.Geary.desktop', 'org.gnome.Music.desktop', 'org.gnome.Photos.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop' ] @@ -320,6 +320,8 @@ in gnome-shell gnome-shell-extensions gnome-themes-extra + nixos-artwork.wallpapers.simple-dark-gray + nixos-artwork.wallpapers.simple-dark-gray-bottom pkgs.gnome-user-docs pkgs.orca pkgs.glib # for gsettings diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 5fcc8590232a..6dabca6bf096 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -180,6 +180,7 @@ in gtk3.out hicolor-icon-theme lightlocker + nixos-artwork.wallpapers.simple-dark-gray onboard qgnomeplatform shared-mime-info diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix index 479548863b47..678cade44427 100644 --- a/nixos/modules/services/x11/display-managers/lightdm.nix +++ b/nixos/modules/services/x11/display-managers/lightdm.nix @@ -132,8 +132,9 @@ in }; background = mkOption { - type = types.str; - default = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom}/share/artwork/gnome/nix-wallpaper-simple-dark-gray_bottom.png"; + type = types.path; + # Manual cannot depend on packages, we are actually setting the default in config below. + defaultText = "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath"; description = '' The background image or color to use. ''; @@ -212,6 +213,9 @@ in } ]; + # Keep in sync with the defaultText value from the option definition. + services.xserver.displayManager.lightdm.background = mkDefault pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath; + # Set default session in session chooser to a specified values – basically ignore session history. # Auto-login is already covered by a config value. services.xserver.displayManager.job.preStart = optionalString (!cfg.autoLogin.enable && dmcfg.defaultSession != null) '' diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 67e8bf6fd654..3975372e15ec 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -83,7 +83,7 @@ let ] ++ (optional (cfg.fontSize!=null) "--size ${toString cfg.fontSize}"))) ); - defaultSplash = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray-bootloader}/share/artwork/gnome/nix-wallpaper-simple-dark-gray_bootloader.png"; + defaultSplash = pkgs.nixos-artwork.wallpapers.simple-dark-gray-bootloader.gnomeFilePath; in { diff --git a/pkgs/data/misc/nixos-artwork/wallpapers.nix b/pkgs/data/misc/nixos-artwork/wallpapers.nix index a6a368e26e07..6e6b6e92678e 100644 --- a/pkgs/data/misc/nixos-artwork/wallpapers.nix +++ b/pkgs/data/misc/nixos-artwork/wallpapers.nix @@ -3,12 +3,18 @@ let mkNixBackground = { name, src, description }: - stdenv.mkDerivation { + let + pkg = stdenv.mkDerivation { inherit name src; dontUnpack = true; installPhase = '' + # GNOME + mkdir -p $out/share/backgrounds/nixos + ln -s $src $out/share/backgrounds/nixos/${src.name} + + # TODO: is this path still needed? mkdir -p $out/share/artwork/gnome ln -s $src $out/share/artwork/gnome/${src.name} @@ -22,6 +28,11 @@ X-KDE-PluginInfo-Name=${name} _EOF ''; + passthru = { + gnomeFilePath = "${pkg}/share/backgrounds/nixos/${src.name}"; + kdeFilePath = "${pkg}/share/wallpapers/${name}/contents/images/${src.name}"; + }; + meta = with stdenv.lib; { inherit description; homepage = "https://github.com/NixOS/nixos-artwork"; @@ -29,6 +40,7 @@ _EOF platforms = platforms.all; }; }; +in pkg; in diff --git a/pkgs/desktops/pantheon/desktop/elementary-default-settings/default.nix b/pkgs/desktops/pantheon/desktop/elementary-default-settings/default.nix index 4e8d8bfeb150..3215c001a5e7 100644 --- a/pkgs/desktops/pantheon/desktop/elementary-default-settings/default.nix +++ b/pkgs/desktops/pantheon/desktop/elementary-default-settings/default.nix @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "--sysconfdir=${placeholder "out"}/etc" - "-Ddefault-wallpaper=${nixos-artwork.wallpapers.simple-dark-gray}/share/artwork/gnome/nix-wallpaper-simple-dark-gray.png" + "-Ddefault-wallpaper=${nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}" "-Dplank-dockitems=false" ]; diff --git a/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix b/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix index 64c4509280a0..c460d45dfeee 100644 --- a/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix +++ b/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix @@ -89,7 +89,7 @@ stdenv.mkDerivation rec { # Needed until https://github.com/elementary/greeter/issues/360 is fixed (substituteAll { src = ./hardcode-fallback-background.patch; - default_wallpaper = "${nixos-artwork.wallpapers.simple-dark-gray}/share/artwork/gnome/nix-wallpaper-simple-dark-gray.png"; + default_wallpaper = "${nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}"; }) ]; @@ -113,7 +113,7 @@ stdenv.mkDerivation rec { # Use NixOS default wallpaper substituteInPlace $out/etc/lightdm/io.elementary.greeter.conf \ --replace "#default-wallpaper=/usr/share/backgrounds/elementaryos-default" \ - "default-wallpaper=${nixos-artwork.wallpapers.simple-dark-gray}/share/artwork/gnome/nix-wallpaper-simple-dark-gray.png" + "default-wallpaper=${nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}" substituteInPlace $out/share/xgreeters/io.elementary.greeter.desktop \ --replace "Exec=io.elementary.greeter" "Exec=$out/bin/io.elementary.greeter"