forked from UniverseBow/wa2k.com-Website
Compare commits
No commits in common. "ad9ca4118ceb2990fa9a9324d1638314729fae0c" and "6be517516cad6d6f155e78a7f48bece0eceeceb8" have entirely different histories.
ad9ca4118c
...
6be517516c
2 changed files with 7 additions and 41 deletions
34
README.md
34
README.md
|
|
@ -1,40 +1,6 @@
|
||||||
# Wowzers what a cool website!
|
# Wowzers what a cool website!
|
||||||
Source code for da website o_O
|
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
|
### Local Development
|
||||||
>[!WARNING]
|
>[!WARNING]
|
||||||
> This project is packaged using Nix, it's easier to work it this way :3
|
> This project is packaged using Nix, it's easier to work it this way :3
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ in {
|
||||||
enable = mkEnableOption "webserver for wa2k.com";
|
enable = mkEnableOption "webserver for wa2k.com";
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.port;
|
types = types.port;
|
||||||
default = 8080;
|
default = 80;
|
||||||
example = 8080;
|
example = 8080;
|
||||||
description = ''
|
description = ''
|
||||||
The listening port on localhost to bind the wa2k.com server to.
|
The listening port on localhost to bind the wa2k.com server to.
|
||||||
|
|
@ -21,7 +21,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
openFirewall = mkOption {
|
openFirewall = mkOption {
|
||||||
type = types.bool;
|
types = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -30,13 +30,13 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf cfg.enable {
|
||||||
networking.firewall.allowedTCPPorts = lib.optional (cfg.enable && cfg.openFirewall) cfg.port;
|
networking.firewall.allowedTCPPorts = lib.optional cfg.openFirewall [cfg.port];
|
||||||
|
|
||||||
# REF: https://nixos.wiki/wiki/Static_Web_Server
|
# REF: https://nixos.wiki/wiki/Static_Web_Server
|
||||||
services.static-web-server = {
|
services.static-web-server = {
|
||||||
enable = cfg.enable;
|
enable = true;
|
||||||
listen = "[::]:${builtins.toString cfg.port}";
|
listen = "[::]:${cfg.port}";
|
||||||
root = "${pkgs.wa2k-website}/www";
|
root = "${pkgs.wa2k-website}/www";
|
||||||
|
|
||||||
configuration = {
|
configuration = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue