Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial pup configuration #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -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
}
46 changes: 46 additions & 0 deletions pup.nix
Original file line number Diff line number Diff line change
@@ -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;
}