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" "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": { "root": {
"inputs": { "inputs": {
"jfdic-web": "jfdic-web", "jfdic-web": "jfdic-web",
@ -161,6 +178,7 @@
"nixops": "nixops", "nixops": "nixops",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"nixpkgsUnstable": "nixpkgsUnstable", "nixpkgsUnstable": "nixpkgsUnstable",
"resrok-web": "resrok-web",
"utils": "utils_2" "utils": "utils_2"
} }
}, },

View file

@ -6,6 +6,10 @@
flake = false; flake = false;
url = git+https://source.jfdic.org/JFDIC/jfdic-web/?ref=consensus; 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"; nix.url = "github:NixOS/nix/?ref=2.10.3";
nixops.url = github:NixOS/nixops/?ref=master; nixops.url = github:NixOS/nixops/?ref=master;
nixpkgs.url = github:NixOS/nixpkgs/?ref=nixos-22.05; nixpkgs.url = github:NixOS/nixpkgs/?ref=nixos-22.05;

View file

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

View file

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