diff options
| author | Joe Mou <dev@mou.fo> | 2024-02-15 12:38:56 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2024-02-18 06:25:31 -0500 |
| commit | 174837fe9714ab1bb79c7c6cdd0bd0d4f8586e15 (patch) | |
| tree | 8b8934a37faf30c5a25e29cdd937ca0e2177f25e | |
| parent | c31a6a7761f54cc9ab8c6ce0049571fbaece96e7 (diff) | |
Boot after power failure (server mode)
| -rw-r--r-- | hostnix/elmo/system.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/hostnix/elmo/system.nix b/hostnix/elmo/system.nix index d92de59..311338f 100644 --- a/hostnix/elmo/system.nix +++ b/hostnix/elmo/system.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { boot.loader.systemd-boot.enable = true; @@ -10,4 +10,15 @@ networking.networkmanager.enable = true; time.timeZone = "America/New_York"; + + # https://nixos.wiki/wiki/Hardware/Apple#Auto_Restart + systemd.services.enable-autorestart = { + description = "Boot after power failure (server mode)"; + wantedBy = [ "default.target" ]; + serviceConfig = { + Type = "oneshot"; + }; + # https://superuser.com/a/1051137 + script = "${pkgs.pciutils}/bin/setpci -s 00:1f.0 0xa4.b=0"; + }; } |
