Host the static files required by the blog on a subdomain.

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2023-11-30 05:51:20 +00:00
parent 28aad07d18
commit 3888606d8c
3 changed files with 155 additions and 5 deletions

View File

@ -1,4 +1,4 @@
{ pkgs, system, blog, ... }:
{ pkgs, system, blog, web-files, ... }:
let
productionSite = blog.english {
ssl = true;
@ -8,7 +8,14 @@ let
drafts = true;
host = "drafts.danilafe.com";
};
allVirtualHosts = map blog.virtualHostFor [productionSite draftSite];
webFiles = {
"static.danilafe.com" = {
root = web-files;
forceSSL = true;
enableACME = true;
};
};
allVirtualHosts = [webFiles] ++ map blog.virtualHostFor [productionSite draftSite];
in
{
imports = [

View File

@ -1,5 +1,25 @@
{
"nodes": {
"bergamot-elm": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1701318122,
"narHash": "sha256-wOik1hcZ6xwTUQZmDo8cPB7tE0VoyQM99zUTjqB4xUI=",
"ref": "main",
"rev": "524796d74fbec2828bf3f8f3b7abd4c843d529b3",
"revCount": 33,
"type": "git",
"url": "https://dev.danilafe.com/Everything-I-Know-About-Types/bergamot-elm.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://dev.danilafe.com/Everything-I-Know-About-Types/bergamot-elm.git"
}
},
"blog": {
"inputs": {
"blog-source": "blog-source",
@ -100,6 +120,42 @@
"type": "github"
}
},
"flake-utils_5": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"katex-html": {
"inputs": {
"flake-utils": "flake-utils_2",
@ -216,6 +272,37 @@
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1701068326,
"narHash": "sha256-vmMceA+q6hG1yrjb+MP8T0YFDQIrW3bl45e7z24IEts=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8cfef6986adfb599ba379ae53c9f5631ecd2fd9c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1701319520,
"narHash": "sha256-xVghb4ELbEtJUdEmB4PR+sq/aoNP0VEcM6GczDh+Zss=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "db77de49336382a33b9490a88ba3fe483e2b605f",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"resume": {
"inputs": {
"flake-utils": "flake-utils_4",
@ -238,7 +325,58 @@
"root": {
"inputs": {
"blog": "blog",
"nixpkgs": "nixpkgs_5"
"nixpkgs": "nixpkgs_5",
"web-files": "web-files"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"web-files": {
"inputs": {
"bergamot-elm": "bergamot-elm",
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1701320080,
"narHash": "sha256-R5ydINHKWun80dTD7LGeI5IQvFXNkBpV242k4ZEXq/U=",
"ref": "master",
"rev": "aae85e76286a8e70eb2ecc295bc819043ff9eb23",
"revCount": 2,
"type": "git",
"url": "https://dev.danilafe.com/Nix-Configs/web-files.git"
},
"original": {
"type": "git",
"url": "https://dev.danilafe.com/Nix-Configs/web-files.git"
}
}
},

View File

@ -2,15 +2,20 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
blog.url = "git+https://dev.danilafe.com/Nix-Configs/blog-static-flake.git";
web-files.url = "git+https://dev.danilafe.com/Nix-Configs/web-files.git";
};
outputs = { self, nixpkgs, blog }:
outputs = { self, nixpkgs, blog, web-files }:
let
system = "x86_64-linux";
in
{
nixosConfigurations.nixos-droplet-v2 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit system; blog = blog.lib."${system}"; };
specialArgs = {
inherit system;
blog = blog.lib."${system}";
web-files = web-files.defaultPackage."${system}";
};
modules = [ ./configuration.nix ];
};
};