voc-web: converted to flake

This commit is contained in:
Fiscal Velvet Poet 2022-07-21 16:00:18 +10:00
parent 44e6280a7a
commit 389281c905
Signed by: fiscalvelvetpoet
GPG key ID: D8EBFD58B023BD47
4 changed files with 38 additions and 15 deletions

View file

@ -179,7 +179,8 @@
"nixpkgs": "nixpkgs_3",
"nixpkgsUnstable": "nixpkgsUnstable",
"resrok-web": "resrok-web",
"utils": "utils_2"
"utils": "utils_2",
"voc-web": "voc-web"
}
},
"utils": {
@ -211,6 +212,23 @@
"repo": "flake-utils",
"type": "github"
}
},
"voc-web": {
"flake": false,
"locked": {
"lastModified": 1656493019,
"narHash": "sha256-vdQBbaoJXrH3bDa47OHC9jpFUsVMCi++dCCdRf0VXis=",
"ref": "consensus",
"rev": "85eb99b5a0a010d8819ea6850c5a359d9ec397b9",
"revCount": 8,
"type": "git",
"url": "https://source.jfdic.org/voc/voc-web/"
},
"original": {
"ref": "consensus",
"type": "git",
"url": "https://source.jfdic.org/voc/voc-web/"
}
}
},
"root": "root",

View file

@ -15,6 +15,10 @@
nixpkgs.url = github:NixOS/nixpkgs/?ref=nixos-22.05;
nixpkgsUnstable.url = github:NixOS/nixpkgs/?ref=nixos-unstable;
utils.url = "github:numtide/flake-utils";
voc-web = {
flake = false;
url = git+https://source.jfdic.org/voc/voc-web/?ref=consensus;
};
};
outputs = {...} @ args: import ./outputs.nix args;

View file

@ -7,6 +7,7 @@
nixpkgsUnstable,
resrok-web,
utils,
voc-web,
...
} @ inputs:
(utils.lib.eachDefaultSystem (system: let

View file

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