mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 23:14:57 +08:00
24 lines
577 B
Nix
24 lines
577 B
Nix
# Configuration for the host on which all webapps will run.
|
|
{ flake, pkgs, lib, ... }:
|
|
|
|
let
|
|
webapps = import ./. { inherit flake; system = pkgs.system; };
|
|
in
|
|
{
|
|
# Run each web app as a systemd service decided inside a container.
|
|
containers = lib.mapAttrs
|
|
(name: v: {
|
|
autoStart = true;
|
|
config = {
|
|
systemd.services.${name} = {
|
|
description = name;
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
ExecStart = v.exec;
|
|
Restart = "always";
|
|
};
|
|
};
|
|
};
|
|
})
|
|
webapps;
|
|
}
|