aboutsummaryrefslogtreecommitdiff
path: root/modules/boot
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2025-06-09 17:40:46 +0000
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2025-06-09 17:40:46 +0000
commita45c4551712c1ba5cb82eaf290f311ab0e8690e4 (patch)
treef62b23489fb31f8ea58fef77f99619efd784eb36 /modules/boot
big changes
Diffstat (limited to 'modules/boot')
-rw-r--r--modules/boot/options.nix23
-rw-r--r--modules/boot/system/default.nix37
-rw-r--r--modules/boot/system/plymouth.nix21
3 files changed, 81 insertions, 0 deletions
diff --git a/modules/boot/options.nix b/modules/boot/options.nix
new file mode 100644
index 0000000..c040032
--- /dev/null
+++ b/modules/boot/options.nix
@@ -0,0 +1,23 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ inherit (lib) mkOption mkEnableOption types;
+in {
+ options = {
+ collinux.boot = {
+ bootloader = mkOption {
+ type = types.enum ["grub" "systemd-boot"];
+ };
+ plymouth = {
+ enable = mkEnableOption "plymouth bootsplash";
+ theme = mkOption {
+ type = types.enum ["catppuccin" "adwaita"];
+ default = config.collinux.theme;
+ };
+ };
+ secureBoot.enable = mkEnableOption "lanzaboote";
+ };
+ };
+}
diff --git a/modules/boot/system/default.nix b/modules/boot/system/default.nix
new file mode 100644
index 0000000..e32601c
--- /dev/null
+++ b/modules/boot/system/default.nix
@@ -0,0 +1,37 @@
+{
+ pkgs,
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.collinux.boot;
+in {
+ imports = [
+ ./plymouth.nix
+ ];
+
+ boot =
+ {
+ initrd = {
+ verbose = false;
+ systemd.enable = true;
+ };
+ loader = {
+ systemd-boot = lib.optionalAttrs (cfg.bootloader == "systemd-boot" && !cfg.secureBoot.enable) {
+ enable = true;
+ configurationLimit = 3;
+ };
+ grub = lib.optionalAttrs (cfg.bootloader == "grub") {enable = true;};
+ efi.canTouchEfiVariables = true;
+ timeout = 0;
+ };
+ }
+ // (lib.optionalAttrs cfg.secureBoot.enable {
+ lanzaboote = {
+ enable = true;
+ pkiBundle = "/var/lib/sbctl";
+ };
+ });
+
+ environment.systemPackages = lib.mkIf cfg.secureBoot.enable [pkgs.sbctl];
+}
diff --git a/modules/boot/system/plymouth.nix b/modules/boot/system/plymouth.nix
new file mode 100644
index 0000000..5f7952b
--- /dev/null
+++ b/modules/boot/system/plymouth.nix
@@ -0,0 +1,21 @@
+{
+ pkgs,
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.collinux.boot.plymouth;
+in
+ lib.mkIf cfg.enable {
+ boot.plymouth = {
+ enable = true;
+ theme =
+ if (cfg.theme == "catppuccin")
+ then "catppuccin-macchiato" # for whatever reason catppuccin-mocha has errors
+ else "nixos-bgrt";
+ themePackages =
+ if (cfg.theme == "catppuccin")
+ then [pkgs.catppuccin-plymouth]
+ else [pkgs.nixos-bgrt-plymouth];
+ };
+ }