diff --git a/configuration.nix b/configuration.nix index 866b718..1d242e3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -42,6 +42,7 @@ (import ./overlays/organizr.nix) (import ./overlays/sudo.nix) (import ./overlays/site-max.nix) + (import ./overlays/site-musique.nix) ]; environment.systemPackages = with pkgs; [ neovim diff --git a/overlays/site-musique.nix b/overlays/site-musique.nix new file mode 100644 index 0000000..62f738b --- /dev/null +++ b/overlays/site-musique.nix @@ -0,0 +1,5 @@ +self: super: + +{ + site-musique = super.callPackage ../pkgs/site-musique { }; +} diff --git a/pkgs/site-musique/default.nix b/pkgs/site-musique/default.nix new file mode 100644 index 0000000..7629ec9 --- /dev/null +++ b/pkgs/site-musique/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name= "site-musique-${version}"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "nyanloutre"; + repo = "site-musique"; + rev = "42ffbfa85422f0d3e98e842ca702e07cb20be0c0"; + sha256 = "1ndfwg6rpkm2hn5naw0c91l6zbpcd011irs8imchqzbj4m2i7wgm"; + }; + + 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; + }; +} diff --git a/services.nix b/services.nix index be66236..f8227fd 100644 --- a/services.nix +++ b/services.nix @@ -9,6 +9,7 @@ let organizr_port = 52346; pgmanage_port = 52347; max_port = 52348; + musique_port = 52349; in { @@ -36,6 +37,7 @@ in calibre = { ip = "127.0.0.1"; port = 8080; auth = false; }; pgmanage = { ip = "127.0.0.1"; port = pgmanage_port; auth = true; }; max = { ip = "127.0.0.1"; port = max_port; auth = false; }; + musique = { ip = "127.0.0.1"; port = musique_port; auth = false; }; }; services.mailserver.enable = true; @@ -137,6 +139,21 @@ in listen = [ { addr = "127.0.0.1"; port = max_port; } ]; locations = { "/" = { root = pkgs.site-max; }; }; }; + "musique" = { + listen = [ { addr = "127.0.0.1"; port = musique_port; } ]; + locations."/" = { + root = pkgs.site-musique; + index = "index.php"; + extraConfig = '' + location ~* \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/run/phpfpm/nginx; + include ${pkgs.nginx}/conf/fastcgi_params; + include ${pkgs.nginx}/conf/fastcgi.conf; + } + ''; + }; + }; }; services.phpfpm.poolConfigs.mypool = ''