make wol into a module
This commit is contained in:
parent
069e9662fb
commit
d630dcb877
3 changed files with 34 additions and 16 deletions
|
|
@ -22,6 +22,7 @@
|
|||
enableJellyfin = true;
|
||||
enableAarch64Emulation = true;
|
||||
disableHibernation = true;
|
||||
enableWakeOnLan = true;
|
||||
};
|
||||
|
||||
# Bootloader.
|
||||
|
|
@ -39,25 +40,9 @@
|
|||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
networking.interfaces.enp3s0.wakeOnLan.enable = true;
|
||||
# The services doesn't actually work atm, define an additional service
|
||||
# see https://github.com/NixOS/nixpkgs/issues/91352
|
||||
systemd.services.wakeonlan = {
|
||||
description = "Reenable wake on lan every boot";
|
||||
after = ["network.target"];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
RemainAfterExit = "true";
|
||||
ExecStart = "${pkgs.ethtool}/sbin/ethtool -s enp3s0 wol g";
|
||||
};
|
||||
wantedBy = ["default.target"];
|
||||
};
|
||||
|
||||
hardware.nvidia-container-toolkit.enable = true;
|
||||
|
||||
# hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
# Enable OpenGL
|
||||
|
||||
programs.nix-required-mounts.enable = true;
|
||||
programs.nix-required-mounts.presets.nvidia-gpu.enable = true;
|
||||
# TODO: this ugly thing is necessary until this issue is resolved
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@
|
|||
./secrets.nix
|
||||
./tailscale.nix
|
||||
./users.nix
|
||||
./wake-on-lan.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
32
modules/wake-on-lan.nix
Normal file
32
modules/wake-on-lan.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
myModules.enableWakeOnLan = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable Wake on LAN";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.myModules.enableWakeOnLan {
|
||||
networking.interfaces.enp3s0.wakeOnLan.enable = true;
|
||||
# The services doesn't actually work atm, define an additional service
|
||||
# see https://github.com/NixOS/nixpkgs/issues/91352
|
||||
systemd.services.wakeonlan = {
|
||||
description = "Reenable wake on lan every boot";
|
||||
after = ["network.target"];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
RemainAfterExit = "true";
|
||||
ExecStart = "${pkgs.ethtool}/sbin/ethtool -s enp3s0 wol g";
|
||||
};
|
||||
wantedBy = ["default.target"];
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue