-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathflake.nix
94 lines (88 loc) · 2.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
description = "Flake to manage DedSec grub themes from Vandal";
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.dedsec-theme;
dedsec-grub-theme = pkgs.stdenv.mkDerivation {
name = "decsec-grub-theme";
src = ./.;
installPhase = ''
mkdir -p $out/grub/theme/
cp assets/backgrounds/${cfg.style}-${cfg.resolution}.png $out/grub/theme/background.png
cp -r assets/icons-${cfg.resolution}/${cfg.icon}/ $out/grub/theme/icons/
cp -r assets/fonts/${cfg.resolution}/* $out/grub/theme/
cp -r base/${cfg.resolution}/* $out/grub/theme
'';
};
in
{
options = {
boot.loader.grub.dedsec-theme = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable DedSec grub theme from Vandal
'';
};
style = mkOption {
type = types.enum [
"brainwash"
"compact"
"comments"
"firewall"
"fuckery"
"hackerden"
"legion"
"lovetrap"
"mashup"
"reaper"
"redskull"
"stalker"
"spam"
"spyware"
"strike"
"sitedown"
"trolls"
"tremor"
"unite"
"wannacry"
"wrench"
];
example = "hackerden";
description = ''
The theme to use for grub
'';
};
icon = mkOption {
type = types.enum [ "color" "white" ];
default = "color";
example = "color";
};
resolution = mkOption {
type = types.enum [ "1080p" "1440p" ];
default = "1080p";
example = "1080p";
};
};
};
config = mkIf cfg.enable (mkMerge [{
environment.systemPackages = [ dedsec-grub-theme ];
boot.loader.grub = {
theme = "${dedsec-grub-theme}/grub/theme";
};
}]);
};
};
}