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

Gnome and Pantheon: install nixos wallpapers #86163

Merged
merged 4 commits into from
Jun 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions nixos/modules/services/x11/desktop-managers/gnome3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/x11/desktop-managers/pantheon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ in
gtk3.out
hicolor-icon-theme
lightlocker
nixos-artwork.wallpapers.simple-dark-gray
onboard
qgnomeplatform
shared-mime-info
Expand Down
8 changes: 6 additions & 2 deletions nixos/modules/services/x11/display-managers/lightdm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
'';
Expand Down Expand Up @@ -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) ''
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/loader/grub/grub.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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

{
Expand Down
14 changes: 13 additions & 1 deletion pkgs/data/misc/nixos-artwork/wallpapers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not see artwork used within path when searching g-c-c. Googling "/usr/share/artwork/gnome" shows no results, without gnome only few mentions but none of them look official. We might want to keep this for backwards compatibility, though.

ln -s $src $out/share/artwork/gnome/${src.name}

Expand All @@ -22,13 +28,19 @@ 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";
license = licenses.free;
platforms = platforms.all;
};
};
in pkg;

in

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
})
];

Expand All @@ -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"
Expand Down