Update README.md with NixOS intructions#46
Update README.md with NixOS intructions#46andre-brandao wants to merge 1 commit intoadi1090x:masterfrom
Conversation
|
Just in case this helps the review of this PR, I can confirm the example given is working as expected. |
|
I can also confirm this works great with my nix. But how can I also add distrologo to the theme? |
you probably need to override the theme script and copy the logo file in the install phase, I did something like that to change the background of my sddm-theme it might be different but if you wanna take a look of how I solved a similar issue with sddm i will link my config https://github.com/andre-brandao/nixos/blob/main/packages/sddm-theme.nix |
|
@0x006E # configuration.nix
boot = {
plymouth = {
enable = true;
theme = "CHANGEME";
themePackages = with pkgs; [
(adi1090x-plymouth-themes.override {
selected_themes = [ config.boot.plymouth.theme ];
})
(runCommand "add-logos" { inherit (config.boot.plymouth) logo theme; } ''
mkdir -p $out/share/plymouth/themes/$theme
ln -s $logo $out/share/plymouth/themes/$theme/header-image.png
'')
];
};
};# overlays.nix
final: prev: {
adi1090x-plymouth-themes = prev.adi1090x-plymouth-themes.overrideAttrs (oldAttrs: rec {
selected_themes = [ "CHANGEME" ];
installPhase = oldAttrs.installPhase + ''
for theme in ${toString selected_themes}; do
echo 'nixos_image = Image("header-image.png");' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite = Sprite();' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite.SetImage(nixos_image);' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite.SetX(Window.GetX() + (Window.GetWidth() / 2 - nixos_image.GetWidth() / 2));' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite.SetY(Window.GetHeight() - nixos_image.GetHeight() - 50);' >> $out/share/plymouth/themes/$theme/$theme.script
done
'';
});
}Edit: I fix some. May be this way more easy cuz you don't need overlays.nix boot.plymouth = {
enable = true;
logo = ./plymouth.png;
theme = "circuit";
themePackages = with pkgs; [
(
(pkgs.adi1090x-plymouth-themes.overrideAttrs (oldAttrs: {
installPhase =
(oldAttrs.installPhase or "")
+ ''
for theme in ${config.boot.plymouth.theme}; do
echo 'nixos_image = Image("header-image.png");' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite = Sprite();' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite.SetImage(nixos_image);' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite.SetX(Window.GetX() + (Window.GetWidth() / 2 - nixos_image.GetWidth() / 2));' >> $out/share/plymouth/themes/$theme/$theme.script
echo 'nixos_sprite.SetY(Window.GetHeight() - nixos_image.GetHeight() - 50);' >> $out/share/plymouth/themes/$theme/$theme.script
done
'';
})).override
{ selected_themes = [ config.boot.plymouth.theme ]; }
)
(runCommand "add-logos" { inherit (config.boot.plymouth) logo theme; } ''
mkdir -p $out/share/plymouth/themes/$theme
ln -s $logo $out/share/plymouth/themes/$theme/header-image.png
'')
];
}; |
Instructions to use themes on NixOS