Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 31e69100426e
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a3191211f8e2
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Oct 8, 2019

  1. breeze-plymouth: allow usage of custom logo

    (cherry picked from commit 001b42d)
    Mathieu A.-Tetreault authored and ttuegel committed Oct 8, 2019
    Copy the full SHA
    35c9bf5 View commit details

Commits on Jan 16, 2020

  1. Merge pull request #70738 from ttuegel/feature--release-19.09--breeze…

    …-plymouth-custom-logo
    
    breeze-plymouth: allow custom logo (backport)
    ttuegel authored Jan 16, 2020
    Copy the full SHA
    a319121 View commit details
Showing with 33 additions and 28 deletions.
  1. +9 −9 nixos/modules/system/boot/plymouth.nix
  2. +24 −19 pkgs/desktops/plasma-5/breeze-plymouth/default.nix
18 changes: 9 additions & 9 deletions nixos/modules/system/boot/plymouth.nix
Original file line number Diff line number Diff line change
@@ -5,17 +5,20 @@ with lib;
let

inherit (pkgs) plymouth;
inherit (pkgs) nixos-icons;

cfg = config.boot.plymouth;

breezePlymouth = pkgs.breeze-plymouth.override {
nixosBranding = true;
nixosVersion = config.system.nixos.release;
nixosBreezePlymouth = pkgs.breeze-plymouth.override {
logoFile = cfg.logo;
logoName = "nixos";
osName = "NixOS";
osVersion = config.system.nixos.release;
};

themesEnv = pkgs.buildEnv {
name = "plymouth-themes";
paths = [ plymouth breezePlymouth ] ++ cfg.themePackages;
paths = [ plymouth ] ++ cfg.themePackages;
};

configFile = pkgs.writeText "plymouthd.conf" ''
@@ -35,7 +38,7 @@ in
enable = mkEnableOption "Plymouth boot splash screen";

themePackages = mkOption {
default = [];
default = [ nixosBreezePlymouth ];
type = types.listOf types.package;
description = ''
Extra theme packages for plymouth.
@@ -52,10 +55,7 @@ in

logo = mkOption {
type = types.path;
default = pkgs.fetchurl {
url = "https://nixos.org/logo/nixos-hires.png";
sha256 = "1ivzgd7iz0i06y36p8m5w48fd8pjqwxhdaavc0pxs7w1g7mcy5si";
};
default = "${nixos-icons}/share/icons/hicolor/128x128/apps/nix-snowflake.png";
defaultText = ''pkgs.fetchurl {
url = "https://nixos.org/logo/nixos-hires.png";
sha256 = "1ivzgd7iz0i06y36p8m5w48fd8pjqwxhdaavc0pxs7w1g7mcy5si";
43 changes: 24 additions & 19 deletions pkgs/desktops/plasma-5/breeze-plymouth/default.nix
Original file line number Diff line number Diff line change
@@ -8,37 +8,42 @@
imagemagick,
netpbm,
perl,
# these will typically need to be set via an override
# in a NixOS context
nixosBranding ? false,
nixosName ? "NixOS",
nixosVersion ? "",
logoName ? null,
logoFile ? null,
osName ? null,
osVersion ? null,
topColor ? "black",
bottomColor ? "black"
}:

let
logoName = "nixos";
let
validColors = [ "black" "cardboard_grey" "charcoal_grey" "icon_blue" "paper_white" "plasma_blue" "neon_blue" "neon_green" ];
resolvedLogoName = if (logoFile != null && logoName == null) then lib.strings.removeSuffix ".png" (baseNameOf(toString logoFile)) else logoName;
in
assert lib.asserts.assertOneOf "topColor" topColor validColors;
assert lib.asserts.assertOneOf "bottomColor" bottomColor validColors;


mkDerivation {
name = "breeze-plymouth";
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ plymouth ] ++ lib.optionals nixosBranding [ imagemagick netpbm perl ];
buildInputs = [ plymouth ] ++ lib.optionals (logoFile != null) [ imagemagick netpbm perl ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
cmakeFlags = lib.optionals nixosBranding [
"-DDISTRO_NAME=${nixosName}"
"-DDISTRO_VERSION=${nixosVersion}"
"-DDISTRO_LOGO=${logoName}"
"-DBACKGROUND_TOP_COLOR=${topColor}"
"-DBACKGROUND_BOTTOM_COLOR=${bottomColor}"
];
cmakeFlags = []
++ lib.optional (osName != null) "-DDISTRO_NAME=${osName}"
++ lib.optional (osVersion != null) "-DDISTRO_VERSION=${osVersion}"
++ lib.optional (logoName != null) "-DDISTRO_LOGO=${logoName}"
++ lib.optional (topColor != null) "-DBACKGROUND_TOP_COLOR=${topColor}"
++ lib.optional (bottomColor != null) "-DBACKGROUND_BOTTOM_COLOR=${bottomColor}"
;

postPatch = ''
substituteInPlace cmake/FindPlymouth.cmake --subst-var out
'' + lib.optionalString nixosBranding ''
cp ${nixos-icons}/share/icons/hicolor/128x128/apps/nix-snowflake.png breeze/images/${logoName}.logo.png
'' + lib.optionalString (logoFile != null) ''
cp ${logoFile} breeze/images/${resolvedLogoName}.logo.png
# conversion for 16bit taken from the breeze-plymouth readme
convert ${nixos-icons}/share/icons/hicolor/128x128/apps/nix-snowflake.png -alpha Background -background "#000000" -fill "#000000" -flatten tmp.png
pngtopnm tmp.png | pnmquant 16 | pnmtopng > breeze/images/16bit/${logoName}.logo.png
convert ${logoFile} -alpha Background -background "#000000" -fill "#000000" -flatten tmp.png
pngtopnm tmp.png | pnmquant 16 | pnmtopng > breeze/images/16bit/${resolvedLogoName}.logo.png
'';
}