···72727373- `services.lemmy.settings.federation` was removed in 0.17.0 and no longer has any effect. To enable federation, the hostname must be set in the configuration file and then federation must be enabled in the admin web UI. See the [release notes](https://github.com/LemmyNet/lemmy/blob/c32585b03429f0f76d1e4ff738786321a0a9df98/RELEASES.md#upgrade-instructions) for more details.
74747575+- `pict-rs` was upgraded from 0.3 to 0.4 and contains an incompatible database & configuration change. To upgrade on systems with `stateVersion = "23.05";` or older follow the migration steps from https://git.asonix.dog/asonix/pict-rs#user-content-0-3-to-0-4-migration-guide and set `services.pict-rs.package = pkgs.pict-rs;`.
7676+7577- The following packages in `haskellPackages` have now a separate bin output: `cabal-fmt`, `calligraphy`, `eventlog2html`, `ghc-debug-brick`, `hindent`, `nixfmt`, `releaser`. This means you need to replace e.g. `"${pkgs.haskellPackages.nixfmt}/bin/nixfmt"` with `"${lib.getBin pkgs.haskellPackages.nixfmt}/bin/nixfmt"` or `"${lib.getExe pkgs.haskellPackages.nixfmt}"`. The binaries also won’t be in scope if you rely on them being installed e.g. via `ghcWithPackages`. `environment.packages` picks the `bin` output automatically, so for normal installation no intervention is required. Also, toplevel attributes like `pkgs.nixfmt` are not impacted negatively by this change.
76787779- `spamassassin` no longer supports the `Hashcash` module. The module needs to be removed from the `loadplugin` list if it was copied over from the default `initPreConf` option.
+65-7
nixos/modules/services/web-apps/pict-rs.nix
···11{ lib, pkgs, config, ... }:
22-with lib;
22+33let
44 cfg = config.services.pict-rs;
55+ inherit (lib) maintainers mkOption types;
66+77+ is03 = lib.versionOlder cfg.package.version "0.4.0";
88+59in
610{
711 meta.maintainers = with maintainers; [ happysalada ];
812 meta.doc = ./pict-rs.md;
9131014 options.services.pict-rs = {
1111- enable = mkEnableOption (lib.mdDoc "pict-rs server");
1515+ enable = lib.mkEnableOption (lib.mdDoc "pict-rs server");
1616+1717+ package = mkOption {
1818+ type = types.package;
1919+ example = lib.literalExpression "pkgs.pict-rs";
2020+ description = lib.mdDoc ''
2121+ pict-rs package to use.
2222+ '';
2323+ };
2424+1225 dataDir = mkOption {
1326 type = types.path;
1427 default = "/var/lib/pict-rs";
1528 description = lib.mdDoc ''
2929+ The directory where to store the uploaded images & database.
3030+ '';
3131+ };
3232+3333+ repoPath = mkOption {
3434+ type = types.nullOr (types.path);
3535+ default = null;
3636+ description = lib.mdDoc ''
3737+ The directory where to store the database.
3838+ This option takes precedence over dataDir.
3939+ '';
4040+ };
4141+4242+ storePath = mkOption {
4343+ type = types.nullOr (types.path);
4444+ default = null;
4545+ description = lib.mdDoc ''
1646 The directory where to store the uploaded images.
4747+ This option takes precedence over dataDir.
1748 '';
1849 };
5050+1951 address = mkOption {
2052 type = types.str;
2153 default = "127.0.0.1";
···2355 The IPv4 address to deploy the service to.
2456 '';
2557 };
5858+2659 port = mkOption {
2760 type = types.port;
2861 default = 8080;
···3164 '';
3265 };
3366 };
6767+3468 config = lib.mkIf cfg.enable {
6969+ services.pict-rs.package = lib.mkDefault (
7070+ # An incompatible db change happened in the transition from 0.3 to 0.4.
7171+ if lib.versionAtLeast config.system.stateVersion "23.11"
7272+ then pkgs.pict-rs
7373+ else pkgs.pict-rs_0_3
7474+ );
7575+7676+ # Account for config differences between 0.3 and 0.4
7777+ assertions = [
7878+ {
7979+ assertion = !is03 || (cfg.repoPath == null && cfg.storePath == null);
8080+ message = ''
8181+ Using `services.pict-rs.repoPath` or `services.pict-rs.storePath` with pict-rs 0.3 or older has no effect.
8282+ '';
8383+ }
8484+ ];
8585+3586 systemd.services.pict-rs = {
3636- environment = {
3737- PICTRS__PATH = cfg.dataDir;
3838- PICTRS__ADDR = "${cfg.address}:${toString cfg.port}";
3939- };
8787+ # Pict-rs split it's database and image storage paths in 0.4.0.
8888+ environment =
8989+ if is03 then {
9090+ PICTRS__PATH = cfg.dataDir;
9191+ PICTRS__ADDR = "${cfg.address}:${toString cfg.port}";
9292+ } else {
9393+ PICTRS__REPO__PATH = if cfg.repoPath != null then cfg.repoPath else "${cfg.dataDir}/sled-repo";
9494+ PICTRS__STORE__PATH = if cfg.storePath != null then cfg.storePath else "${cfg.dataDir}/files";
9595+ PICTRS__SERVER__ADDR = "${cfg.address}:${toString cfg.port}";
9696+ };
4097 wantedBy = [ "multi-user.target" ];
4198 serviceConfig = {
4299 DynamicUser = true;
43100 StateDirectory = "pict-rs";
4444- ExecStart = "${pkgs.pict-rs}/bin/pict-rs";
101101+ ExecStart = if is03 then "${lib.getBin cfg.package}/bin/pict-rs" else "${lib.getBin cfg.package}/bin/pict-rs run";
45102 };
46103 };
47104 };
105105+48106}