nix/container/Home.nix

26 lines
573 B
Nix
Raw Normal View History

2024-06-09 23:35:53 +03:00
{ container, pkgs, util, ... } @args: let
cfg = container.config.home;
2024-06-13 17:00:05 +03:00
package = (pkgs.callPackage ./homer args);
2024-06-09 23:35:53 +03:00
in {
containers.home = container.mkContainer cfg {
config = { ... }: container.mkContainerConfig cfg {
2024-06-13 17:00:05 +03:00
environment.systemPackages = [ package ];
2024-06-09 23:35:53 +03:00
systemd.packages = [ package ];
services.nginx = {
enable = true;
2024-06-13 17:00:05 +03:00
virtualHosts.${cfg.domain} = container.mkServer {
2024-06-09 23:35:53 +03:00
default = true;
root = "${package}";
locations = {
2024-06-13 17:00:05 +03:00
"/".extraConfig = ''
2024-06-09 23:35:53 +03:00
try_files $uri $uri/index.html;
'';
};
};
};
};
};
}