43 lines
1.1 KiB
Nix
43 lines
1.1 KiB
Nix
|
{ lib, config, options, pkgs, ... }:
|
||
|
|
||
|
with lib;
|
||
|
let cfg = config.modules.system.boot.grub;
|
||
|
in {
|
||
|
options.modules.system.boot.grub = {
|
||
|
enable = mkBoolOpt true;
|
||
|
};
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
boot.loader = {
|
||
|
grub = {
|
||
|
enable = true;
|
||
|
useOSProver = true;
|
||
|
efiSupport = true;
|
||
|
fsIdentifier = "label";
|
||
|
devices = [ "nodev" ];
|
||
|
extraEntries = ''
|
||
|
menuentry "Reboot" {
|
||
|
reboot
|
||
|
}
|
||
|
menuentry "Poweroff" {
|
||
|
halt
|
||
|
}
|
||
|
'';
|
||
|
theme = pkgs.stdenv.mkDerivation {
|
||
|
pname = "distro-grub-themes";
|
||
|
version = "3.1";
|
||
|
src = pkgs.fetchFromGitHub {
|
||
|
owner = "AdisonCavani";
|
||
|
repo = "distro-grub-themes";
|
||
|
rev = "v3.1";
|
||
|
hash = "sha256-ZcoGbbOMDDwjLhsvs77C7G7vINQnprdfI37a9ccrmPs=";
|
||
|
};
|
||
|
installPhase = "cp -r customize/nixos $out";
|
||
|
};
|
||
|
};
|
||
|
efi = {
|
||
|
canTouchEfiVariables = true;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|