diff --git a/hosts/dark-firepit/webapps/default.nix b/hosts/dark-firepit/webapps/default.nix index 5d9a655..46e93e7 100644 --- a/hosts/dark-firepit/webapps/default.nix +++ b/hosts/dark-firepit/webapps/default.nix @@ -80,6 +80,12 @@ in { domain = "nitter.oat.zone"; }; + libreddit = { + enable = true; + domain = "libreddit.oat.zone"; + port = 1950; + }; + #watch-party = { # enable = true; # port = 1984; @@ -116,6 +122,10 @@ in { locations."/f/".extraConfig = '' add_header Access-Control-Allow-Origin "*"; ''; + extraConfig = '' + error_page 404 /404.html; + error_page 403 /403.html; + ''; }; # todo: move to flake "gdpstest.oat.zone" = { @@ -156,6 +166,14 @@ in { } ''; }; + + "libreddit.oat.zone" = { + locations."/".extraConfig = '' + if ($http_user_agent = 'Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)') { + return 302 $scheme://proxy.knotty.dev$request_uri; + } + ''; + }; #"git.oat.zone" = { # forceSSL = true; diff --git a/modules/editors/helix.nix b/modules/editors/helix.nix new file mode 100644 index 0000000..ecdfb8b --- /dev/null +++ b/modules/editors/helix.nix @@ -0,0 +1,17 @@ +{ pkgs, lib, config, options, ... }: + +with lib; +let + cfg = config.modules.editors.helix; +in { + options = { + enable = mkOption { + type = types.bool; + default = false; + }; + }; + + #config = mkIf cfg.enable { + # + #}; +} diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 5b25e6f..64ad325 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -1,9 +1,13 @@ -{ config, pkgs, options, lib, ... }: +{ config, pkgs, options, lib, inputs, ... }: with lib; let cfg = config.modules.hyprland; in { + imports = [ + inputs.hyprland.nixosModules.default + ]; + options.modules.hyprland = { enable = mkOption { type = types.bool; @@ -12,15 +16,17 @@ in { }; config = mkIf cfg.enable { - #programs.hyprland = { - # enable = true; - #}; + programs.hyprland = { + enable = true; + }; # this was failing to build so i removed it. sorry!!!!!! # -oat # look outside your window!!! # -aether # ok done (i removed it again) # -oat + # Do not trust the [Flower]. + # -aether user.packages = with pkgs; [ grim diff --git a/modules/services/libreddit.nix b/modules/services/libreddit.nix new file mode 100644 index 0000000..acf48ed --- /dev/null +++ b/modules/services/libreddit.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, options, ... }: + +with lib; +let + cfg = config.modules.services.libreddit; +in { + options.modules.services.libreddit = { + enable = mkOption { + type = types.bool; + default = false; + }; + domain = mkOption { + type = types.str; + default = "libreddit.oat.zone"; + }; + port = mkOption { + type = types.port; + default = 1590; + }; + }; + + config = mkIf cfg.enable { + services = { + libreddit = { + enable = true; + package = pkgs.libreddit; + port = cfg.port; + }; + + nginx.enable = true; + nginx.virtualHosts."${cfg.domain}" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://localhost:${toString cfg.port}"; + }; + }; + }; + }; +}