2021-03-30 23:20:21 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
let
|
|
|
|
|
inherit (import <niveum/lib>) tmpfilesConfig;
|
2021-06-17 21:10:44 +02:00
|
|
|
cdnRoot = "/var/lib/engiadina";
|
2021-03-30 23:20:21 +02:00
|
|
|
in
|
|
|
|
|
{
|
2021-05-05 09:16:43 +02:00
|
|
|
imports = [ <stockholm/krebs/3modules/permown.nix> ];
|
|
|
|
|
|
|
|
|
|
krebs.permown.${cdnRoot} = {
|
|
|
|
|
owner = config.users.users.me.name;
|
|
|
|
|
group = "users";
|
|
|
|
|
umask = "0002";
|
|
|
|
|
};
|
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";
|
|
|
|
|
};
|
|
|
|
|
}
|