-
Notifications
You must be signed in to change notification settings - Fork 0
/
switch-boot.nix
38 lines (38 loc) · 1 KB
/
switch-boot.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
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.switch-boot;
hekate =
pkgs.fetchzip {
url = "https://github.com/CTCaer/hekate/releases/download/v6.1.1/hekate_ctcaer_6.1.1_Nyx_1.6.1.zip";
hash = "sha256-WEy/ftldCwU/TXXOGDkQ3Q0JaVm0NchDkkZ5PBbDlR4=";
stripRoot = false;
}
+ "/hekate_ctcaer_6.1.1.bin";
in {
options = {
services.switch-boot = {
enable = mkOption {
type = types.bool;
default = false;
};
};
};
config = mkIf cfg.enable {
systemd.services.switch-boot = {
enable = true;
description = "Switch payload injector";
serviceConfig = {
# fusee-launcher and fusee-nano not working
ExecStart = "${pkgs.jre}/bin/java -jar ${pkgs.ns-usbloader}/share/java/ns-usbloader.jar -r ${hekate}";
};
};
services.udev.extraRules = ''
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7321", TAG+="systemd", ENV{SYSTEMD_WANTS}="switch-boot.service"
'';
};
}