-
Notifications
You must be signed in to change notification settings - Fork 5
/
modules.nix
43 lines (43 loc) · 1.29 KB
/
modules.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ pkgs, lib, config, ... }:
let
toBG = { red, green, blue }:
"${toString(red / 255.0)}, " +
"${toString(green / 255.0)}, " +
"${toString(blue / 255.0)}";
cfg = config;
nixos-boot = pkgs.callPackage ./default.nix {
theme = cfg.nixos-boot.theme;
bgColor = toBG cfg.nixos-boot.bgColor;
};
in
{
options.nixos-boot.enable = lib.mkEnableOption "nixos-boot";
options.nixos-boot.bgColor.red = lib.mkOption {
type = lib.types.ints.between 0 255;
default = 255;
};
options.nixos-boot.bgColor.green = lib.mkOption {
type = lib.types.ints.between 0 255;
default = 255;
};
options.nixos-boot.bgColor.blue = lib.mkOption {
type = lib.types.ints.between 0 255;
default = 255;
};
options.nixos-boot.theme = lib.mkOption {
type = lib.types.enum [ "load_unload" "evil-nixos" ];
default = "load_unload";
};
options.nixos-boot.duration = lib.mkOption {
type = lib.types.float;
default = 0.0;
};
config.boot.plymouth = lib.mkIf cfg.nixos-boot.enable {
enable = true;
themePackages = [ nixos-boot ];
theme = cfg.nixos-boot.theme;
};
config.systemd.services.plymouth-quit = lib.mkIf (cfg.nixos-boot.enable && cfg.nixos-boot.duration > 0.0) {
preStart = "${pkgs.coreutils}/bin/sleep ${toString config.nixos-boot.duration}";
};
}