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

Update README.md with NixOS intructions #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andre-brandao
Copy link

Instructions to use themes on NixOS

@VuiMuich
Copy link

Just in case this helps the review of this PR, I can confirm the example given is working as expected.

@0x006E
Copy link

0x006E commented Jun 19, 2024

I can also confirm this works great with my nix. But how can I also add distrologo to the theme?

@andre-brandao
Copy link
Author

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

@RAVENz46
Copy link

RAVENz46 commented Dec 14, 2024

@0x006E
Hi, I could add distro logo to it.
Here is the example. I hope it helps.
I want to remove selected_theme line from overlays.nix but IDK it's possible.

# 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
    '';
  });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants