refactor
This commit is contained in:
parent
fd5f22ae65
commit
845c3373ba
9 changed files with 65 additions and 55 deletions
|
|
@ -1,4 +1,7 @@
|
|||
{ pkgs, lib, ...}: {
|
||||
{ pkgs, lib, ...}:
|
||||
let
|
||||
import = ../../config/globals.nix ;
|
||||
in {
|
||||
environment.systemPackages = with pkgs; [
|
||||
hugo
|
||||
];
|
||||
|
|
@ -6,8 +9,8 @@
|
|||
description = "Auto build du blog hugo";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
WorkingDirectory = "/srv/blog" ;
|
||||
ExecStart = ''${pkgs.hugo}/bin/hugo --minify build -d /srv/blog/public'';
|
||||
WorkingDirectory = globals.services.levr.home ;
|
||||
ExecStart = ''${pkgs.hugo}/bin/hugo --minify build -d ${globals.services.levr.build}'';
|
||||
User = "lomig";
|
||||
};
|
||||
};
|
||||
|
|
@ -23,7 +26,7 @@
|
|||
description = "Synchronisation du dépôt Hugo";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
WorkingDirectory = "/srv/blog";
|
||||
WorkingDirectory = globals.services.levr.home;
|
||||
ExecStart = "${pkgs.git}/bin/git pull origin master";
|
||||
User = "lomig";
|
||||
};
|
||||
|
|
@ -41,17 +44,17 @@
|
|||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"levr.porzh.me" = {
|
||||
globals.services.levr.url = {
|
||||
extraConfig = ''
|
||||
@http {
|
||||
protocol http
|
||||
}
|
||||
redir @http https://{host}{uri} permanent
|
||||
root * /srv/blog/public
|
||||
root * ${globals.services.levr.build}
|
||||
file_server
|
||||
|
||||
log {
|
||||
output file /var/log/caddy/access-levr.porzh.me.log
|
||||
output file /var/log/caddy/access-${global.services.levr.url}.log
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{pkgs, ...}: let
|
||||
import ../../config/globals.nix ;
|
||||
porzhSite = pkgs.stdenv.mkDerivation {
|
||||
pname = "porzh-site";
|
||||
version = "1.0";
|
||||
|
|
@ -13,8 +14,8 @@ in {
|
|||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"porzh.me" = {
|
||||
serverAliases = ["www.porzh.me"];
|
||||
globals.domain = {
|
||||
serverAliases = [ "www.${globals.domain}" ];
|
||||
extraConfig = ''
|
||||
root * ${porzhSite}
|
||||
file_server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue