mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 18:09:06 +02:00
Refactored subdomains creation
This commit is contained in:
parent
f6b29709c5
commit
be4fce11f4
11 changed files with 28 additions and 103 deletions
|
@ -10,6 +10,7 @@ in
|
|||
{
|
||||
|
||||
mkMachine = host: host-config: modules: nixpkgs.lib.nixosSystem {
|
||||
lib = final;
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
|
@ -36,5 +37,16 @@ in
|
|||
|
||||
importConfig = path: (mapAttrs (name: value: import (path + "/${name}/default.nix")) (readDir path));
|
||||
|
||||
mkSubdomain = name: port: {
|
||||
luj.nginx.enable = true;
|
||||
services.nginx.virtualHosts."${name}.julienmalka.me" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue