From 4b78fbbec3c86b2f68fb4b149066406963c04a47 Mon Sep 17 00:00:00 2001 From: Adam Brady Date: Mon, 30 Sep 2024 13:03:41 +1000 Subject: [PATCH] Add initial pup configuration --- manifest.json | 34 ++++++++++++++++++++++++++++++++++ pup.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 manifest.json create mode 100644 pup.nix diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d0e18e2 --- /dev/null +++ b/manifest.json @@ -0,0 +1,34 @@ +{ + "manifestVersion": 1, + "meta": { + "name": "dogebox-retail", + "version": "0.0.1", + "logoPath": "", + "shortDescription": "The dogebox.dogecoin.com website as a pup", + "longDescription": "", + "upstreamVersions": null + }, + "config": { + "sections": null + }, + "container": { + "build": { + "nixFile": "pup.nix", + "nixFileSha256": "7bd36b6bd91091bffda63aefd442c453ce6e4c22b3f29dbe6debb963e8b3c3db" + }, + "services": [], + "exposes": [ + { + "name": "public", + "type": "http", + "port": 8090, + "interfaces": null, + "listenOnHost": true + } + ], + "requiresInternet": false + }, + "interfaces": null, + "dependencies": null, + "metrics": null +} \ No newline at end of file diff --git a/pup.nix b/pup.nix new file mode 100644 index 0000000..26a0e85 --- /dev/null +++ b/pup.nix @@ -0,0 +1,46 @@ +{ pkgs }: + +let + files = pkgs.stdenv.mkDerivation { + name = "files"; + src = ./.; + installPhase = '' + mkdir -p $out/opt/www + cp -r . $out/opt/www + ''; + }; + + services = { + mysql = { + enable = true; + package = pkgs.mysql; + }; + + phpfpm = { + phpPackage = pkgs.php; + pools.www = { + user = "pup"; + group = "pup"; + listen = "/run/php-fpm/www.sock"; + }; + }; + + caddy = { + enable = true; + package = pkgs.caddy; + extraConfig = '' + :8090 { + root * ${files}/opt/www + php_fastcgi /run/php-fpm/www.sock + file_server + handle_errors { + respond "404" + } + } + ''; + }; + }; +in +{ + inherit services; +}