mirror of
https://github.com/ivabus/nixos
synced 2024-11-10 02:25:18 +03:00
Host slides.ivabus.dev using Nix
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
parent
409c6c276b
commit
0375a858ec
|
@ -27,7 +27,10 @@ in {
|
||||||
virtualisation.enable = false;
|
virtualisation.enable = false;
|
||||||
yggdrasil-peer.enable = true;
|
yggdrasil-peer.enable = true;
|
||||||
|
|
||||||
server = { ivabus-dev.enable = true; };
|
server = {
|
||||||
|
ivabus-dev.enable = true;
|
||||||
|
slides-ivabus-dev.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
my.users = {
|
my.users = {
|
||||||
|
@ -83,12 +86,6 @@ in {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
http3 = true;
|
http3 = true;
|
||||||
};
|
};
|
||||||
virtualHosts."slides.ivabus.dev" = {
|
|
||||||
locations."/".proxyPass = "http://${secrets.maas-address}:80";
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
http3 = true;
|
|
||||||
};
|
|
||||||
virtualHosts."git.ivabus.dev" = {
|
virtualHosts."git.ivabus.dev" = {
|
||||||
locations."/".proxyPass = "http://${secrets.maas-address}:3000";
|
locations."/".proxyPass = "http://${secrets.maas-address}:3000";
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
|
20
pkgs/slides-ivabus-dev.nix
Normal file
20
pkgs/slides-ivabus-dev.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ pkgs ? import <nixpkgs> { }, ... }:
|
||||||
|
let
|
||||||
|
version = "107f8e0d7e02449bc47bbc6fb03f7d1ce2fae60b";
|
||||||
|
repo = builtins.fetchGit {
|
||||||
|
url = "https://github.com/ivabus/slides.ivabus.dev";
|
||||||
|
rev = version;
|
||||||
|
};
|
||||||
|
in pkgs.stdenv.mkDerivation {
|
||||||
|
inherit version;
|
||||||
|
name = "slides-ivabus-dev";
|
||||||
|
src = repo;
|
||||||
|
|
||||||
|
buildInputs = [ ];
|
||||||
|
nativeBuildInputs = with pkgs; [ rsync ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
rsync -a . $out/ --exclude README.md --exclude LICENSE
|
||||||
|
'';
|
||||||
|
}
|
|
@ -15,5 +15,6 @@
|
||||||
|
|
||||||
./server/nginx.nix
|
./server/nginx.nix
|
||||||
./server/ivabus-dev.nix
|
./server/ivabus-dev.nix
|
||||||
|
./server/slides-ivabus-dev.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
22
roles/server/slides-ivabus-dev.nix
Normal file
22
roles/server/slides-ivabus-dev.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let cfg = config.my.roles.server.slides-ivabus-dev;
|
||||||
|
in {
|
||||||
|
options.my.roles.server.slides-ivabus-dev.enable =
|
||||||
|
lib.mkEnableOption "Serve slides.ivabus.dev";
|
||||||
|
config = lib.mkIf (cfg.enable) {
|
||||||
|
my.roles.server.nginx.enable = true;
|
||||||
|
services.nginx = {
|
||||||
|
virtualHosts."slides.ivabus.dev" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
http3 = true;
|
||||||
|
|
||||||
|
root = pkgs.callPackage ../../pkgs/slides-ivabus-dev.nix { };
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
error_page 404 /404.html;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue