From 44e6280a7a9ba05b5393849e0fe2ae4907ffaa78 Mon Sep 17 00:00:00 2001 From: Fiscal Velvet Poet Date: Thu, 21 Jul 2022 15:50:13 +1000 Subject: [PATCH] resrok-web: converted to flake --- flake.lock | 18 ++++++++++++++++++ flake.nix | 4 ++++ outputs.nix | 1 + profiles/resrok-web.nix | 39 ++++++++++++++++++++------------------- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index bbd00ed..d8aabb2 100644 --- a/flake.lock +++ b/flake.lock @@ -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" } }, diff --git a/flake.nix b/flake.nix index b695fdf..2a26323 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/outputs.nix b/outputs.nix index 4cc3d0c..658458e 100644 --- a/outputs.nix +++ b/outputs.nix @@ -5,6 +5,7 @@ nixops, nixpkgs, nixpkgsUnstable, + resrok-web, utils, ... } @ inputs: diff --git a/profiles/resrok-web.nix b/profiles/resrok-web.nix index df91b67..e0fa7b5 100644 --- a/profiles/resrok-web.nix +++ b/profiles/resrok-web.nix @@ -1,31 +1,33 @@ # 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"; }; services.nginx = { - enable = true; # Enable Nginx - recommendedGzipSettings = true; - recommendedOptimisation = true; + enable = true; # Enable Nginx + recommendedGzipSettings = true; + recommendedOptimisation = true; recommendedProxySettings = true; - recommendedTlsSettings = true; + recommendedTlsSettings = true; virtualHosts = { - "${webdomain}" = { # website hostname - enableACME = true; # Use ACME certs - forceSSL = true; # Force SSL - root = "${resrok-web}"; # Wesbite root + "${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]; }