Unverified Commit 8d642257 authored by Tomo's avatar Tomo Committed by GitHub
Browse files

nodePackages.shout: drop (#349715)

parents 75d8eea6 76c7c2dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -514,6 +514,10 @@

- `services.mautrix-meta` was updated to [0.4](https://github.com/mautrix/meta/releases/tag/v0.4.0). This release makes significant changes to the settings format. If you have custom settings you should migrate them to the new format. Unfortunately upstream provides little guidance for how to do this, but [the auto-migration code](https://github.com/mautrix/meta/blob/f5440b05aac125b4c95b1af85635a717cbc6dd0e/cmd/mautrix-meta/legacymigrate.go#L23) may serve as a useful reference. The NixOS module should warn you if you still have any old settings configured.

- The `nodePackages.shout` package has been removed because it was deprecated upstream in favor of `thelounge`.
  The `shout` top-level attribute was an alias to this package.
  The associated `services.shout` module has also been removed.

- The `indi-full` package no longer contains non-free drivers.
  To get the old collection of drivers use `indi-full-nonfree` or create your own collection of drivers by overriding indi-with-drivers.
  E.g.: `pkgs.indi-with-drivers.override {extraDrivers = with pkgs.indi-3rdparty; [indi-gphoto];}`
+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ in
      riemanntools = 203;
      subsonic = 204;
      # riak = 205; # unused, remove 2022-07-22
      #shout = 206; # dynamically allocated as of 2021-09-18
      #shout = 206; # dynamically allocated as of 2021-09-18, module removed 2024-10-19
      gateone = 207;
      namecoin = 208;
      #lxd = 210; # unused
+0 −1
Original line number Diff line number Diff line
@@ -1205,7 +1205,6 @@
  ./services/networking/shellhub-agent.nix
  ./services/networking/shorewall.nix
  ./services/networking/shorewall6.nix
  ./services/networking/shout.nix
  ./services/networking/sing-box.nix
  ./services/networking/sitespeed-io.nix
  ./services/networking/skydns.nix
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ in
    (mkRemovedOptionModule [ "services" "railcar" ] "the corresponding package has been removed from nixpkgs")
    (mkRemovedOptionModule [ "services" "replay-sorcery" ] "the corresponding package has been removed from nixpkgs as it is unmaintained upstream. Consider using `gpu-screen-recorder` or `obs-studio` instead.")
    (mkRemovedOptionModule [ "services" "seeks" ] "")
    (mkRemovedOptionModule [ "services" "shout" ] "shout was removed because it was deprecated upstream in favor of thelounge.")
    (mkRemovedOptionModule [ "services" "ssmtp" ] ''
      The ssmtp package and the corresponding module have been removed due to
      the program being unmaintained. The options `programs.msmtp.*` can be
+0 −115
Original line number Diff line number Diff line
{ pkgs, lib, config, ... }:

with lib;

let
  cfg = config.services.shout;
  shoutHome = "/var/lib/shout";

  defaultConfig = pkgs.runCommand "config.js" { preferLocalBuild = true; } ''
    EDITOR=true ${pkgs.shout}/bin/shout config --home $PWD
    mv config.js $out
  '';

  finalConfigFile = if (cfg.configFile != null) then cfg.configFile else ''
    var _ = require('${pkgs.shout}/lib/node_modules/shout/node_modules/lodash')

    module.exports = _.merge(
      {},
      require('${defaultConfig}'),
      ${builtins.toJSON cfg.config}
    )
  '';

in {
  options.services.shout = {
    enable = mkEnableOption "Shout web IRC client";

    private = mkOption {
      type = types.bool;
      default = false;
      description = ''
        Make your shout instance private. You will need to configure user
        accounts by adding entries in {file}`${shoutHome}/users`.
      '';
    };

    listenAddress = mkOption {
      type = types.str;
      default = "0.0.0.0";
      description = "IP interface to listen on for http connections.";
    };

    port = mkOption {
      type = types.port;
      default = 9000;
      description = "TCP port to listen on for http connections.";
    };

    configFile = mkOption {
      type = types.nullOr types.lines;
      default = null;
      description = ''
        Contents of Shout's {file}`config.js` file.

        Used for backward compatibility, recommended way is now to use
        the `config` option.

        Documentation: http://shout-irc.com/docs/server/configuration.html
      '';
    };

    config = mkOption {
      default = {};
      type = types.attrs;
      example = {
        displayNetwork = false;
        defaults = {
          name = "Your Network";
          host = "localhost";
          port = 6697;
        };
      };
      description = ''
        Shout {file}`config.js` contents as attribute set (will be
        converted to JSON to generate the configuration file).

        The options defined here will be merged to the default configuration file.

        Documentation: http://shout-irc.com/docs/server/configuration.html
      '';
    };
  };

  config = mkIf cfg.enable {
    users.users.shout = {
      isSystemUser = true;
      group = "shout";
      description = "Shout daemon user";
      home = shoutHome;
      createHome = true;
    };
    users.groups.shout = {};

    systemd.services.shout = {
      description = "Shout web IRC client";
      wantedBy = [ "multi-user.target" ];
      wants = [ "network-online.target" ];
      after = [ "network-online.target" ];
      preStart = "ln -sf ${pkgs.writeText "config.js" finalConfigFile} ${shoutHome}/config.js";
      script = concatStringsSep " " [
        "${pkgs.shout}/bin/shout"
        (if cfg.private then "--private" else "--public")
        "--port" (toString cfg.port)
        "--host" (toString cfg.listenAddress)
        "--home" shoutHome
      ];
      serviceConfig = {
        User = "shout";
        ProtectHome = "true";
        ProtectSystem = "full";
        PrivateTmp = "true";
      };
    };
  };
}
Loading