diff --git a/hosts/rpi/default.nix b/hosts/rpi/default.nix index c526ca0..55ff463 100644 --- a/hosts/rpi/default.nix +++ b/hosts/rpi/default.nix @@ -20,10 +20,56 @@ hardware.raspberry-pi."4" = { bluetooth.enable = false; - # let me sleep - leds.eth.disable = true; - leds.act.disable = true; - leds.pwr.disable = true; + }; + + # todo: module for dis stuff (maybe) + + services.samba = { + enable = true; + shares = { + media = { + path = "/media"; + writeable = "yes"; + public = "yes"; + "create mask" = "0777"; + "directory mask" = "0777"; + }; + }; + }; + + services.nginx = { + enable = true; + additionalModules = [ pkgs.nginxModules.fancyindex ]; + virtualHosts.media = { + default = true; + addSSL = true; + enableACME = true; + + listen = [{ + addr = "192.168.1.12"; + port = "80"; + }]; + + root = "/share"; + + serverName = "_"; + + locations = { + "/" = { + tryFiles = "$uri $uri/ =404"; + extraConfig = '' + fancyindex on; + fancyindex_name_length 256; + fancyindex_exact_size off; + ''; + }; + }; + }; + }; + + security.acme = { + acceptTerms = true; + defaults.email = "krizej@protonmail.com"; }; chuj = {