2021-03-30 23:20:21 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
let
|
|
|
|
|
inherit (import <niveum/lib>) tmpfilesConfig;
|
|
|
|
|
cdnRoot = "/run/engiadina";
|
|
|
|
|
in
|
|
|
|
|
{
|
2021-04-19 20:02:10 +02:00
|
|
|
systemd.tmpfiles.rules = map tmpfilesConfig [
|
|
|
|
|
{
|
2021-03-30 23:20:21 +02:00
|
|
|
type = "d";
|
|
|
|
|
path = cdnRoot;
|
|
|
|
|
mode = "0775";
|
|
|
|
|
user = config.users.users.me.name;
|
2021-04-19 20:02:10 +02:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
type = "x";
|
|
|
|
|
path = "${cdnRoot}/*";
|
|
|
|
|
}
|
2021-03-30 23:20:21 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
|
enable = true;
|
|
|
|
|
virtualHosts.default = {
|
|
|
|
|
root = cdnRoot;
|
|
|
|
|
listen = [{
|
|
|
|
|
addr = "0.0.0.0";
|
|
|
|
|
port = 3333;
|
|
|
|
|
}];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
environment.shellAliases = {
|
|
|
|
|
engiadina-watch = "${pkgs.findutils}/bin/find extra-src src | ${pkgs.entr}/bin/entr -s 'build-component && ${pkgs.rsync}/bin/rsync -avu dist/*.js ${cdnRoot}/'";
|
|
|
|
|
engiadina-edit = "$EDITOR ${cdnRoot}/index.html";
|
|
|
|
|
};
|
|
|
|
|
}
|