hosts/web-2: add install.nix.clerie.de
This commit is contained in:
parent
0111f67b6d
commit
c013c4323a
@ -18,6 +18,7 @@
|
|||||||
./meow.nix
|
./meow.nix
|
||||||
./milchinsel.nix
|
./milchinsel.nix
|
||||||
./mitel-ommclient2.nix
|
./mitel-ommclient2.nix
|
||||||
|
./nix-install.nix
|
||||||
./ping.nix
|
./ping.nix
|
||||||
./public.nix
|
./public.nix
|
||||||
./radicale.nix
|
./radicale.nix
|
||||||
|
31
hosts/web-2/nix-install.nix
Normal file
31
hosts/web-2/nix-install.nix
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
install_script = pkgs.writeTextDir "web/install" ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
which nix 2>1 > /dev/null || { echo "nix command not found. Install nix and try again"; exit 1; }
|
||||||
|
|
||||||
|
nix --extra-experimental-features "nix-command" \
|
||||||
|
--substituters "https://nix-cache.clerie.de" \
|
||||||
|
--trusted-public-keys "nix-cache.clerie.de:bAt1GJTS9BOTcXFWj3nURrSlcjqikCev9yDvqArMP5g=" \
|
||||||
|
copy --from "https://nix-cache.clerie.de" \
|
||||||
|
${pkgs.nixfiles-auto-install}
|
||||||
|
${pkgs.nixfiles-auto-install}/bin/nixfiles-auto-install
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
"install.nix.clerie.de" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
root = install_script + "/web/";
|
||||||
|
extraConfig = ''
|
||||||
|
index install;
|
||||||
|
types { } default_type "text/plain; charset=utf-8";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user