Initialize the SATA HAT on startup
This commit is contained in:
@@ -28,7 +28,22 @@ in {
|
||||
startAt = "02:00:00";
|
||||
};
|
||||
|
||||
wantedBy = [ "default.target" ];
|
||||
# Enable SATA HAT
|
||||
systemd.services.sata-hat = {
|
||||
description = "Enable software support for SATA Hat";
|
||||
wantedBy = [ "zfs-import.target" ];
|
||||
script = ''
|
||||
${pkgs.bash}/bin/bash -c "/etc/nixos/scripts/SATA-hat.sh on"
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = "yes";
|
||||
ExecStop = ''
|
||||
${pkgs.bash}/bin/bash -c "/etc/nixos/scripts/SATA-hat.sh off"
|
||||
'';
|
||||
};
|
||||
before = [ "zfs-import.target" "zfs-import-vault.service" ];
|
||||
requires = [ "systemd-udev-settle.service" ];
|
||||
after = [ "systemd-udev-settle.service" ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user