Compare commits

..

2 commits

Author SHA1 Message Date
ad9ca4118c
add usage guide 2026-03-14 16:49:20 +10:00
49f2a8b48d
fix my oopid mistakes 2026-03-14 16:49:15 +10:00
2 changed files with 41 additions and 7 deletions

View file

@ -1,6 +1,40 @@
# Wowzers what a cool website!
Source code for da website o_O
### Using
First add a the wa2k flake as an input:
```nix
# in flake.nix
inputs = {
wa2k = {
# url = "git+https://tearforge.net/cry/wa2k.com";
url = "/home/me/test/wa2k";
inputs = {
systems.follows = "systems";
nixpkgs.follows = "nixpkgs";
};
};
};
```
Then ensure `wa2k.nixosModules.default` is imported and `wa2k.overlays.default` is used:
```nix
# in configuration.nix
imports = [
inputs.wa2k.nixosModules.default
];
nixpkgs.overlays = [
inputs.wa2k.overlays.default
];
services.wa2k = {
enable = true;
port = 8080;
openFirewall = true;
};
```
### Local Development
>[!WARNING]
> This project is packaged using Nix, it's easier to work it this way :3

View file

@ -12,8 +12,8 @@ in {
enable = mkEnableOption "webserver for wa2k.com";
port = mkOption {
types = types.port;
default = 80;
type = types.port;
default = 8080;
example = 8080;
description = ''
The listening port on localhost to bind the wa2k.com server to.
@ -21,7 +21,7 @@ in {
};
openFirewall = mkOption {
types = types.bool;
type = types.bool;
default = false;
example = true;
description = ''
@ -30,13 +30,13 @@ in {
};
};
config = lib.mkIf cfg.enable {
networking.firewall.allowedTCPPorts = lib.optional cfg.openFirewall [cfg.port];
config = {
networking.firewall.allowedTCPPorts = lib.optional (cfg.enable && cfg.openFirewall) cfg.port;
# REF: https://nixos.wiki/wiki/Static_Web_Server
services.static-web-server = {
enable = true;
listen = "[::]:${cfg.port}";
enable = cfg.enable;
listen = "[::]:${builtins.toString cfg.port}";
root = "${pkgs.wa2k-website}/www";
configuration = {