-
Notifications
You must be signed in to change notification settings - Fork 120
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
Update README.md with NixOS intructions #46
base: master
Are you sure you want to change the base?
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 |
@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