index — nix @ ec27e3dd7262291025e134feff3f6b3fff15f0ff

My first nix server; runs a minecraft server

modules/server.nix (view raw)

 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
{config, pkgs, ...}:
{
   services.logind.settings.Login = {
     HandleLidSwitch = "ignore";
     HandleLidSwitchDocked = "ignore";
     HandleLidSwitchExternalPower = "ignore";

     HandlePowerKey = "ignore";
     HandleRebootKey = "ignore";
     HandleSuspendKey = "ignore";
     HandleHibernateKey = "ignore";
   };

  systemd.services.foo = {
    enable = true;
    script = ''
    echo "0" > /sys/class/backlight/nv_backlight/brightness
    '';
    wantedBy = [ "multi-user.target" ];
    serviceConfig = {
      Restart = "on-failure";
      RestartSec = "3";
    };
  };
}