feat: added deployment flow
This commit is contained in:
parent
af43876fcb
commit
f0a030c44a
5 changed files with 186 additions and 2 deletions
33
nix/module.nix
Normal file
33
nix/module.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.volpe;
|
||||
pkg = pkgs.callPackage ./package.nix {};
|
||||
in {
|
||||
options.services.volpe = {
|
||||
enable = lib.mkEnableOption "volpe blog";
|
||||
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "localhost";
|
||||
description = "Domain name for nginx virtual host.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts.${cfg.domain} = {
|
||||
root = "${pkg}";
|
||||
locations."/" = {
|
||||
tryFiles = "$uri $uri/ /index.html";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue