Skip to content

Commit b06d3f0

Browse files
committed
aenderer: add grub theme
1 parent e09fe56 commit b06d3f0

3 files changed

Lines changed: 62 additions & 1 deletion

File tree

flake-packages.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
build-linux = pkgs.vmTools.runInLinuxVM pkgs.linuxPackages.kernel;
3232
core-to-core-latency = pkgs.callPackage ./pkgs/core-to-core-latency/default.nix { };
3333
kdeSplashScreen = pkgs.callPackage ./pkgs/kde-splash { };
34+
grub-theme = pkgs.callPackage ./pkgs/grub-theme.nix { };
3435
synatudor-00fd = pkgs.callPackage ./pkgs/synatudor.nix {};
3536
};
3637
};

modules/hardware/hardware-aenderer.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ inputs, modulesPath, ... }:
1+
{ inputs, modulesPath, flakepkgs, ... }:
22

33
{
44
imports = [
@@ -15,6 +15,7 @@
1515
# boot.loader.grub.devices = [ "/dev/disk/by-id/nvme-Micron_MTFDKBA512TGD-2BK15ABLT_253652D5E602" ];
1616
boot.loader.grub.devices = [ "nodev" ];
1717
boot.loader.grub.gfxmodeEfi = "1920x1200";
18+
boot.loader.grub.theme = flakepkgs.grub-theme;
1819

1920
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" ];
2021
boot.initrd.kernelModules = [ ];

pkgs/grub-theme.nix

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{ pkgs }:
2+
3+
let
4+
wallpaper = builtins.path {
5+
path = ../users-hm/Jochberg_Nixos_v2.png;
6+
name = "background.png";
7+
};
8+
in pkgs.runCommand "grub-theme-jochberg" {
9+
nativeBuildInputs = [ pkgs.imagemagick ];
10+
} ''
11+
mkdir -p $out
12+
13+
# Background: scale to common GRUB resolution
14+
magick ${wallpaper} -resize 1920x1200! $out/background.png
15+
16+
# Theme definition
17+
cat > $out/theme.txt <<'THEME'
18+
# Global properties
19+
title-text: ""
20+
desktop-image: "background.png"
21+
desktop-color: "#000000"
22+
terminal-font: "Unifont Regular 16"
23+
terminal-left: "0"
24+
terminal-top: "0"
25+
terminal-width: "100%"
26+
terminal-height: "100%"
27+
terminal-border: "0"
28+
29+
# Boot menu
30+
+ boot_menu {
31+
left = 30%
32+
top = 30%
33+
width = 40%
34+
height = 40%
35+
item_font = "Unifont Regular 16"
36+
item_color = "#cccccc"
37+
selected_item_font = "Unifont Regular 16"
38+
selected_item_color = "#ffffff"
39+
item_height = 24
40+
item_padding = 4
41+
item_spacing = 4
42+
icon_width = 0
43+
icon_height = 0
44+
scrollbar = false
45+
}
46+
47+
# Countdown label
48+
+ label {
49+
left = 30%
50+
top = 72%
51+
width = 40%
52+
align = "center"
53+
id = "__timeout__"
54+
text = "Booting in %d seconds"
55+
color = "#cccccc"
56+
font = "Unifont Regular 14"
57+
}
58+
THEME
59+
''

0 commit comments

Comments
 (0)