Compare commits
10 commits
892fb25d06
...
a26fa2c64a
| Author | SHA1 | Date | |
|---|---|---|---|
| a26fa2c64a | |||
| b2890353c1 | |||
| 2c095ff8c0 | |||
| c5c3dadc3c | |||
| ea1de563c9 | |||
| f4f38cb07a | |||
| 639e5cb8cf | |||
| 5fc5c123ff | |||
| 65b556d858 | |||
| 4fbf63bfaa |
6 changed files with 91 additions and 64 deletions
1
assets/favicon.svg
Normal file
1
assets/favicon.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
|
||||||
16
favicon.svg
Normal file
16
favicon.svg
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#667eea"/>
|
||||||
|
<stop offset="100%" stop-color="#764ba2"/>
|
||||||
|
</linearGradient>
|
||||||
|
<filter id="s" x="-20%" y="-20%" width="140%" height="140%">
|
||||||
|
<feDropShadow dx="0" dy="8" stdDeviation="10" flood-color="#000" flood-opacity="0.2"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
<rect x="16" y="16" width="224" height="224" rx="48" fill="url(#g)" filter="url(#s)"/>
|
||||||
|
<g fill="#fff" stroke="none" transform="translate(64,64)">
|
||||||
|
<path d="M64 0c35.3 0 64 28.7 64 64s-28.7 64-64 64S0 99.3 0 64 28.7 0 64 0zm0 16C37.5 16 16 37.5 16 64s21.5 48 48 48 48-21.5 48-48S90.5 16 64 16z" opacity="0.2"/>
|
||||||
|
<path d="M28 88V24h68v16H48v16h40v16H48v16h48v16z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 841 B |
15
flake.nix
15
flake.nix
|
|
@ -16,24 +16,21 @@
|
||||||
);
|
);
|
||||||
in {
|
in {
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
fragify = with final; python3Packages.buildPythonApplication {
|
fragify = with final; python3Packages.buildPythonApplication rec {
|
||||||
pname = "fragify";
|
pname = "fragify";
|
||||||
version = "0.0.1";
|
version = "0.0.1";
|
||||||
format = "other";
|
format = "other";
|
||||||
|
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
dependencies = with python3Packages; [
|
dontBuild = true;
|
||||||
python
|
|
||||||
falcon
|
dependencies = with python3Packages; [ falcon requests jinja2 ];
|
||||||
requests
|
|
||||||
jinja2
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -Dm755 ${./fragify.py} $out/bin/fragify
|
install -Dm755 ${./fragify.py} $out/bin/fragify
|
||||||
mkdir -p $out/share/fragify
|
mkdir -p $out/share/fragify
|
||||||
cp -r ${./templates} $out/share/fragify/
|
cp -r ${./templates} $out/share/fragify/templates
|
||||||
# Provide a WSGI entry file for uWSGI to load
|
# Provide a WSGI entry file for uWSGI to load
|
||||||
install -Dm644 ${./fragify.py} $out/share/fragify/fragify_wsgi.py
|
install -Dm644 ${./fragify.py} $out/share/fragify/fragify_wsgi.py
|
||||||
# Install built assets if present
|
# Install built assets if present
|
||||||
|
|
@ -42,6 +39,8 @@
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.pythonPath = python3Packages.makePythonPath dependencies;
|
||||||
|
|
||||||
meta.mainProgram = "fragify";
|
meta.mainProgram = "fragify";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,13 @@ gulp.task('copy-select2-theme', function () {
|
||||||
.pipe(gulp.dest('./assets/css'));
|
.pipe(gulp.dest('./assets/css'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('copy-assets', gulp.series('copy-bulk', 'copy-jquery', 'copy-select2-theme'));
|
// Copy favicon(s)
|
||||||
|
gulp.task('copy-favicon', function () {
|
||||||
|
return gulp
|
||||||
|
.src(['./favicon.svg'], { allowEmpty: true })
|
||||||
|
.pipe(gulp.dest('./assets'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('copy-assets', gulp.series('copy-bulk', 'copy-jquery', 'copy-select2-theme', 'copy-favicon'));
|
||||||
|
|
||||||
gulp.task('default', gulp.series('copy-assets'));
|
gulp.task('default', gulp.series('copy-assets'));
|
||||||
111
module.nix
111
module.nix
|
|
@ -6,69 +6,72 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.services.fragify;
|
cfg = config.services.fragify;
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
services.fragify = {
|
services.fragify = {
|
||||||
|
|
||||||
enable = lib.mkEnableOption "Fragify web app";
|
enable = lib.mkEnableOption "Fragify web app";
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
services.uwsgi = {
|
services.uwsgi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "fragify";
|
plugins = [ "python3" ];
|
||||||
group = "fragify";
|
|
||||||
plugins = [ "python3" ];
|
|
||||||
instances.fragify = {
|
|
||||||
# Align with upstream module: put uwsgi options under settings
|
|
||||||
settings = {
|
|
||||||
"chdir" = "/";
|
|
||||||
"wsgi-file" = "${pkgs.fragify}/share/fragify/fragify_wsgi.py";
|
|
||||||
module = "fragify:app";
|
|
||||||
# Socket
|
|
||||||
"socket" = "unix:${config.services.uwsgi.runDir}/fragify.sock";
|
|
||||||
"chmod-socket" = "660";
|
|
||||||
umask = "0077";
|
|
||||||
vacuum = true;
|
|
||||||
master = true;
|
|
||||||
processes = 2;
|
|
||||||
threads = 2;
|
|
||||||
"harakiri" = 60;
|
|
||||||
"buffer-size" = 65535;
|
|
||||||
"need-app" = true;
|
|
||||||
"no-orphans" = true;
|
|
||||||
# Serve static files directly via uWSGI (optional)
|
|
||||||
# Map /static to packaged assets directory (if present)
|
|
||||||
"static-map" = "/static=${pkgs.fragify}/share/fragify/assets";
|
|
||||||
};
|
|
||||||
# Environment for the WSGI app
|
|
||||||
env = {
|
|
||||||
FRAGIFY_TEMPLATES_DIR = "${pkgs.fragify}/share/fragify/templates";
|
|
||||||
FRAGIFY_STATIC_DIR = "${pkgs.fragify}/share/fragify/assets";
|
|
||||||
};
|
|
||||||
# Python packages for uWSGI
|
|
||||||
pythonPackages = p: with p; [ falcon requests jinja2 ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Ensure fragify user and group exist
|
instance = {
|
||||||
users.users.fragify = {
|
type = "emperor";
|
||||||
isSystemUser = true;
|
vassals = {
|
||||||
group = "fragify";
|
fragify = {
|
||||||
description = "fragify web application user";
|
type = "normal";
|
||||||
};
|
chdir = "/";
|
||||||
|
|
||||||
users.groups.fragify = {};
|
module = "fragify_wsgi:app";
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
socket = "${config.services.uwsgi.runDir}/fragify.sock";
|
||||||
maintainers = with lib.maintainers; [ onny ];
|
"chmod-socket" = "660";
|
||||||
};
|
|
||||||
|
umask = "0077";
|
||||||
|
vacuum = true;
|
||||||
|
master = true;
|
||||||
|
processes = 2;
|
||||||
|
threads = 2;
|
||||||
|
harakiri = 60;
|
||||||
|
"buffer-size" = 65535;
|
||||||
|
need-app = true;
|
||||||
|
"no-orphans" = true;
|
||||||
|
|
||||||
|
env = [
|
||||||
|
"PYTHONPATH=${pkgs.fragify}/share/fragify:${pkgs.fragify.pythonPath}"
|
||||||
|
"FRAGIFY_TEMPLATES_DIR=${pkgs.fragify}/share/fragify/templates"
|
||||||
|
"FRAGIFY_STATIC_DIR=${pkgs.fragify}/share/fragify/assets"
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
"static-map" = "/static=${pkgs.fragify}/share/fragify/assets";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Ensure fragify user and group exist
|
||||||
|
users.users.fragify = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "fragify";
|
||||||
|
description = "fragify web application user";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.fragify = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
maintainers = with lib.maintainers; [ onny ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@
|
||||||
|
|
||||||
{% if noindex %}<meta name="robots" content="noindex,follow">{% endif %}
|
{% if noindex %}<meta name="robots" content="noindex,follow">{% endif %}
|
||||||
<meta name="theme-color" content="#667eea">
|
<meta name="theme-color" content="#667eea">
|
||||||
<link rel="icon" href="/static/favicon.ico">
|
<link rel="icon" href="/static/favicon.svg" type="image/svg+xml">
|
||||||
|
<link rel="alternate icon" href="/static/favicon.ico">
|
||||||
|
|
||||||
{% block meta_extra %}{% endblock %}
|
{% block meta_extra %}{% endblock %}
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue