Files
nixos/Droidnix/generated/hosts/traveldroid/boot.nix
T
2026-03-22 10:24:57 +00:00

82 lines
2.3 KiB
Nix

{ pkgs, config, lib, flakeRoot, ... }:
let
# Paths for theming
grubThemeDir = "/boot/grub/themes/catppuccin-mocha";
grubThemeFile = "${grubThemeDir}/theme.txt";
plymouthThemeDir = "/usr/share/plymouth/themes/catppuccin";
plymouthSplash = "${flakeRoot}/assets/system/theming/boot/mocha.webp";
in
{
boot = {
# Kernel and initrd settings
initrd = {
verbose = false;
kernelModules = [];
};
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [ "quiet" "udev.log_level=3" "systemd.show_status=auto" ];
consoleLogLevel = 3;
# Filesystems supported at boot
supportedFilesystems = [ "ntfs" ];
# GRUB loader
loader.grub = {
enable = true;
efiSupport = true;
devices = [ "/dev/nvme0n1" ]; # <- must point to real disk
useOSProber = true;
};
boot.efi.canTouchEfiVariables = true;
# Plymouth splashscreen
plymouth = {
enable = true;
theme = "catppuccin";
themePackages = with pkgs; [
(adi1090x-plymouth-themes.override {
selected_themes = [ "spinner" ]; # default, overridden below
})
];
};
};
# Activation script: write Catppuccin GRUB theme
system.activationScripts.grubTheme = {
text = ''
mkdir -p ${grubThemeDir}
# Write a simple theme.txt using Catppuccin Mocha colors
cat > ${grubThemeFile} <<EOF
# Catppuccin Mocha GRUB theme
desktop-color = #1e1e2e
normal-color = #cdd6f4
selected-item-color = #f5e0dc
selected-item-highlight-color = #f5c2e7
EOF
# Copy background image if it exists
if [ -f "${flakeRoot}/assets/system/theming/boot/background.png" ]; then
cp "${flakeRoot}/assets/system/theming/boot/background.png" "${grubThemeDir}/background.png"
fi
echo "GRUB Catppuccin Mocha theme installed."
'';
};
# Activation script: install Plymouth splash image
system.activationScripts.plymouthTheme = {
text = ''
if [ -f "${plymouthSplash}" ]; then
mkdir -p ${plymouthThemeDir}
cp "${plymouthSplash}" "${plymouthThemeDir}/splash.png"
update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth \
${plymouthThemeDir}/splash.png 100
echo "Plymouth Catppuccin splash installed."
fi
'';
};
}