diff --git a/flake.lock b/flake.lock index 6093dcd..e85d055 100644 --- a/flake.lock +++ b/flake.lock @@ -528,7 +528,8 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix", - "tmux-yank": "tmux-yank" + "tmux-yank": "tmux-yank", + "website": "website" } }, "rust-overlay": { @@ -689,6 +690,30 @@ "repo": "treefmt-nix", "type": "github" } + }, + "website": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1738525735, + "narHash": "sha256-aeNSiEkIE0n95q5V8HkxeNL4pZ7NojnH/eIoaP5h74Y=", + "ref": "main", + "rev": "25e2c1c97065ed33df66873e0899d110f3ead9e7", + "revCount": 3, + "type": "git", + "url": "https://codeberg.org/0xa/website.git" + }, + "original": { + "ref": "main", + "type": "git", + "url": "https://codeberg.org/0xa/website.git" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8c112fa..1070488 100644 --- a/flake.nix +++ b/flake.nix @@ -35,6 +35,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + website = { + url = "git+https://codeberg.org/0xa/website.git?ref=main"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + tmux-yank = { url = "github:tmux-plugins/tmux-yank"; flake = false; diff --git a/hosts/cloud/proxy/default.nix b/hosts/cloud/proxy/default.nix index c225ce3..42430b1 100644 --- a/hosts/cloud/proxy/default.nix +++ b/hosts/cloud/proxy/default.nix @@ -1,4 +1,7 @@ -{ ... }: +{ inputs, ... }: +let + website = inputs.website.packages."x86_64-linux".default; +in { imports = [ ./auth.nix @@ -49,12 +52,21 @@ add_header X-Content-Type-Options nosniff; ''; # default vhost + virtualHosts."oxapentane.com" = { forceSSL = true; enableACME = true; - # default = true; + default = true; locations."/" = { - return = "503"; + root = "${website}"; + index = "index.html"; + }; + }; + virtualHosts."www.oxapentane.com" = { + forceSSL = true; + enableACME = true; + locations."/" = { + return = "302 https://oxapentane.com"; }; }; };