40 lines
836 B
Nix
40 lines
836 B
Nix
{ pkgs, repoRoot, ... }:
|
|
{
|
|
imports = [ ./hardware-configuration.nix ];
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
wakeonlan
|
|
];
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
networking.hostName = "nuc";
|
|
|
|
boot.initrd.enable = true;
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
53
|
|
80
|
|
443
|
|
];
|
|
networking.firewall.allowedUDPPorts = [ 53 ];
|
|
|
|
systemd.timers.autowin = {
|
|
wantedBy = [ "timers.target" ];
|
|
timerConfig = {
|
|
OnCalendar = "Wed *-*-21..28 02:00:00";
|
|
Unit = "autowin.service";
|
|
};
|
|
};
|
|
|
|
systemd.services.autowin = {
|
|
script = ''
|
|
${pkgs.python3Packages.python}/bin/python ${repoRoot}/util/wol_man.py autowin
|
|
'';
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
TimeoutStartSec = "3600";
|
|
User = "alisceon";
|
|
};
|
|
};
|
|
}
|