-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
55 lines (50 loc) · 1.56 KB
/
flake.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
44
45
46
47
48
49
50
51
52
53
54
{
description = "Flake to manage Bhairava Grub Theme for the Sanatana Linux.";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
with nixpkgs.lib;
{
nixosModule = { config, ... }:
let
cfg = config.boot.loader.grub.bhairava-grub-theme;
bhairava-grub-theme = pkgs.stdenv.mkDerivation {
name = "bhairava-grub-grub-theme";
src = ./.;
installPhase = ''
mkdir -p $out/grub/theme/icons
cp -rf backgrounds/bg.png $out/grub/theme/bg.png
cp -rf assets/assets/1080p/* $out/grub/theme/
cp -rf assets/logos/1080p/* $out/grub/theme/icons/
cp -rf common/* $out/grub/theme/
cp -rf config/theme-1080p.txt $out/grub/theme/theme.txt
'';
};
in
{
options = {
boot.loader.grub.bhairava-grub-theme = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable the Bhairava Grub Theme
'';
};
};
};
config = mkIf cfg.enable (mkMerge [{
environment.systemPackages = [ bhairava-grub-theme ];
boot.loader.grub = {
theme = "${bhairava-grub-theme}/grub/theme";
};
}]);
};
};
}