diff options
author | Herwig Hochleitner <herwig@bendlas.net> | 2023-11-17 15:55:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-17 15:55:24 +0100 |
commit | 20832d59954641e608d1dc5bb51457280dc384d7 (patch) | |
tree | 6969dc4a35abcba2e42b6ebc19721fc406695380 | |
parent | 139ccb05544a8460ec48bee1f9d84e17604d8a46 (diff) | |
download | nixpkgs-20832d59954641e608d1dc5bb51457280dc384d7.tar nixpkgs-20832d59954641e608d1dc5bb51457280dc384d7.tar.gz nixpkgs-20832d59954641e608d1dc5bb51457280dc384d7.tar.bz2 nixpkgs-20832d59954641e608d1dc5bb51457280dc384d7.tar.lz nixpkgs-20832d59954641e608d1dc5bb51457280dc384d7.tar.xz nixpkgs-20832d59954641e608d1dc5bb51457280dc384d7.tar.zst nixpkgs-20832d59954641e608d1dc5bb51457280dc384d7.zip |
nixos/forgejo: changelog and migration instructions (#267248)
* nixos/forgejo: changelog and migration instructions * nixos/forgejo/docs: clarify sentence Co-authored-by: Trolli Schmittlauch <schmittlauch@users.noreply.github.com> * nixos/forgejo/docs: document migration via gitea impersonation * nixos/forgejo/docs: note about url change on migration * nixos/forgejo/docs: note about migration (non-)requirement * nixos/forgejo/docs: header ids * nixos/forgejo/docs: clarify release notes entry Co-authored-by: Emily <git@emilylange.de> * nixos/forgejo/docs: improve manual entry Co-authored-by: Emily <git@emilylange.de> * nixos/forgejo/docs: move changelog line to the middle of the section as noted <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> --------- Co-authored-by: Trolli Schmittlauch <schmittlauch@users.noreply.github.com> Co-authored-by: Emily <git@emilylange.de>
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2311.section.md | 2 | ||||
-rw-r--r-- | nixos/modules/services/misc/forgejo.md | 79 | ||||
-rw-r--r-- | nixos/modules/services/misc/forgejo.nix | 1 |
3 files changed, 82 insertions, 0 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 5cb5fec2305..1dbc33f2373 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -104,6 +104,8 @@ - [eris-server](https://codeberg.org/eris/eris-go). [ERIS](https://eris.codeberg.page/) is an encoding for immutable storage and this server provides block exchange as well as content decoding over HTTP and through a FUSE file-system. Available as [services.eris-server](#opt-services.eris-server.enable). +- [forgejo](https://forgejo.org/), a git forge. Previously deployed as a drop-in replacement package in the [gitea module](#opt-services.gitea.package). Available as [services.forgejo](#opt-services.forgejo.enable). See migration instructions in the [NixOS manual](#module-forgejo) on how to migrate your forgejo instance using [`services.gitea.package = pkgs.forgejo`](#opt-services.gitea.package) to [`services.forgejo`](#opt-services.forgejo.enable). + - hardware/infiniband.nix adds infiniband subnet manager support using an [opensm](https://github.com/linux-rdma/opensm) systemd-template service, instantiated on card guids. The module also adds kernel modules and cli tooling to help administrators debug and measure performance. Available as [hardware.infiniband.enable](#opt-hardware.infiniband.enable). - [zwave-js](https://github.com/zwave-js/zwave-js-server), a small server wrapper around Z-Wave JS to access it via a WebSocket. Available as [services.zwave-js](#opt-services.zwave-js.enable). diff --git a/nixos/modules/services/misc/forgejo.md b/nixos/modules/services/misc/forgejo.md new file mode 100644 index 00000000000..6a340738208 --- /dev/null +++ b/nixos/modules/services/misc/forgejo.md @@ -0,0 +1,79 @@ +# Forgejo {#module-forgejo} + +Forgejo is a soft-fork of gitea, with strong community focus, as well +as on self-hosting and federation. [Codeberg](https://codeberg.org) is +deployed from it. + +See [upstream docs](https://forgejo.org/docs/latest/). + +The method of choice for running forgejo is using [`services.forgejo`](#opt-services.forgejo.enable). + +::: {.warning} +Running forgejo using `services.gitea.package = pkgs.forgejo` is no longer +recommended. +If you experience issues with your instance using `services.gitea`, +**DO NOT** report them to the `services.gitea` module maintainers. +**DO** report them to the `services.forgejo` module maintainers instead. +::: + +## Migration from Gitea {#module-forgejo-migration-gitea} + +::: {.note} +Migrating is, while not strictly necessary at this point, highly recommended. +Both modules and projects are likely to divide further with each release. +Which might lead to an even more involved migration. +::: + +### Full-Migration {#module-forgejo-migration-gitea-default} + +This will migrate the state directory (data), rename and chown the database and +delete the gitea user. + +::: {.note} +This will also change the git remote ssh-url user from `gitea@` to `forgejo@`, +when using the host's openssh server (default) instead of the integrated one. +::: + +Instructions for PostgreSQL (default). Adapt accordingly for other databases: + +```sh +systemctl stop gitea +mv /var/lib/gitea /var/lib/forgejo +runuser -u postgres -- psql -c ' + ALTER USER gitea RENAME TO forgejo; + ALTER DATABASE gitea RENAME TO forgejo; +' +nixos-rebuild switch +systemctl stop forgejo +chown -R forgejo:forgejo /var/lib/forgejo +systemctl restart forgejo +``` + +### Alternatively, keeping the gitea user {#module-forgejo-migration-gitea-impersonate} + +Alternatively, instead of renaming the database, copying the state folder and +changing the user, the forgejo module can be set up to re-use the old storage +locations and database, instead of having to copy or rename them. +Make sure to disable `services.gitea`, when doing this. + +```nix +services.gitea.enable = false; + +services.forgejo = { + enable = true; + user = "gitea"; + group = "gitea"; + stateDir = "/var/lib/gitea"; + database.name = "gitea"; + database.user = "gitea"; +}; + +users.users,gitea = { + home = "/var/lib/gitea"; + useDefaultShell = true; + group = "gitea"; + isSystemUser = true; +}; + +users.groups.gitea = {}; +``` diff --git a/nixos/modules/services/misc/forgejo.nix b/nixos/modules/services/misc/forgejo.nix index 90b5f16f418..e71e47b27f1 100644 --- a/nixos/modules/services/misc/forgejo.nix +++ b/nixos/modules/services/misc/forgejo.nix @@ -677,5 +677,6 @@ in }; }; + meta.doc = ./forgejo.md; meta.maintainers = with lib.maintainers; [ bendlas emilylange ]; } |