mirror of
https://github.com/srid/nixos-config.git
synced 2026-07-16 22:01:33 +08:00
cleanup
This commit is contained in:
parent
eff3333e3d
commit
d425868d12
7 changed files with 73 additions and 41 deletions
24
webapps/host.nix
Normal file
24
webapps/host.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# 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 = "${lib.getExe v.package}";
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
webapps;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue