resrok-web: converted to flake

This commit is contained in:
Fiscal Velvet Poet 2022-07-21 15:50:13 +10:00
parent bea9dac4c5
commit 44e6280a7a
Signed by: fiscalvelvetpoet
GPG key ID: D8EBFD58B023BD47
4 changed files with 43 additions and 19 deletions

View file

@ -154,6 +154,23 @@
"type": "github"
}
},
"resrok-web": {
"flake": false,
"locked": {
"lastModified": 1656494547,
"narHash": "sha256-/8EgQxlqAX9tJv8TvsQybIh2O5TYSTOXmwtXC6gg3Dw=",
"ref": "consensus",
"rev": "e77bea1a3cc4da6f54c62ba21ca926392e842a21",
"revCount": 5,
"type": "git",
"url": "https://source.jfdic.org/resrok/resrok-web/"
},
"original": {
"ref": "consensus",
"type": "git",
"url": "https://source.jfdic.org/resrok/resrok-web/"
}
},
"root": {
"inputs": {
"jfdic-web": "jfdic-web",
@ -161,6 +178,7 @@
"nixops": "nixops",
"nixpkgs": "nixpkgs_3",
"nixpkgsUnstable": "nixpkgsUnstable",
"resrok-web": "resrok-web",
"utils": "utils_2"
}
},

View file

@ -6,6 +6,10 @@
flake = false;
url = git+https://source.jfdic.org/JFDIC/jfdic-web/?ref=consensus;
};
resrok-web = {
flake = false;
url = git+https://source.jfdic.org/resrok/resrok-web/?ref=consensus;
};
nix.url = "github:NixOS/nix/?ref=2.10.3";
nixops.url = github:NixOS/nixops/?ref=master;
nixpkgs.url = github:NixOS/nixpkgs/?ref=nixos-22.05;

View file

@ -5,6 +5,7 @@
nixops,
nixpkgs,
nixpkgsUnstable,
resrok-web,
utils,
...
} @ inputs:

View file

@ -1,14 +1,14 @@
# NixOps configuration for deploying the JFDIC website
{ config, pkgs, ...}:
let
sources = import ../nix/sources.nix;
resrok-web = import sources.resrok-web {};
{
self,
config,
inputs,
pkgs,
...
}: let
resrok-web = import inputs.resrok-web {};
webdomain = "resrok.org";
in {
environment.sessionVariables = {
LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive";
};
@ -20,12 +20,14 @@ in {
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"${webdomain}" = { # website hostname
"${webdomain}" = {
# website hostname
enableACME = true; # Use ACME certs
forceSSL = true; # Force SSL
root = "${resrok-web}"; # Wesbite root
};
"www.${webdomain}" = { # Respect our elders :-)
"www.${webdomain}" = {
# Respect our elders :-)
locations."/".extraConfig = "return 301 $scheme://${webdomain}$request_uri;";
};
};
@ -41,6 +43,5 @@ in {
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedTCPPorts = [80 443];
}