Package everything #5

Merged
sinavir merged 10 commits from package_everything into main 2024-03-02 16:10:54 +00:00
sinavir commented 2024-02-29 23:19:55 +00:00 (Migrated from github.com)

Still to be done:

  • Activation script ?
  • Switch to postgres
Still to be done: - [ ] Activation script ? - [x] Switch to postgres
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:22:59 +00:00
@ -0,0 +1,56 @@
{ lib
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:22:58 +00:00
    maintainers = with maintainers; [ raitobezarius thubrecht ];
```suggestion maintainers = with maintainers; [ raitobezarius thubrecht ]; ```
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:24:44 +00:00
@ -0,0 +1,26 @@
{
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:24:44 +00:00

why import a weird outside dep instead of using filesets?

why import a weird outside dep instead of using filesets?
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:25:01 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:25:00 +00:00

excessive configuration

excessive configuration
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:25:07 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:25:07 +00:00

excessive

excessive
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:25:12 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:25:12 +00:00

excessive

excessive
Tom-Hubrecht (Migrated from github.com) reviewed 2024-02-29 23:25:48 +00:00
@ -0,0 +1,56 @@
{ lib
Tom-Hubrecht (Migrated from github.com) commented 2024-02-29 23:21:24 +00:00

Arkheon*

Arkheon*
Tom-Hubrecht (Migrated from github.com) commented 2024-02-29 23:22:00 +00:00

thubrecht RaitoBezarius

thubrecht RaitoBezarius
@ -0,0 +1,26 @@
{
Tom-Hubrecht (Migrated from github.com) commented 2024-02-29 23:23:30 +00:00

Ça arrive de pas avoir nix-filter ?

Ça arrive de pas avoir nix-filter ?
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
Tom-Hubrecht (Migrated from github.com) commented 2024-02-29 23:25:02 +00:00

On veut uvicorn en prod ou daphne comme la pr de Raito ?

On veut uvicorn en prod ou daphne comme la pr de Raito ?
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:26:07 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:26:07 +00:00

we usually rather write nginx instead of reverseProxy
and then you plug the NGINX configuration fragment for a virtual host inside of it so you don't repeat yourself

we usually rather write `nginx` instead of `reverseProxy` and then you plug the NGINX configuration fragment for a virtual host inside of it so you don't repeat yourself
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:26:39 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:26:39 +00:00

excessive option

excessive option
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:27:32 +00:00
@ -0,0 +11,4 @@
let
removeFilesets = lib.foldl lib.fileset.difference;
in
buildPythonPackage rec {
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:27:32 +00:00

I'd attach the frontend inside the backend so you do arkheon.frontend or arkheon.ui to get those staticfiles.

I'd attach the frontend _inside_ the backend so you do `arkheon.frontend` or `arkheon.ui` to get those staticfiles.
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:27:50 +00:00
@ -0,0 +7,4 @@
version = "0.1.0"
authors = [
{ name="Tom Hubrecht", email="tom@hubrecht.ovh" },
{ name="Raito Bezarius", email="masterancpp@gmail.com" },
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:27:50 +00:00

Add yourself @sinavir as one of the author

Add yourself @sinavir as one of the author
RaitoBezarius (Migrated from github.com) reviewed 2024-02-29 23:28:32 +00:00
@ -0,0 +1,9 @@
self: super: let
RaitoBezarius (Migrated from github.com) commented 2024-02-29 23:28:32 +00:00

not needed if the frontend is tucked inside of the backend

not needed if the frontend is tucked inside of the backend
RaitoBezarius (Migrated from github.com) requested changes 2024-02-29 23:29:58 +00:00
RaitoBezarius (Migrated from github.com) left a comment

Various changes, when doing new NixOS modules, aim for a very simple v1, opinionated and all, to avoid writing too much fluff. This enables you to have a working result very fast and an initial footprint that is small.

For backend&frontend, the pattern is to tie frontend with the backend to avoid wondering "what frontend should I take" and backend should be overridden to offer a new frontend if you want to do theming or something at build time.

NGINX configuration fragment are injected directly, take a look at how nixpkgs do it.

OTOH, this is a pretty good start.

Various changes, when doing new NixOS modules, aim for a very simple v1, opinionated and all, to avoid writing too much fluff. This enables you to have a working result very fast and an initial footprint that is small. For backend&frontend, the pattern is to tie frontend with the backend to avoid wondering "what frontend should I take" and backend should be overridden to offer a new frontend if you want to do theming or something at build time. NGINX configuration fragment are injected directly, take a look at how nixpkgs do it. OTOH, this is a pretty good start.
sinavir (Migrated from github.com) reviewed 2024-03-01 00:17:18 +00:00
@ -0,0 +1,26 @@
{
sinavir (Migrated from github.com) commented 2024-03-01 00:17:18 +00:00

Hmm oui quand tu utilises l'overlay (en gros sur les setup où tu sources le dépôt avec npins)

Hmm oui quand tu utilises l'overlay (en gros sur les setup où tu sources le dépôt avec npins)
sinavir (Migrated from github.com) reviewed 2024-03-01 00:19:31 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
sinavir (Migrated from github.com) commented 2024-03-01 00:19:31 +00:00

Vraiment ? on peut plus trop configurer uvicorn (ou whatever serveur asgi) non après ?

Vraiment ? on peut plus trop configurer uvicorn (ou whatever serveur asgi) non après ?
RaitoBezarius (Migrated from github.com) reviewed 2024-03-01 00:40:10 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
RaitoBezarius (Migrated from github.com) commented 2024-03-01 00:40:10 +00:00

pourquoi un utilisateur voudrait les configurer? pour override, tu peux juste réécrire le ExecStart directement

pourquoi un utilisateur voudrait les configurer? pour override, tu peux juste réécrire le ExecStart directement
RaitoBezarius (Migrated from github.com) reviewed 2024-03-01 00:40:16 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
RaitoBezarius (Migrated from github.com) commented 2024-03-01 00:40:16 +00:00

daphne imho

daphne imho
Tom-Hubrecht (Migrated from github.com) reviewed 2024-03-01 06:52:53 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
Tom-Hubrecht (Migrated from github.com) commented 2024-03-01 06:52:34 +00:00

Normalement ça devrait suffire

            tryFiles = "$uri /index.html";
Normalement ça devrait suffire ```suggestion tryFiles = "$uri /index.html"; ```
JulienMalka (Migrated from github.com) reviewed 2024-03-01 22:29:36 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
JulienMalka (Migrated from github.com) commented 2024-03-01 22:29:36 +00:00

The arkheaon.command option has been removed

The `arkheaon.command` option has been removed
Tom-Hubrecht (Migrated from github.com) reviewed 2024-03-01 23:37:37 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
Tom-Hubrecht (Migrated from github.com) commented 2024-03-01 23:37:36 +00:00
        EnvironmentFile = lib.optional (cfg.envFile != null) cfg.envFile;
```suggestion EnvironmentFile = lib.optional (cfg.envFile != null) cfg.envFile; ```
Tom-Hubrecht (Migrated from github.com) reviewed 2024-03-01 23:40:44 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
Tom-Hubrecht (Migrated from github.com) commented 2024-03-01 23:40:44 +00:00
    nginx = lib.mkEnableOption "nginx reverse proxy for Arkheon."
```suggestion nginx = lib.mkEnableOption "nginx reverse proxy for Arkheon." ```
Tom-Hubrecht (Migrated from github.com) reviewed 2024-03-01 23:42:27 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
Tom-Hubrecht (Migrated from github.com) commented 2024-03-01 23:42:27 +00:00

Ou pas en fait, mais tu utilises pas cette option actuellement

Ou pas en fait, mais tu utilises pas cette option actuellement
sinavir (Migrated from github.com) reviewed 2024-03-02 12:07:25 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
sinavir (Migrated from github.com) commented 2024-03-02 12:07:25 +00:00

Moi je trouve c'est pratique pour l'utilisateur final pour activer ssl et oauth-proxy. Et maintenant je l'utilise aussi

Moi je trouve c'est pratique pour l'utilisateur final pour activer ssl et oauth-proxy. Et maintenant je l'utilise aussi
Tom-Hubrecht (Migrated from github.com) reviewed 2024-03-02 13:00:31 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
Tom-Hubrecht (Migrated from github.com) commented 2024-03-02 13:00:31 +00:00

Nitpick, vhost est uniquement défini pour ce test, tu pourrais faire :

  hasSSL = with cfg.nginx; onlySSL || enableSSL || addSSL || forceSSL;
Nitpick, `vhost` est uniquement défini pour ce test, tu pourrais faire : ```suggestion hasSSL = with cfg.nginx; onlySSL || enableSSL || addSSL || forceSSL; ```
sinavir commented 2024-03-02 13:01:08 +00:00 (Migrated from github.com)

May be we should use something as here (NixOS/nixpkgs@79baff8812/nixos/modules/services/web-apps/pixelfed.nix (L451)) for nginx config. What do you think ? I am not enough a nixpkgs expert to understand the differences...

May be we should use something as here (https://github.com/NixOS/nixpkgs/blob/79baff8812a0d68e24a836df0a364c678089e2c7/nixos/modules/services/web-apps/pixelfed.nix#L451) for nginx config. What do you think ? I am not enough a nixpkgs expert to understand the differences...
sinavir commented 2024-03-02 13:09:01 +00:00 (Migrated from github.com)

May be we should use something as here (NixOS/nixpkgs@79baff8812/nixos/modules/services/web-apps/pixelfed.nix (L451)) for nginx config. What do you think ? I am not enough a nixpkgs expert to understand the differences...

Ok, we shouldn't. Since we want nginx on by default

> May be we should use something as here (https://github.com/NixOS/nixpkgs/blob/79baff8812a0d68e24a836df0a364c678089e2c7/nixos/modules/services/web-apps/pixelfed.nix#L451) for nginx config. What do you think ? I am not enough a nixpkgs expert to understand the differences... Ok, we shouldn't. Since we want nginx on by default
sinavir (Migrated from github.com) reviewed 2024-03-02 13:09:58 +00:00
@ -0,0 +1,120 @@
{ config, pkgs, lib, modulesPath, ... }:
sinavir (Migrated from github.com) commented 2024-03-02 13:09:58 +00:00

Oui

Oui
Tom-Hubrecht (Migrated from github.com) approved these changes 2024-03-02 13:18:39 +00:00
RaitoBezarius (Migrated from github.com) reviewed 2024-03-02 16:06:59 +00:00
@ -0,0 +91,4 @@
nginx.locations = {
"/" = {
root = pkgs.python3.pkgs.arkheon.frontend.override {
backendUrl = "http${lib.optionalString hasSSL "s"}://${cfg.domain}/api";
RaitoBezarius (Migrated from github.com) commented 2024-03-02 16:06:58 +00:00

semi-nit: this looks overkill, you know that if the frontend is loaded over TLS, you need to keep using the same scheme for the backend, so frontend should construct the URL via //.

semi-nit: this looks overkill, you know that if the frontend is loaded over TLS, you need to keep using the same scheme for the backend, so frontend should construct the URL via `//`.
RaitoBezarius (Migrated from github.com) reviewed 2024-03-02 16:08:30 +00:00
@ -0,0 +26,4 @@
)
with subtest("API has no error"):
# Api is slow to initialize. We should rely on systemd-notify stuff but hard to implement
RaitoBezarius (Migrated from github.com) commented 2024-03-02 16:08:30 +00:00

just wait until the port is open?

just wait until the port is open?
RaitoBezarius (Migrated from github.com) approved these changes 2024-03-02 16:09:05 +00:00
RaitoBezarius (Migrated from github.com) left a comment

Only missing component are UNIX socket support, but it's fine, let's move on.

Only missing component are UNIX socket support, but it's fine, let's move on.
sinavir commented 2024-03-02 16:10:42 +00:00 (Migrated from github.com)

... and remove the post patch hack maybe

... and remove the post patch hack maybe
Tom-Hubrecht commented 2024-03-02 16:11:20 +00:00 (Migrated from github.com)

... and remove the post patch hack maybe

We can push on master for this :p

> ... and remove the post patch hack maybe We can push on master for this :p
Sign in to join this conversation.
No description provided.