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", "nixpkgs": "nixpkgs_3",
"nixpkgsUnstable": "nixpkgsUnstable", "nixpkgsUnstable": "nixpkgsUnstable",
"resrok-web": "resrok-web", "resrok-web": "resrok-web",
"utils": "utils_2" "utils": "utils_2",
"voc-web": "voc-web"
} }
}, },
"utils": { "utils": {
@ -211,6 +212,23 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "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", "root": "root",

View file

@ -15,6 +15,10 @@
nixpkgs.url = github:NixOS/nixpkgs/?ref=nixos-22.05; nixpkgs.url = github:NixOS/nixpkgs/?ref=nixos-22.05;
nixpkgsUnstable.url = github:NixOS/nixpkgs/?ref=nixos-unstable; nixpkgsUnstable.url = github:NixOS/nixpkgs/?ref=nixos-unstable;
utils.url = "github:numtide/flake-utils"; 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; outputs = {...} @ args: import ./outputs.nix args;

View file

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

View file

@ -1,14 +1,14 @@
# NixOps configuration for deploying the Voices of Capricornia website # NixOps configuration for deploying the Voices of Capricornia website
{
{ config, pkgs, ... }: self,
config,
let inputs,
sources = import ../nix/sources.nix; pkgs,
voc-web = import sources.voc-web { }; ...
}: let
voc-web = import inputs.voc-web {};
webdomain = "voicesofcapricornia.org"; webdomain = "voicesofcapricornia.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,14 +20,15 @@ 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 = "${voc-web}"; # Wesbite root root = "${voc-web}"; # Wesbite root
}; };
"www.${webdomain}" = { # Respect our elders :-) "www.${webdomain}" = {
locations."/".extraConfig = # Respect our elders :-)
"return 301 $scheme://${webdomain}$request_uri;"; locations."/".extraConfig = "return 301 $scheme://${webdomain}$request_uri;";
}; };
}; };
}; };
@ -42,6 +43,5 @@ in {
}; };
}; };
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [80 443];
} }