Compare commits
No commits in common. "aa57b7b32515df7bdd426c42fc32c73c5225fe3c" and "8dc40629e9938ac3b9e73cc5ff8c97912dd3af5f" have entirely different histories.
aa57b7b325
...
8dc40629e9
5
overlays/site-musique.nix
Normal file
5
overlays/site-musique.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
self: super:
|
||||||
|
|
||||||
|
{
|
||||||
|
site-musique = super.callPackage ../pkgs/site-musique { };
|
||||||
|
}
|
24
pkgs/site-musique/default.nix
Normal file
24
pkgs/site-musique/default.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ lib, stdenv, fetchgit }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name= "site-musique";
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://gitlab.com/nyanloutre/site-musique.git";
|
||||||
|
rev = "78e5d570534d528cdf19c44332cd2c929f6fa861";
|
||||||
|
sha256 = "0rv1il85gxvi4d6yal8ac7q9jjz0w0ghmklbwzpd3p04v34y1rpd";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/
|
||||||
|
cp -R . $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Site internet de l'association Musique Fraternité de Meyenheim";
|
||||||
|
homepage = https://musique-meyenheim.fr/;
|
||||||
|
maintainers = with stdenv.lib.maintainers; [ nyanloutre ];
|
||||||
|
license = stdenv.lib.licenses.cc-by-nc-sa-40;
|
||||||
|
platforms = stdenv.lib.platforms.all;
|
||||||
|
};
|
||||||
|
}
|
@ -59,7 +59,7 @@ if latest_commit != previous_commit:
|
|||||||
|
|
||||||
pr = repo.create_pull(title=branch, body=pr_message, base='nixos-18.09', head=branch)
|
pr = repo.create_pull(title=branch, body=pr_message, base='nixos-18.09', head=branch)
|
||||||
|
|
||||||
print("Pull request numéro " + str(pr.number) + " créée")
|
print("Pull request numéro " + str(pr.numero) + " créée")
|
||||||
print("URL : " + pr.html_url)
|
print("URL : " + pr.html_url)
|
||||||
|
|
||||||
while pr.mergeable == None:
|
while pr.mergeable == None:
|
||||||
|
@ -24,6 +24,10 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import ../overlays/site-musique.nix)
|
||||||
|
];
|
||||||
|
|
||||||
services.haproxy-acme.services = {
|
services.haproxy-acme.services = {
|
||||||
${cfg.domaine} = { ip = "127.0.0.1"; port = cfg.port; auth = false; };
|
${cfg.domaine} = { ip = "127.0.0.1"; port = cfg.port; auth = false; };
|
||||||
};
|
};
|
||||||
@ -32,7 +36,7 @@ in
|
|||||||
"musique" = {
|
"musique" = {
|
||||||
listen = [ { addr = "127.0.0.1"; port = cfg.port; } ];
|
listen = [ { addr = "127.0.0.1"; port = cfg.port; } ];
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
root = "/run/site-musique/result";
|
root = pkgs.site-musique;
|
||||||
index = "index.php";
|
index = "index.php";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
location ~* \.php$ {
|
location ~* \.php$ {
|
||||||
@ -63,39 +67,5 @@ in
|
|||||||
catch_workers_output = yes
|
catch_workers_output = yes
|
||||||
'';
|
'';
|
||||||
|
|
||||||
systemd.services.build-site-musique = {
|
|
||||||
description = "Compilation du site de la musique";
|
|
||||||
requires = ["network-online.target"];
|
|
||||||
path = with pkgs;[ git nix ];
|
|
||||||
environment = { HOME = "/var/lib/site-musique"; NIX_PATH = "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs"; };
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
DynamicUser = true;
|
|
||||||
RuntimeDirectory = "site-musique";
|
|
||||||
RuntimeDirectoryPreserve = "yes";
|
|
||||||
CacheDirectory = "site-musique";
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = "${pkgs.writeShellScriptBin "build.sh" ''
|
|
||||||
set -x
|
|
||||||
set -e
|
|
||||||
GIT_CLONE_DIR=/var/cache/site-musique
|
|
||||||
|
|
||||||
if [ ! -d $GIT_CLONE_DIR/.git ]; then
|
|
||||||
git clone --depth 1 https://gitlab.com/nyanloutre/site-musique.git $GIT_CLONE_DIR
|
|
||||||
else
|
|
||||||
git -C $GIT_CLONE_DIR pull
|
|
||||||
fi
|
|
||||||
|
|
||||||
NIXPKGS_ALLOW_UNFREE=1 nix-build -o /run/site-musique/result $GIT_CLONE_DIR
|
|
||||||
''}/bin/build.sh";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.timers.build-site-musique = {
|
|
||||||
description = "Timer de compilation du site de la musique";
|
|
||||||
requires = ["network-online.target"];
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
timerConfig = { OnCalendar = "*:0/5"; Unit = "build-site-musique.service"; };
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user