2016-08-04 17:00:12 +02:00
|
|
|
{
|
2017-11-08 00:14:26 +01:00
|
|
|
mkDerivation,
|
|
|
|
lib,
|
|
|
|
copyPathsToStore,
|
2017-02-26 13:49:15 +01:00
|
|
|
extra-cmake-modules,
|
2017-11-08 00:14:26 +01:00
|
|
|
plymouth,
|
|
|
|
nixos-icons,
|
|
|
|
imagemagick,
|
|
|
|
netpbm,
|
|
|
|
perl,
|
|
|
|
# these will typically need to be set via an override
|
|
|
|
# in a NixOS context
|
|
|
|
nixosBranding ? false,
|
|
|
|
nixosName ? "NixOS",
|
|
|
|
nixosVersion ? "",
|
|
|
|
topColor ? "black",
|
|
|
|
bottomColor ? "black"
|
2016-08-04 17:00:12 +02:00
|
|
|
}:
|
|
|
|
|
2017-11-08 00:14:26 +01:00
|
|
|
let
|
|
|
|
logoName = "nixos";
|
|
|
|
in
|
2017-05-15 18:44:58 +02:00
|
|
|
mkDerivation {
|
2016-08-04 17:00:12 +02:00
|
|
|
name = "breeze-plymouth";
|
2017-02-26 13:49:15 +01:00
|
|
|
nativeBuildInputs = [ extra-cmake-modules ];
|
2017-11-08 00:14:26 +01:00
|
|
|
buildInputs = [ plymouth ] ++ lib.optionals nixosBranding [ imagemagick netpbm perl ];
|
2016-08-04 17:00:12 +02:00
|
|
|
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
2017-11-08 00:14:26 +01:00
|
|
|
cmakeFlags = lib.optionals nixosBranding [
|
|
|
|
"-DDISTRO_NAME=${nixosName}"
|
|
|
|
"-DDISTRO_VERSION=${nixosVersion}"
|
|
|
|
"-DDISTRO_LOGO=${logoName}"
|
|
|
|
"-DBACKGROUND_TOP_COLOR=${topColor}"
|
|
|
|
"-DBACKGROUND_BOTTOM_COLOR=${bottomColor}"
|
|
|
|
];
|
2016-08-04 17:00:12 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace cmake/FindPlymouth.cmake --subst-var out
|
2017-11-08 00:14:26 +01:00
|
|
|
'' + lib.optionalString nixosBranding ''
|
|
|
|
cp ${nixos-icons}/share/icons/hicolor/128x128/apps/nix-snowflake.png breeze/images/${logoName}.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
|
2016-08-04 17:00:12 +02:00
|
|
|
'';
|
|
|
|
}
|