Commit graph

16 commits

Author SHA1 Message Date
7c33e8aaf3 scaffold Django web service
This setup is greatly inspired by the one used for [0], although with
notable modifications, such as:
- a SASS preprocessor and CSS compressor
- more streamlined NixOS integration tests
- cleaned up service configuration
- a few notes on how to do things better in the future

[0]: https://github.com/Nix-Security-WG/nix-security-tracker/

Apart from cloning the Nix setup, there were additional steps:
- Create an empty `src` directory, since the package requires it
- In the development shell, run `django-admin startproject panel src`

Note that while you can already do

```bash
manage migrate
manage runserver
```

the NixOS integration tests will fail, since `settings.py` needs
careful massaging to expose knobs that can be turned from our systemd
wrapper. The required changes are introduced in the next commit to make
them observable.

Noteworthy related work:

- https://github.com/sephii/django.nix

  Rather mature setup with a clean interface, uses Caddy as reverse proxy.

- https://git.dgnum.eu/mdebray/djangonix

  A work-in-progress attempt to capture more moving parts through the
  module system, in particular secrets.

- https://github.com/DavHau/django-nixos

  Out of date and somewhat simplistic, but serves as a reasonable
  example for what can be done

I chose the variant I'm intimately familiar with in order to be able to
pass on knowledge or help with maintenance. But for the future
I strongly recommend picking the good bits from the other
implementations that control complexity in static configuration parts
through Nix expressions.
2025-02-13 00:26:28 +01:00
ba97ed26d0
Get rid of useless self and providers arguments 2025-01-31 16:34:21 +01:00
564938e52d
Clean up handling of secrets in infra 2025-01-31 16:29:31 +01:00
1d05993127
Bump NixOps4
in particular, follow the split of `nixops4-nixos` to its own
repository.
2025-01-31 14:11:46 +01:00
109284b98b
Expose keys and secrets in the global flake 2024-12-13 00:26:43 +01:00
7908affaab
Keys in separate files in own directory 2024-12-13 00:26:43 +01:00
5771c14249
Set up a first secret 2024-12-12 12:38:20 +01:00
ed26839078
Add Agenix to the environment 2024-12-12 12:38:19 +01:00
243ff8f070
Bump nixpkgs to 24.11 2024-11-26 13:00:00 +01:00
8ad1457763
Enable trimming of trailing whitespace as a pre-commit hook 2024-11-20 13:07:03 +01:00
18b03924ad Format and clean dead code in infra/ (#12)
Reviewed-on: Fediversity/Fediversity#12
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2024-11-18 12:09:30 +01:00
40ec7e9c8c
Make a NixOps4 deployment for action runners 2024-11-18 10:56:38 +01:00
435d9c861a
Integrate deployment as a flake part 2024-11-14 18:07:12 +01:00
fc2acc13d8
Integrate services as a flake part 2024-11-14 18:07:11 +01:00
a888540580
Opt-in to formatting for the services/ subdirectory 2024-11-14 17:50:17 +01:00
e51fca5f0e
Basic flake with pre-commit hooks 2024-11-14 17:50:17 +01:00